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KKyAgICAgKiAKKyAgICAgKiA8cD5FeGFtcGxlOiBzZXREaXNwbGF5T3B0aW9ucygwLCBESVNQTEFZX0hJREVfSE9NRSkgd2lsbCBkaXNhYmxlIHRoZQorICAgICAqIHtAbGluayAjRElTUExBWV9ISURFX0hPTUV9IG9wdGlvbi4KKyAgICAgKiBzZXREaXNwbGF5T3B0aW9ucyhESVNQTEFZX0hJREVfSE9NRSwgRElTUExBWV9ISURFX0hPTUUgfCBESVNQTEFZX1VTRV9MT0dPKQorICAgICAqIHdpbGwgZW5hYmxlIHtAbGluayAjRElTUExBWV9ISURFX0hPTUV9IGFuZCBkaXNhYmxlIHtAbGluayAjRElTUExBWV9VU0VfTE9HT30uCisgICAgICogCisgICAgICogQHBhcmFtIG9wdGlvbnMgQSBjb21iaW5hdGlvbiBvZiB0aGUgYml0cyBkZWZpbmVkIGJ5IHRoZSBESVNQTEFZXyBjb25zdGFudHMKKyAgICAgKiAgICAgICAgICAgICAgICBkZWZpbmVkIGluIEFjdGlvbkJhci4KKyAgICAgKiBAcGFyYW0gbWFzayBBIGJpdCBtYXNrIGRlY2xhcmluZyB3aGljaCBkaXNwbGF5IG9wdGlvbnMgc2hvdWxkIGJlIGNoYW5nZWQuCisgICAgICovCisgICAgcHVibGljIGFic3RyYWN0IHZvaWQgc2V0RGlzcGxheU9wdGlvbnMoaW50IG9wdGlvbnMsIGludCBtYXNrKTsKKyAgICAKKyAgICAvKioKKyAgICAgKiBTZXQgdGhlIEFjdGlvbkJhcidzIGJhY2tncm91bmQuCisgICAgICogCisgICAgICogQHBhcmFtIGQgQmFja2dyb3VuZCBkcmF3YWJsZQorICAgICAqLworICAgIHB1YmxpYyBhYnN0cmFjdCB2b2lkIHNldEJhY2tncm91bmREcmF3YWJsZShEcmF3YWJsZSBkKTsKKyAgICAKKyAgICAvKioKKyAgICAgKiBAcmV0dXJuIFRoZSBjdXJyZW50IGN1c3RvbSBuYXZpZ2F0aW9uIHZpZXcuCisgICAgICovCisgICAgcHVib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ICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd193aW5kb3dOb0Rpc3BsYXksIGZhbHNlKTsKKyAgICAgICAgaWYgKHNhdmVkSW5zdGFuY2VTdGF0ZSAhPSBudWxsKSB7CisgICAgICAgICAgICBQYXJjZWxhYmxlIHAgPSBzYXZlZEluc3RhbmNlU3RhdGUuZ2V0UGFyY2VsYWJsZShGUkFHTUVOVFNfVEFHKTsKKyAgICAgICAgICAgIG1GcmFnbWVudHMucmVzdG9yZUFsbFN0YXRlKHAsIG1MYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlcyAhPSBudWxsCisgICAgICAgICAgICAgICAgICAgID8gbUxhc3ROb25Db25maWd1cmF0aW9uSW5zdGFuY2VzLmZyYWdtZW50cyA6IG51bGwpOworICAgICAgICB9CisgICAgICAgIG1GcmFnbWVudHMuZGlzcGF0Y2hDcmVhdGUoKTsKICAgICAgICAgbUNhbGxlZCA9IHRydWU7CiAgICAgfQogCkBAIC05MTQsNiArOTM2LDEwIEBACiAgICAgICAgICAgICBtVGl0bGVSZWFkeSA9IHRydWU7CiAgICAgICAgICAgICBvblRpdGxlQ2hhbmdlZChnZXRUaXRsZSgpLCBnZXRUaXRsZUNvbG9yKCkpOwogICAgICAgICB9CisgICAgICAgIGlmIChtV2luZG93ICE9IG51bGwgJiYgbVdpbmRvdy5oYXNGZWF0dXJlKFdpbmRvdy5GRUFUVVJFX0FDVElPTl9CQVIpKSB7CisgICAgICAgICAgICAvLyBJbnZhbGlkYXRlIHRoZSBhY3Rpb24gYmFyIG1lbnUgc28gdGhhdCBpdCBjYW4gaW5pdGlhbGl6ZSBwcm9wZXJseS4gCisgICAgICAgICAgICBtV2luZG93LmludmFsaWRhdGVQYW5lbE1lbnUoV2luZG93LkZFQVRVUkVfQUNUSU9OX0JBUik7CisgICAgICAgIH0KICAgICAgICAgbUNhbGxlZCA9IHRydWU7CiAgICAgfQogCkBAIC0xMDg0LDY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WV3CisgICAgICogaXMgc2V0LiBUaGlzIGZ1bmN0aW9uIHdpbGwgcmV0dXJuIG51bGwgaWYgY2FsbGVkIGJlZm9yZSB7QGxpbmsgI3NldENvbnRlbnRWaWV3fQorICAgICAqIG9yIHtAbGluayAjYWRkQ29udGVudFZpZXd9LgorICAgICAqIEByZXR1cm4gVGhlIEFjdGl2aXR5J3MgQWN0aW9uQmFyLCBvciBudWxsIGlmIGl0IGRvZXMgbm90IGhhdmUgb25lLgorICAgICAqLworICAgIHB1YmxpYyBBY3Rpb25CYXIgZ2V0QWN0aW9uQmFyKCkgeworICAgICAgICByZXR1cm4gbUFjdGlvbkJhcjsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogQ3JlYXRlcyBhIG5ldyBBY3Rpb25CYXIsIGxvY2F0ZXMgdGhlIGluZmxhdGVkIEFjdGlvbkJhclZpZXcsCisgICAgICogaW5pdGlhbGl6ZXMgdGhlIEFjdGlvbkJhciB3aXRoIHRoZSB2aWV3LCBhbmQgc2V0cyBtQWN0aW9uQmFyLgorICAgICAqLworICAgIHByaXZhdGUgdm9pZCBpbml0QWN0aW9uQmFyKCkgeworICAgICAgICBpZiAoIWdldFdpbmRvdygpLmhhc0ZlYXR1cmUoV2luZG93LkZFQVRVUkVfQUNUSU9OX0JBUikpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgQWN0aW9uQmFyVmlldyB2aWV3ID0gKEFjdGlvbkJhclZpZXcpIGZpbmRWaWV3QnlJZChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmlkLmFjdGlvbl9iYXIpOworICAgICAgICBpZiAodmlldyAhPSBudWxsKSB7CisgICAgICAgIAlMaW5lYXJMYXlvdXQgc3BsaXRWaWV3ID0gCisgICAgICAgIAkJKExpbmVhckxheW91dCkgZmluZFZpZXdCeUlkKGNvbS5hbmRyb2lkLmludGVybmFsLlIuaWQuY29udGV4dF9hY3Rpb25fYmFyKTsKKyAg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zIGZyYWdtZW50cyB0aGF0IGFyZSBjdXJyZW50bHkgYWRkZWQgdG8gdGhlIGFjdGl2aXR5J3MgY29udGVudC4KKyAgICAgKiBAcmV0dXJuIFRoZSBmcmFnbWVudCBpZiBmb3VuZCBvciBudWxsIG90aGVyd2lzZS4KKyAgICAgKi8KKyAgICBwdWJsaWMgRnJhZ21lbnQgZmluZEZyYWdtZW50QnlUYWcoU3RyaW5nIHRhZykgeworICAgICAgICByZXR1cm4gbUZyYWdtZW50cy5maW5kRnJhZ21lbnRCeVRhZyh0YWcpOworICAgIH0KKyAgICAKICAgICAvKioKICAgICAgKiBTZXQgdGhlIGFjdGl2aXR5IGNvbnRlbnQgZnJvbSBhIGxheW91dCByZXNvdXJjZS4gIFRoZSByZXNvdXJjZSB3aWxsIGJlCiAgICAgICogaW5mbGF0ZWQsIGFkZGluZyBhbGwgdG9wLWxldmVsIHZpZXdzIHRvIHRoZSBhY3Rpdml0eS4KQEAgLTE2NDUsNiArMTcxOSw3IEBACiAgICAgICovCiAgICAgcHVibGljIHZvaWQgc2V0Q29udGVudFZpZXcoaW50IGxheW91dFJlc0lEKSB7CiAgICAgICAgIGdldFdpbmRvdygpLnNldENvbnRlbnRWaWV3KGxheW91dFJlc0lEKTsKKyAgICAgICAgaW5pdEFjdGlvbkJhcigpOwogICAgIH0KIAogICAgIC8qKgpAQCAtMTY1Niw2ICsxNzMxLDcgQEAKICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBzZXRDb250ZW50VmlldyhWaWV3IHZpZXcpIHsKICAgICAgICAgZ2V0V2luZG93KCkuc2V0Q29udGVudFZpZXcodmlldyk7CisgICAgICAgIGluaXRBY3Rpb25CYXIoKTsKICAgICB9CiAKICAgICAvKioKQEAgLTE2NjgsNiArMTc0NCw3IEBACiAgICAgICovCiAgICAgcHVibGljIHZvaWQgc2V0Q29udGVudFZpZXcoVmlldyB2aWV3LCBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zIHBhcmFtcykgewogICAgICA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AgICAgfQogICAgIH0KIAogICAgIC8qKgpAQCAtMjE0NSw3ICsyMjQzLDkgQEAKICAgICAgKi8KICAgICBwdWJsaWMgYm9vbGVhbiBvbkNyZWF0ZVBhbmVsTWVudShpbnQgZmVhdHVyZUlkLCBNZW51IG1lbnUpIHsKICAgICAgICAgaWYgKGZlYXR1cmVJZCA9PSBXaW5kb3cuRkVBVFVSRV9PUFRJT05TX1BBTkVMKSB7Ci0gICAgICAgICAgICByZXR1cm4gb25DcmVhdGVPcHRpb25zTWVudShtZW51KTsKKyAgICAgICAgICAgIGJvb2xlYW4gc2hvdyA9IG9uQ3JlYXRlT3B0aW9uc01lbnUobWVudSk7CisgICAgICAgICAgICBzaG93IHw9IG1GcmFnbWVudHMuZGlzcGF0Y2hDcmVhdGVPcHRpb25zTWVudShtZW51LCBnZXRNZW51SW5mbGF0ZXIoKSk7CisgICAgICAgICAgICByZXR1cm4gc2hvdzsKICAgICAgICAgfQogICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgfQpAQCAtMjE2Miw2ICsyMjYyLDcgQEAKICAgICBwdWJsaWMgYm9vbGVhbiBvblByZXBhcmVQYW5lbChpbnQgZmVhdHVyZUlkLCBWaWV3IHZpZXcsIE1lbnUgbWVudSkgewogICAgICAgICBpZiAoZmVhdHVyZUlkID09IFdpbmRvdy5GRUFUVVJFX09QVElPTlNfUEFORUwgJiYgbWVudSAhPSBudWxsKSB7CiAgICAgICAgICAgICBib29sZWFuIGdvZm9yaXQgPSBvblByZXBhcmVPcHRpb25zTWVudShtZW51KTsKKyAgICAgICAgICAgIGdvZm9yaXQgfD0gbUZyYWdtZW50cy5kaXNwYXRjaFByZXBhcmVPcHRpb25zTWVudShtZW51KTsKICAgICAgICAgICAgIHJldHVybiBnb2Zvcml0ICYmIG1lbnUuaGFzVmlzaWJsZUl0ZW1zKCk7CiAgICAgICAgIH0KICAgICAgICAgcmV0dXJuIHRydWU7CkBAIC0yMTkyLDExICsyMjkzLDE3IEBACiAgICAgICAgICAgICAgICAgLy8gZG9lc24ndCBjYWxsIHRocm91Z2ggdG8gc3VwZXJjbGFzcydzIGltcGxtZWVudGF0aW9uIG9mIGVhY2gKICAgICAgICAgICAgICAgICAvLyBvZiB0aGVzZSBtZXRob2RzIGJlbG93CiAgICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudCg1MDAwMCwgMCwgaXRlbS5nZXRUaXRsZUNvbmRlbnNlZCgpKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gb25PcHRpb25zSXRlbVNlbGVjdGVkKGl0ZW0pOworICAgICAgICAgICAgICAgIGlmIChvbk9wdGlvbnNJdGVtU2VsZWN0ZWQoaXRlbSkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBtRnJhZ21lbnRzLmRpc3BhdGNoT3B0aW9uc0l0ZW1TZWxlY3RlZChpdGVtKTsKICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgIGNhc2UgV2luZG93LkZFQVRVUkVfQ09OVEVYVF9NRU5VOgogICAgICAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoNTAwMDAsIDEsIGl0ZW0uZ2V0VGl0bGVDb25kZW5zZWQoKSk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIG9uQ29udGV4dEl0ZW1TZWxlY3RlZChpdGVtKTsKKyAgICAgICAgICAgICAgICBpZiAob25Db250ZXh0SXRlbVNlbGVjdGVkKGl0ZW0pKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gbUZyYWdtZW50cy5kaXNwYXRjaENvbnRleHRJdGVtU2VsZWN0ZWQoaXRlbSk7CiAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKQEAgLTIyMTUsNiArMjMyMiw3IEBACiAgICAgcHVibGljIHZvaWQgb25QYW5lbENsb3NlZChpbnQgZmVhdHVyZUlkLCBNZW51IG1lbnUpIHsKICAgICAgICAgc3dpdGNoIChmZWF0dXJlSWQpIHsKICAgICAgICAgICAgIGNhc2UgV2luZG93LkZFQVRVUkVfT1BUSU9OU19QQU5FTDoKKyAgICAgICAgICAgICAgICBtRnJhZ21lbnRzLmRpc3BhdGNoT3B0aW9uc01lbnVDbG9zZWQobWVudSk7CiAgICAgICAgICAgICAgICAgb25PcHRpb25zTWVudUNsb3NlZChtZW51KTsKICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAKQEAgLTIyMjUsNiArMjMzMywxNSBAQAogICAgIH0KIAogICAgIC8qKgorICAgICAqIERlY2xhcmUgdGhhdCB0aGUgb3B0aW9ucyBtZW51IGhhcyBjaGFuZ2VkLCBzbyBzaG91bGQgYmUgcmVjcmVhdGVkLgorICAgICAqIFRoZSB7QGxpbmsgI29uQ3JlYXRlT3B0aW9uc01lbnUoTWVudSl9IG1ldGhvZCB3aWxsIGJlIGNhbGxlZCB0aGUgbmV4dAorICAgICAqIHRpbWUgaXQgbmVlZHMgdG8gYmUgZGlzcGxheWVkLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGludmFsaWRhdGVPcHRpb25zTWVudSgpIHsKKyAgICAgICAgbVdpbmRvdy5pbnZhbGlkYXRlUGFuZWxNZW51KFdpbmRvdy5GRUFUVVJFX09QVElPTlNfUEFORUwpOworICAgIH0KKyAgICAKKyAgICAvKioKICAgICAgKiBJbml0aWFsaXplIHRoZSBjb250ZW50cyBvZiB0aGUgQWN0aXZpdHkncyBzdGFuZGFyZCBvcHRpb25zIG1lbnUuICBZb3UKICAgICAgKiBzaG91bGQgcGxhY2UgeW91ciBtZW51IGl0ZW1zIGluIHRvIDx2YXI+bWVudTwvdmFyPi4KICAgICAgKiAKQEAgLTMwNjYsNiArMzE4MywzNiBAQAogICAgIH0KIAogICAgI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0dHJzKSB7Ci0gICAgICAgIHJldHVybiBudWxsOworICAgICAgICBpZiAoISJmcmFnbWVudCIuZXF1YWxzKG5hbWUpKSB7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgVHlwZWRBcnJheSBhID0gCisgICAgICAgICAgICBjb250ZXh0Lm9idGFpblN0eWxlZEF0dHJpYnV0ZXMoYXR0cnMsIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLkZyYWdtZW50KTsKKyAgICAgICAgU3RyaW5nIGZuYW1lID0gYS5nZXRTdHJpbmcoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuRnJhZ21lbnRfbmFtZSk7CisgICAgICAgIGludCBpZCA9IGEuZ2V0UmVzb3VyY2VJZChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5GcmFnbWVudF9pZCwgMCk7CisgICAgICAgIFN0cmluZyB0YWcgPSBhLmdldFN0cmluZyhjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5GcmFnbWVudF90YWcpOworICAgICAgICBhLnJlY3ljbGUoKTsKKyAgICAgICAgCisgICAgICAgIGlmIChpZCA9PSAwKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKGF0dHJzLmdldFBvc2l0aW9uRGVzY3JpcHRpb24oKQorICAgICAgICAgICAgICAgICAgICArICI6IE11c3Qgc3BlY2lmeSB1bmlxdWUgYW5kcm9pZDppZCBmb3IgIiArIGZuYW1lKTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIC8vIElmIHdlIHJlc3RvcmVkIGZyb20gYSBwcmV2aW91cyBzdGF0ZSwgd2UgbWF5IGFscmVhZHkgaGF2ZQorICAgICAgICAgICAgLy8gaW5zdGFudGlhdGVkIHRoaXMgZnJhZ21lbnQgZnJvbSB0aGUgc3RhdGUgYW5kIHNob3VsZCB1c2UKKyAgICAgICAgICAgIC8vIHRoYXQgaW5zdGFuY2UgaW5zdGVhZCBvZiBtYWtpbmcgYSBuZXcgb25lLgorICAgICAgICAgICAgRnJhZ21lbnQgZnJhZ21lbnQgPSBtRnJhZ21lbnRzLmZpbmRGcmFnbWVudEJ5SWQoaWQpOworICAgICAgICAgICAgaWYgKEZyYWdtZW50TWFuYWdlci5ERUJVRykgTG9nLnYoVEFHLCAib25DcmVhdGVWaWV3OiBpZD0weCIKKyAgICAgICAgICAgICAgICAgICAgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKGlkKSArICIgZm5hbWU9IiArIGZuYW1lCisgICAgICAgICAgICAgICAgICAgICsgIiBleGlzdGluZz0iICsgZnJhZ21lbnQpOworICAgICAgICAgICAgaWYgKGZyYWdtZW50ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBmcmFnbWVudCA9IEZyYWdtZW50Lmluc3RhbnRpYXRlKHRoaXMsIGZuYW1lKTsKKyAgICAgICAgICAgICAgICBmcmFnbWVudC5tRnJvbUxheW91dCA9IHRydWU7CisgICAgICAgICAgICAgICAgZnJhZ21lbnQubUZyYWdtZW50SWQgPSBpZDsKKyAgICAgICAgICAgICAgICBmcmFnbWVudC5tVGFnID0gdGFnOworICAgICAgICAgICAgICAgIGZyYWdtZW50Lm1JbW1lZGlhdGVBY3Rpdml0eSA9IHRoaXM7CisgICAgICAgICAgICAgICAgbUZyYWdtZW50cy5hZGRGcmFnbWVudChmcmFnbWVudCwgdHJ1ZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBJZiB0aGlzIGZyYWdtZW50IGlzIG5ld2x5IGluc3RhbnRpYXRlZCAoZWl0aGVyIHJpZ2h0IG5vdywgb3IKKyAgICAgICAgICAgIC8vIGZyb20gbGFzdCBzYXZlZCBzdGF0ZSksIHRoZW4gZ2l2ZSBpdCB0aGUgYXR0cmlidXRlcyB0bworICAgICAgICAgICAgLy8gaW5pdGlhbGl6ZSBpdHNlbGYuCisgICAgICAgICAgICBpZiAoIWZyYWdtZW50Lm1SZXRhaW5pbmcpIHsKKyAgICAgICAgICAgICAgICBmcmFnbWVudC5vbkluZmxhdGUodGhpcywgYXR0cnMsIGZyYWdtZW50Lm1TYXZlZEZyYWdtZW50U3RhdGUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGZyYWdtZW50Lm1WaWV3ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJGcmFnbWVudCAiICsgZm5hbWUKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiBkaWQgbm90IGNyZWF0ZSBhIHZpZXcuIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmcmFnbWVudC5tVmlldy5zZXRJZChpZCk7CisgICAgICAgICAgICBpZiAoZnJhZ21lbnQubVZpZXcuZ2V0VGFnKCkgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZyYWdtZW50Lm1WaWV3LnNldFRhZyh0YWcpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGZyYWdtZW50Lm1WaWV3OworICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgSW5mbGF0ZUV4Y2VwdGlvbiBpZSA9IG5ldyBJbmZsYXRlRXhjZXB0aW9uKGF0dHJzLmdldFBvc2l0aW9uRGVzY3JpcHRpb24oKQorICAgICAgICAgICAgICAgICAgICArICI6IEVycm9yIGluZmxhdGluZyBmcmFnbWVudCAiICsgZm5hbWUpOworICAgICAgICAgICAgaWUuaW5pdENhdXNlKGUpOworICAgICAgICAgICAgdGhyb3cgaWU7CisgICAgICAgIH0KICAgICB9CiAKICAgICAvKioKQEAgLTM3NjgsMjMgKzM5ODEsMjUgQEAKIAogICAgIGZpbmFsIHZvaWQgYXR0YWNoKENvbnRleHQgY29udGV4dCwgQWN0aXZpd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gICBwZXJmb3JtUmVzdGFydCgpOwogICAgICAgICAKLSAgICAgICAgbUxhc3ROb25Db25maWd1cmF0aW9uSW5zdGFuY2UgPSBudWxsOworICAgICAgICBtTGFzdE5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZXMgPSBudWxsOwogICAgICAgICAKICAgICAgICAgLy8gRmlyc3QgY2FsbCBvblJlc3VtZSgpIC1iZWZvcmUtIHNldHRpbmcgbVJlc3VtZWQsIHNvIHdlIGRvbid0CiAgICAgICAgIC8vIHNlbmQgb3V0IGFueSBzdGF0dXMgYmFyIC8gbWVudSBub3RpZmljYXRpb25zIHRoZSBjbGllbnQgbWFrZXMuCkBAIC0zODcwLDYgKzQwODksOSBAQAogICAgICAgICAvLyBOb3cgcmVhbGx5IHJlc3VtZSwgYW5kIGluc3RhbGwgdGhlIGN1cnJlbnQgc3RhdHVzIGJhciBhbmQgbWVudS4KICAgICAgICAgbVJlc3VtZWQgPSB0cnVlOwogICAgICAgICBtQ2FsbGVkID0gZmFsc2U7CisgICAgICAgIAorICAgICAgICBtRnJhZ21lbnRzLmRpc3BhdGNoUmVzdW1lKCk7CisgICAgICAgIAogICAgICAgICBvblBvc3RSZXN1bWUoKTsKICAgICAgICAgaWYgKCFtQ2FsbGVkKSB7CiAgICAgICAgICAgICB0aHJvdyBuZXcgU3VwZXJOb3RDYWxsZWRFeGNlcHRpb24oCkBAIC0zODc5LDYgKzQxMDEsNyBAQAogICAgIH0KIAogICAgIGZpbmFsIHZvaWQgcGVyZm9ybVBhdXNlKCkgeworICAgICAgICBtRnJhZ21lbnRzLmRpc3BhdGNoUGF1c2UoKTsKICAgICAgICAgb25QYXVzZSgpOwogICAgIH0KICAgICAKQEAgLTM4OTMsNiArNDExNiw4IEBACiAgICAgICAgICAgICAgICAgbVdpbmRvdy5jbG9zZUFsbFBhbmVscygpOwogICAgICAgICAgICAgfQogCisgICAgICAgICAgICBtRnJhZ21lbnRzLmRpc3BhdGNoU3RvcCgpOworICAgICAgICAgICA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AgICAgICBkYlN0YXRzLmxvb2thc2lkZSwgZGJTdGF0cy5kYk5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRiU3RhdHMubG9va2FzaWRlLCBkYlN0YXRzLmNhY2hlLCBkYlN0YXRzLmRiTmFtZSk7CiAgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCcsJyk7CiAgICAgICAgICAgICAgICAgfQogCkBAIC04MTksMTEgKzgxOSwxMiBAQAogICAgICAgICAgICAgaW50IE4gPSBzdGF0cy5kYlN0YXRzLnNpemUoKTsKICAgICAgICAgICAgIGlmIChOID4gMCkgewogICAgICAgICAgICAgICAgIHB3LnByaW50bG4oIiBEQVRBQkFTRVMiKTsKLSAgICAgICAgICAgICAgICBwcmludFJvdyhwdywgIiAgJThzICU4cyAlMTBzICAlcyIsICJQYWdlc2l6ZSIsICJEYnNpemUiLCAiTG9va2FzaWRlIiwgIkRibmFtZSIpOworICAgICAgICAgICAgICAgIHByaW50Um93KHB3LCAiICAlNHMgJTZzICU4cyAlMTRzICAlcyIsICJwZ3N6IiwgImRic3oiLCAibGthc2lkZSIsICJjYWNoZSIsCisgICAgICAgICAgICAgICAgICAgICJEYm5hbWUiKTsKICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IE47IGkrKykgewogICAgICAgICAgICAgICAgICAgICBEYlN0YXRzIGRiU3RhdHMgPSBzdGF0cy5kYlN0YXRzLmdldChpKTsKICAgICAgICAgICAgICAgICAgICAgcHJpbnRSb3cocHcsIERCX0lORk9fRk9STUFULCBkYlN0YXRzLnBhZ2VTaXplLCBkYlN0YXRzLmRiU2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYlN0YXRzLmxvb2thc2lkZSwgZGJTdGF0cy5kYk5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRiU3RhdHMubG9va2FzaWRlLCBkYlN0YXRzLmNhY2hlLCBkYlN0YXRzLmRiTmFtZSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogCkBAIC0xMDQ5LDggKzEwNTAsMjcgQEAKIAogICAgICAgICB2b2lkIG1heWJlU25hcHNob3QoKSB7CiAgICAgICAgICAgICBpZiAobUJvdW5kQXBwbGljYXRpb24gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIFNhbXBsaW5nUHJvZmlsZXJJbnRlZ3JhdGlvbi53cml0ZVNuYXBzaG90KAotICAgICAgICAgICAgICAgICAgICAgICAgbUJvdW5kQXBwbGljYXRpb24ucHJvY2Vzc05hbWUpOworICAgICAgICAgICAgICAgIC8vIGNvbnZlcnQgdGhlICpwcml2YXRlKiBBY3Rpdml0eVRocmVhZC5QYWNrYWdlSW5mbyB0byAqcHVibGljKiBrbm93bgorICAgICAgICAgICAgICAgIC8vIGFuZHJvaWQuY29udGVudC5wbS5QYWNrYWdlSW5mbworICAgICAgICAgICAgICAgIFN0cmluZyBwYWNrYWdlTmFtZSA9IG1Cb3VuZEFwcGxpY2F0aW9uLmluZm8ubVBhY2thZ2VOYW1lOworICAgICAgICAgICAgICAgIGFuZHJvaWQuY29udGVudC5wbS5QYWNrYWdlSW5mbyBwYWNrYWdlSW5mbyA9IG51bGw7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgQ29udGV4dCBjb250ZXh0ID0gZ2V0U3lzdGVtQ29udGV4dCgpOworICAgICAgICAgICAgICAgICAgICBpZihjb250ZXh0ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgImNhbm5vdCBnZXQgYSB2YWxpZCBjb250ZXh0Iik7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgUGFja2FnZU1hbmFnZXIgcG0gPSBjb250ZXh0LmdldFBhY2thZ2VNYW5hZ2VyKCk7CisgICAgICAgICAgICAgICAgICAgIGlmKHBtID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgImNhbm5vdCBnZXQgYSB2YWxpZCBQYWNrYWdlTWFuYWdlciIpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHBhY2thZ2VJbmZvID0gcG0uZ2V0UGFja2FnZUluZm8oCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFja2FnZU5hbWUsIFBhY2thZ2VNYW5hZ2VyLkdFVF9BQ1RJVklUSUVTKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChOYW1lTm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJjYW5ub3QgZ2V0IHBhY2thZ2UgaW5mbyBmb3IgIiArIHBhY2thZ2VOYW1lLCBlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgU2FtcGxpbmdQcm9maWxlckludGVncmF0aW9uLndyaXRlU25hcHNob3QobUJvdW5kQXBwbGljYXRpb24ucHJvY2Vzc05hbWUsIHBhY2thZ2VJbmZvKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KQEAgLTE0NDEsNyArMTQ2MSw3IEBACiAKICAgICBwdWJsaWMgZmluYWwgQWN0aXZpdHkgc3RhcnRBY3Rpdml0eU5vdyhBY3Rpdml0eSBwYXJlbnQsIFN0cmluZyBpZCwKICAgICAgICAgSW50ZW50IGludGVudCwgQWN0aXZpdHlJbmZvIGFjdGl2aXR5SW5mbywgSUJpbmRlciB0b2tlbiwgQnVuZGxlIHN0YXRlLAotICAgICAgICBPYmplY3QgbGFzdE5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZSkgeworICAgICAgICBBY3Rpdml0eS5Ob25Db25maWd1cmF0aW9uSW5zdGFuY2VzIGxhc3ROb25Db25maWd1cmF0aW9uSW5zdGFuY2VzKSB7CiAgICAgICAgIEFjdGl2aXR5Q2xpZW50UmVjb3JkIHIgPSBuZXcgQWN0aXZpdHlDbGllbnRSZWNvcmQoKTsKICAgICAgICAgICAgIHIudG9rZW4gPSB0b2tlbjsKICAgICAgICAgICAgIHIuaWRlbnQgPSAwOwpAQCAtMTQ1MCw3ICsxNDcwLDcgQEAKICAgICAgICAgICAgIHIucGFyZW50ID0gcGFyZW50OwogICAgICAgICAgICAgci5lbWJlZGRlZElEID0gaWQ7CiAgICAgICAgICAgICByLmFjdGl2aXR5SW5mbyA9IGFjdGl2aXR5SW5mbzsKLSAgICAgICAgICAgIHIubGFzdE5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZSA9IGxhc3ROb25Db25maWd1cmF0aW9uSW5zdGFuY2U7CisgICAgICAgICAgICByLmxhc3ROb25Db25maWd1cmF0aW9uSW5zdGFuY2VzID0gbGFzdE5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZXM7CiAgICAgICAgIGlmIChsb2NhbExPR1YpIHsKICAgICAgICAgICAgIENvbXBvbmVudE5hbWUgY29tcG5hbWUgPSBpbnRlbnQuZ2V0Q29tcG9uZW50KCk7CiAgICAgICAgICAgICBTdHJpbmcgbmFtZTsKQEAgLTE1NzIsMTQgKzE1OTIsMTIgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICsgci5hY3Rpdml0eUluZm8ubmFtZSArICIgd2l0aCBjb25maWcgIiArIGNvbmZpZyk7CiAgICAgICAgICAgICAgICAgYWN0aXZpdHkuYXR0YWNoKGFwcENvbnRleHQsIHRoaXMsIGdldEluc3RydW1lbnRhdGlvbigpLCByLnRva2VuLAogICAgICAgICAgICAgICAgICAgICAgICAgci5pZGVudCwgYXBwLCByLmludGVudCwgci5hY3Rpdml0eUluZm8sIHRpdGxlLCByLnBhcmVudCwKLSAgICAgICAgICAgICAgICAgICAgICAgIHIuZW1iZWRkZWRJRCwgci5sYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgci5sYXN0Tm9uQ29uZmlndXJhdGlvbkNoaWxkSW5zdGFuY2VzLCBjb25maWcpOworICAgICAgICAgICAgICAgICAgICAgICAgci5lbWJlZGRlZElELCByLmxhc3ROb25Db25maWd1cmF0aW9uSW5zdGFuY2VzLCBjb25maWcpOwogCiAgICAgICAgICAgICAgICAgaWYgKGN1c3RvbUludGVudCAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgIGFjdGl2aXR5Lm1JbnRlbnQgPSBjdXN0b21JbnRlbnQ7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHIubGFzdE5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZSA9IG51bGw7Ci0gICAgICAgICAgICAgICAgci5sYXN0Tm9uQ29uZmlndXJhdGlvbkNoaWxkSW5zdGFuY2VzID0gbnVsbDsKKyAgICAgICAgICAgICAgICByLmxhc3ROb25Db25maWd1cmF0aW9uSW5zdGFuY2VzID0gbnVsbDsKICAgICAgICAgICAgICAgICBhY3Rpdml0eS5tU3RhcnRlZEFjdGl2aXR5ID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgaW50IHRoZW1lID0gci5hY3Rpdml0eUluZm8uZ2V0VGhlbWVSZXNvdXJjZSgpOwogICAgICAgICAgICAgICAgIGlmICh0aGVtZSAhPSAwKSB7CkBAIC0yNTM3LDYgKzI1NTUsOSBAQAogICAgICAgICAgICAgaWYgKGZpbmlzaGluZykgewogICAgICAgICAgICAgICAgIHIuYWN0aXZpdHkubUZpbmlzaGVkID0gdHJ1ZTsKICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChnZXROb25Db25maWdJbnN0YW5jZSkgeworICAgICAgICAgICAgICAgIHIuYWN0aXZpdHkubUNoYW5naW5nQ29uZmlndXJhdGlvbnMgPSB0cnVlOworICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKCFyLnBhdXNlZCkgewogICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgIHIuYWN0aXZpdHkubUNhbGxlZCA9IGZhbHNlOwpAQCAtMjU3Nyw4ICsyNTk4LDggQEAKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmIChnZXROb25Db25maWdJbnN0YW5jZSkgewogICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIHIubGFzdE5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gci5hY3Rpdml0eS5vblJldGFpbk5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZSgpOworICAgICAgICAgICAgICAgICAgICByLmxhc3ROb25Db25maWd1cmF0aW9uSW5zdGFuY2VzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSByLmFjdGl2aXR5LnJldGFpbk5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZXMoKTsKICAgICAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgICAgICAgICBpZiAoIW1JbnN0cnVtZW50YXRpb24ub25FeGNlcHRpb24oci5hY3Rpdml0eSwgZSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKApAQCAtMjU4NywyMiArMjYwOCwxMCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICI6ICIgKyBlLnRvU3RyaW5nKCksIGUpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIHIubGFzdE5vbkNvbmZpZ3VyYXRpb25DaGlsZEluc3RhbmNlcwotICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gci5hY3Rpdml0eS5vblJldGFpbk5vbkNvbmZpZ3VyYXRpb25DaGlsZEluc3RhbmNlcygpOwotICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICghbUluc3RydW1lbnRhdGlvbi5vbkV4Y2VwdGlvbihyLmFjdGl2aXR5LCBlKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJVbmFibGUgdG8gcmV0YWluIGNoaWxkIGFjdGl2aXRpZXMgIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHNhZmVUb0NvbXBvbmVudFNob3J0U3RyaW5nKHIuaW50ZW50KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICI6ICIgKyBlLnRvU3RyaW5nKCksIGUpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCiAgICAgICAgICAgICB9CiAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgIHIuYWN0aXZpdHkubUNhbGxlZCA9IGZhbHNlOwotICAgICAgICAgICAgICAgIHIuYWN0aXZpdHkub25EZXN0cm95KCk7CisgICAgICAgICAgICAgICAgbUluc3RydW1lbnRhdGlvbi5jYWxsQWN0aXZpdHlPbkRlc3Ryb3koci5hY3Rpdml0eSk7CiAgICAgICAgICAgICAgICAgaWYgKCFyLmFjdGl2aXR5Lm1DYWxsZWQpIHsKICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFN1cGVyTm90Q2FsbGVkRXhjZXB0aW9uKAogICAgICAgICAgICAgICAgICAgICAgICAgIkFjdGl2aXR5ICIgKyBzYWZlVG9Db21wb25lbnRTaG9ydFN0cmluZyhyLmludGVudCkgKwpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvYXBwL0JhY2tTdGFja0VudHJ5LmphdmEgYi9jb3JlL2phdmEvYW5kcm9pZC9hcHAvQmFja1N0YWNrRW50cnkuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi41ZTlhZWE1Ci0tL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5TGlzdDsKKworZmluYWwgY2xhc3MgQmFja1N0YWNrU3RhdGUgaW1wbGVtZW50cyBQYXJjZWxhYmxlIHsKKyAgICBmaW5hbCBpbnRbXSBtT3BzOworICAgIGZpbmFsIGludCBtVHJhbnNpdGlvbjsKKyAgICBmaW5hbCBpbnQgbVRyYW5zaXRpb25TdHlsZTsKKyAgICBmaW5hbCBTdHJpbmcgbU5hbWU7CisgICAgCisgICAgcHVibGljIEJhY2tTdGFja1N0YXRlKEZyYWdtZW50TWFuYWdlciBmbSwgQmFja1N0YWNrRW50cnkgYnNlKSB7CisgICAgICAgIG1PcHMgPSBuZXcgaW50W2JzZS5tTnVtT3AqNF07CisgICAgICAgIEJhY2tTdGFja0VudHJ5Lk9wIG9wID0gYnNlLm1IZWFkOworICAgICAgICBpbnQgcG9zID0gMDsKKyAgICAgICAgd2hpbGUgKG9wICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1PcHNbcG9zKytdID0gb3AuY21kOworICAgICAgICAgICAgbU9wc1twb3MrK10gPSBvcC5mcmFnbWVudC5tSW5kZXg7CisgICAgICAgICAgICBtT3BzW3BvcysrXSA9IG9wLmVudGVyQW5pbTsKKyAgICAgICAgICAgIG1PcHNbcG9zKytdID0gb3AuZXhpdEFuaW07CisgICAgICAgICAgICBvcCA9IG9wLm5leHQ7CisgICAgICAgIH0KKyAgICAgICAgbVRyYW5zaXRpb24gPSBic2UubVRyYW5zaXRpb247CisgICAgICAgIG1UcmFuc2l0aW9uU3R5bGUgPSBic2UubVRyYW5zaXRpb25TdHlsZTsKKyAgICAgICAgbU5hbWUgPSBic2UubU5hbWU7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBCYWNrU3RhY2tTdGF0ZShQYXJjZWwgaW4pIHsKKyAgICAgICAgbU9wcyA9IGluLmNyZWF0ZUludEFycmF5KCk7CisgICAgICAgIG1UcmFuc2l0aW9uID0gaW4ucmVhZEludCgpOworICAgICAgICBtVHJhbnNpdGlvblN0eWxlID0gaW4ucmVhZEludCgpOworICAgICAgICBtTmFtZSA9IGluLnJlYWRTdHJpbmcoKTsKKyAgICB9CisgICAgCisgICAgcHVibGljIEJhY2tTdGFja0VudHJ5IGluc3RhbnRpYXRlKEZyYWdtZW50TWFuYWdlciBmbSkgeworICAgICAgICBCYWNrU3RhY2tFbnRyeSBic2UgPSBuZXcgQmFja1N0YWNrRW50cnkoZm0pOworICAgICAgICBpbnQgcG9zID0gMDsKKyAgICAgICAgd2hpbGUgKHBvcyA8IG1PcHMubGVuZ3RoKSB7CisgICAgICAgICAgICBCYWNrU3RhY2tFbnRyeS5PcCBvcCA9IG5ldyBCYWNrU3RhY2tFbnRyeS5PcCgpOworICAgICAgICAgICAgb3AuY21kID0gbU9wc1twb3MrK107CisgICAgICAgICAgICBGcmFnbWVudCBmID0gZm0ubUFjdGl2ZS5nZXQobU9wc1twb3MrK10pOworICAgICAgICAgICAgZi5tQmFja1N0YWNrTmVzdGluZysrOworICAgICAgICAgICAgb3AuZnJhZ21lbnQgPSBmOworICAgICAgICAgICAgb3AuZW50ZXJBbmltID0gbU9wc1twb3MrK107CisgICAgICAgICAgICBvcC5leGl0QW5pbSA9IG1PcHNbcG9zKytdOworICAgICAgICAgICAgYnNlLmFkZE9wKG9wKTsKKyAgICAgICAgfQorICAgICAgICBic2UubVRyYW5zaXRpb24gPSBtVHJhbnNpdGlvbjsKKyAgICAgICAgYnNlLm1UcmFuc2l0aW9uU3R5bGUgPSBtVHJhbnNpdGlvblN0eWxlOworICAgICAgICBic2UubU5hbWUgPSBtTmFtZTsKKyAgICAgICAgcmV0dXJuIGJzZTsKKyAgICB9CisgICAgCisgICAgcHVibGljIGludCBkZXNjcmliZUNvbnRlbnRzKCkgeworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB3cml0ZVRvUGFyY2VsKFBhcmNlbCBkZXN0LCBpbnQgZmxhZ3MpIHsKKyAgICAgICAgZGVzdC53cml0ZUludEFycmF5KG1PcHMpOworICAgICAgICBkZXN0LndyaXRlSW50KG1UcmFuc2l0aW9uKTsKKyAgICAgICAgZGVzdC53cml0ZUludChtVHJhbnNpdGlvblN0eWxlKTsKKyAgICAgICAgZGVzdC53cml0ZVN0cmluZyhtTmFtZSk7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgUGFyY2VsYWJsZS5DcmVhdG9yPEJhY2tTdGFja1N0YXRlPiBDUkVBVE9SCisgICAgICAgICAgICA9IG5ldyBQYXJjZWxhYmxlLkNyZWF0b3I8QmFja1N0YWNrU3RhdGU+KCkgeworICAgICAgICBwdWJsaWMgQmFja1N0YWNrU3RhdGUgY3JlYXRlRnJvbVBhcmNlbChQYXJjZWwgaW4pIHsKKyAgICAgICAgICAgIHJldHVybiBuZXcgQmFja1N0YWNrU3RhdGUoaW4pOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBwdWJsaWMgQmFja1N0YWNrU3RhdGVbXSBuZXdBcnJheShpbnQgc2l6ZSkgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBCYWNrU3RhY2tTdGF0ZVtzaXplXTsKKyAgICAgICAgfQorICAgIH07Cit9CisKKy8qKgorICogQGhpZGUgRW50cnkgb2YgYW4gb3BlcmF0aW9uIG9uIHRoZSBmcmFnbWVudCBiYWNrIHN0YWNrLgorICovCitmaW5hbCBjbGFzcyBCYWNrU3RhY2tFbnRyeSBpbXBsZW1lbnRzIEZyYWdtZW50VHJhbnNhY3Rpb24sIFJ1bm5hYmxlIHsKKyAgICBmaW5hbCBGcmFnbWVudE1hbmFnZXIgbU1hbmFnZXI7CisgICAgCisgICAgc3RhdGljIGZpbmFsIGludCBPUF9OVUxMID0gMDsKKyAgICBzdGF0aWMgZmluYWwgaW50IE9QX0FERCA9IDE7CisgICAgc3RhdGljIGZpbmFsIGludCBPUF9SRVBMQUNFID0gMjsKKyAgICBzdGF0aWMgZmluYWwgaW50IE9QX1JFTU9WRSA9IDM7CisgICAgc3RhdGljIGZpbmFsIGludCBPUF9ISURFID0gNDsKKyAgICBzdGF0aWMgZmluYWwgaW50IE9QX1NIT1cgPSA1OworICAgIAorICAgIHN0YXRpYyBmaW5hbCBjbGFzcyBPcCB7CisgICAgICAgIE9wIG5leHQ7CisgICAgICAgIE9wIHByZXY7CisgICAgICAgIGludCBjbWQ7CisgICAgICAgIEZyYWdtZW50IGZyYWdtZW50OworICAgICAgICBpbnQgZW50ZXJBbmltOworICAgICAgICBpbnQgZXhpdEFuaW07CisgICAgICAgIEFycmF5TGlzdDxGcmFnbWVudD4gcmVtb3ZlZDsKKyAgICB9CisgICAgCisgICAgT3AgbUhlYWQ7CisgICAgT3AgbVRhaWw7CisgICAgaW50IG1OdW1PcDsKKyAgICBpbnQgbUVudGVyQW5pbTsKKyAgICBpbnQgbUV4aXRBbmltOworICAgIGludCBtVHJhbnNpdGlvbjsKKyAgICBpbnQgbVRyYW5zaXRpb25TdHlsZTsKKyAgICBib29sZWFuIG1BZGRUb0JhY2tTdGFjazsKKyAgICBTdHJpbmcgbU5hbWU7CisgICAgYm9vbGVhbiBtQ29tbWl0dGVkOworICAgIAorICAgIHB1YmxpYyBCYWNrU3RhY2tFbnRyeShGcmFnbWVudE1hbmFnZXIgbWFuYWdlcikgeworICAgICAgICBtTWFuYWdlciA9IG1hbmFnZXI7CisgICAgfQorICAgIAorICAgIHZvaWQgYWRkT3AoT3Agb3ApIHsKKyAgICAgICAgaWYgKG1IZWFkID09IG51bGwpIHsKKyAgICAgICAgICAgIG1IZWFkID0gbVRhaWwgPSBvcDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG9wLnByZXYgPSBtVGFpbDsKKyAgICAgICAgICAgIG1UYWlsLm5leHQgPSBvcDsKKyAgICAgICAgICAgIG1UYWlsID0gb3A7CisgICAgICAgIH0KKyAgICAgICAgb3AuZW50ZXJBbmltID0gbUVudGVyQW5pbTsKKyAgICAgICAgb3AuZXhpdEFuaW0gPSBtRXhpdEFuaW07CisgICAgICAgIG1OdW1PcCsrOworICAgIH0KKyAgICAgICAgCisgICAgcHVibGljIEZyYWdtZW50VHJhbnNhY3Rpb24gYWRkKEZyYWdtZW50IGZyYWdtZW50LCBTdHJpbmcgdGFnKSB7CisgICAgICAgIGRvQWRkT3AoMCwgZnJhZ21lbnQsIHRhZywgT1BfQUREKTsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIEZyYWdtZW50VHJhbnNhY3Rpb24gYWRkKGludCBjb250YWluZXJWaWV3SWQsIEZyYWdtZW50IGZyYWdtZW50KSB7CisgICAgICAgIGRvQWRkT3AoY29udGFpbmVyVmlld0lkLCBmcmFnbWVudCwgbnVsbCwgT1BfQUREKTsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIEZyYWdtZW50VHJhbnNhY3Rpb24gYWRkKGludCBjb250YWluZXJWaWV3SWQsIEZyYWdtZW50IGZyYWdtZW50LCBTdHJpbmcgdGFnKSB7CisgICAgICAgIGRvQWRkT3AoY29udGFpbmVyVmlld0lkLCBmcmFnbWVudCwgdGFnLCBPUF9BREQpOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgZG9BZGRPcChpbnQgY29udGFpbmVyVmlld0lkLCBGcmFnbWVudCBmcmFnbWVudCwgU3RyaW5nIHRhZywgaW50IG9wY21kKSB7CisgICAgICAgIGlmIChmcmFnbWVudC5tSW1tZWRpYXRlQWN0aXZpdHkgIT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiRnJhZ21lbnQgYWxyZWFkeSBhZGRlZDogIiArIGZyYWdtZW50KTsKKyAgICAgICAgfQorICAgICAgICBmcmFnbWVudC5tSW1tZWRpYXRlQWN0aXZpdHkgPSBtTWFuYWdlci5tQWN0aXZpdHk7CisgICAgICAgIAorICAgICAgICBpZiAodGFnICE9IG51bGwpIHsKKyAgICAgICAgICAgIGlmIChmcmFnbWVudC5tVGFnICE9IG51bGwgJiYgIXRhZy5lcXVhbHMoZnJhZ21lbnQubVRhZykpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJDYW4ndCBjaGFuZ2UgdGFnIG9mIGZyYWdtZW50ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgZnJhZ21lbnQgKyAiOiB3YXMgIiArIGZyYWdtZW50Lm1UYWcKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiBub3cgIiArIHRhZyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmcmFnbWVudC5tVGFnID0gdGFnOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAoY29udGFpbmVyVmlld0lkICE9IDApIHsKKyAgICAgICAgICAgIGlmIChmcmFnbWVudC5tRnJhZ21lbnRJZCAhPSAwICYmIGZyYWdtZW50Lm1GcmFnbWVudElkICE9IGNvbnRhaW5lclZpZXdJZCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIkNhbid0IGNoYW5nZSBjb250YWluZXIgSUQgb2YgZnJhZ21lbnQgIgorICAgICAgICAgICAgICAgICAgICAgICAgKyBmcmFnbWVudCArICI6IHdhcyAiICsgZnJhZ21lbnQubUZyYWdtZW50SWQKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiBub3cgIiArIGNvbnRhaW5lclZpZXdJZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmcmFnbWVudC5tQ29udGFpbmVySWQgPSBmcmFnbWVudC5tRnJhZ21lbnRJZCA9IGNvbnRhaW5lclZpZXdJZDsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgT3Agb3AgPSBuZXcgT3AoKTsKKyAgICAgICAgb3AuY21kID0gb3BjbWQ7CisgICAgICAgIG9wLmZyYWdtZW50ID0gZnJhZ21lbnQ7CisgICAgICAgIGFkZE9wKG9wKTsKKyAgICB9CisKKyAgICBwdWJsaWMgRnJhZ21lbnRUcmFuc2FjdGlvbiByZXBsYWNlKGludCBjb250YWluZXJWaWV3SWQsIEZyYWdtZW50IGZyYWdtZW50KSB7CisgICAgICAgIHJldHVybiByZXBsYWNlKGNvbnRhaW5lclZpZXdJZCwgZnJhZ21lbnQsIG51bGwpOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgRnJhZ21lbnRUcmFuc2FjdGlvbiByZXBsYWNlKGludCBjb250YWluZXJWaWV3SWQsIEZyYWdtZW50IGZyYWdtZW50LCBTdHJpbmcgdGFnKSB7CisgICAgICAgIGlmIChjb250YWluZXJWaWV3SWQgPT0gMCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiTXVzdCB1c2Ugbm9uLXplcm8gY29udGFpbmVyVmlld0lkIik7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGRvQWRkT3AoY29udGFpbmVyVmlld0lkLCBmcmFnbWVudCwgdGFnLCBPUF9SRVBMQUNFKTsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBGcmFnbWVudFRyYW5zYWN0aW9uIHJlbW92ZShGcmFnbWVudCBmcmFnbWVudCkgeworICAgICAgICBpZiAoZnJhZ21lbnQubUltbWVkaWF0ZUFjdGl2aXR5ID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIkZyYWdtZW50IG5vdCBhZGRlZDogIiArIGZyYWdtZW50KTsKKyAgICAgICAgfQorICAgICAgICBmcmFnbWVudC5tSW1tZWRpYXRlQWN0aXZpdHkgPSBudWxsOworICAgICAgICAKKyAgICAgICAgT3Agb3AgPSBuZXcgT3AoKTsKKyAgICAgICAgb3AuY21kID0gT1BfUkVNT1ZFOworICAgICAgICBvcC5mcmFnbWVudCA9IGZyYWdtZW50OworICAgICAgICBhZGRPcChvcCk7CisgICAgICAgIAorICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwdWJsaWMgRnJhZ21lbnRUcmFuc2FjdGlvbiBoaWRlKEZyYWdtZW50IGZyYWdtZW50KSB7CisgICAgICAgIGlmIChmcmFnbWVudC5tSW1tZWRpYXRlQWN0aXZpdHkgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiRnJhZ21lbnQgbm90IGFkZGVkOiAiICsgZnJhZ21lbnQpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBPcCBvcCA9IG5ldyBPcCgpOworICAgICAgICBvcC5jbWQgPSBPUF9ISURFOworICAgICAgICBvcC5mcmFnbWVudCA9IGZyYWdtZW50OworICAgICAgICBhZGRPcChvcCk7CisgICAgICAgIAorICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisgICAgCisgICAgcHVibGljIEZyYWdtZW50VHJhbnNhY3Rpb24gc2hvdyhGcmFnbWVudCBmcmFnbWVudCkgeworICAgICAgICBpZiAoZnJhZ21lbnQubUltbWVkaWF0ZUFjdGl2aXR5ID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIkZyYWdtZW50IG5vdCBhZGRlZDogIiArIGZyYWdtZW50KTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgT3Agb3AgPSBuZXcgT3AoKTsKKyAgICAgICAgb3AuY21kID0gT1BfU0hPVzsKKyAgICAgICAgb3AuZnJhZ21lbnQgPSBmcmFnbWVudDsKKyAgICAgICAgYWRkT3Aob3ApOworICAgICAgICAKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBGcmFnbWVudFRyYW5zYWN0aW9uIHNldEN1c3RvbUFuaW1hdGlvbnMoaW50IGVudGVyLCBpbnQgZXhpdCkgeworICAgICAgICBtRW50ZXJBbmltID0gZW50ZXI7CisgICAgICAgIG1FeGl0QW5pbSA9IGV4aXQ7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgRnJhZ21lbnRUcmFuc2FjdGlvbiBzZXRUcmFuc2l0aW9uKGludCB0cmFuc2l0aW9uKSB7CisgICAgICAgIG1UcmFuc2l0aW9uID0gdHJhbnNpdGlvbjsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBGcmFnbWVudFRyYW5zYWN0aW9uIHNldFRyYW5zaXRpb25TdHlsZShpbnQgc3R5bGVSZXMpIHsKKyAgICAgICAgbVRyYW5zaXRpb25TdHlsZSA9IHN0eWxlUmVzOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisgICAgCisgICAgcHVibGljIEZyYWdtZW50VHJhbnNhY3Rpb24gYWRkVG9CYWNrU3RhY2soU3RyaW5nIG5hbWUpIHsKKyAgICAgICAgbUFkZFRvQmFja1N0YWNrID0gdHJ1ZTsKKyAgICAgICAgbU5hbWUgPSBuYW1lOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBjb21taXQoKSB7CisgICAgICAgIGlmIChtQ29tbWl0dGVkKSB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJjb21taXQgYWxyZWFkeSBjYWxsZWQiKTsKKyAgICAgICAgbUNvbW1pdHRlZCA9IHRydWU7CisgICAgICAgIG1NYW5hZ2VyLm1BY3Rpdml0eS5tSGFuZGxlci5wb3N0KHRoaXMpOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgIE9wIG9wID0gbUhlYWQ7CisgICAgICAgIHdoaWxlIChvcCAhPSBudWxsKSB7CisgICAgICAgICAgICBzd2l0Y2ggKG9wLmNtZCkgeworICAgICAgICAgICAgICAgIGNhc2UgT1BfQUREOiB7CisgICAgICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBvcC5mcmFnbWVudDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1BZGRUb0JhY2tTdGFjaykgeworICAgICAgICAgICAgICAgICAgICAgICAgZi5tQmFja1N0YWNrTmVzdGluZysrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGYubU5leHRBbmltID0gb3AuZW50ZXJBbmltOworICAgICAgICAgICAgICAgICAgICBtTWFuYWdlci5hZGRGcmFnbWVudChmLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgfSBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIE9QX1JFUExBQ0U6IHsKKyAgICAgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG9wLmZyYWdtZW50OworICAgICAgICAgICAgICAgICAgICBpZiAobU1hbmFnZXIubUFkZGVkICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxtTWFuYWdlci5tQWRkZWQuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFnbWVudCBvbGQgPSBtTWFuYWdlci5tQWRkZWQuZ2V0KGkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvbGQubUNvbnRhaW5lcklkID09IGYubUNvbnRhaW5lcklkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcC5yZW1vdmVkID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wLnJlbW92ZWQgPSBuZXcgQXJyYXlMaXN0PEZyYWdtZW50PigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wLnJlbW92ZWQuYWRkKG9sZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtQWRkVG9CYWNrU3RhY2spIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9sZC5tQmFja1N0YWNrTmVzdGluZysrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9sZC5tTmV4dEFuaW0gPSBvcC5leGl0QW5pbTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU1hbmFnZXIucmVtb3ZlRnJhZ21lbnQob2xkLCBtVHJhbnNpdGlvbiwgbVRyYW5zaXRpb25TdHlsZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChtQWRkVG9CYWNrU3RhY2spIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGYubUJhY2tTdGFja05lc3RpbmcrKzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBmLm1OZXh0QW5pbSA9IG9wLmVudGVyQW5pbTsKKyAgICAgICAgICAgICAgICAgICAgbU1hbmFnZXIuYWRkRnJhZ21lbnQoZiwgZmFsc2UpOworICAgICAgICAgICAgICAgIH0gYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBPUF9SRU1PVkU6IHsKKyAgICAgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG9wLmZyYWdtZW50OworICAgICAgICAgICAgICAgICAgICBpZiAobUFkZFRvQmFja1N0YWNrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmLm1CYWNrU3RhY2tOZXN0aW5nKys7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZi5tTmV4dEFuaW0gPSBvcC5leGl0QW5pbTsKKyAgICAgICAgICAgICAgICAgICAgbU1hbmFnZXIucmVtb3ZlRnJhZ21lbnQoZiwgbVRyYW5zaXRpb24sIG1UcmFuc2l0aW9uU3R5bGUpOworICAgICAgICAgICAgICAgIH0gYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBPUF9ISURFOiB7CisgICAgICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBvcC5mcmFnbWVudDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1BZGRUb0JhY2tTdGFjaykgeworICAgICAgICAgICAgICAgICAgICAgICAgZi5tQmFja1N0YWNrTmVzdGluZysrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGYubU5leHRBbmltID0gb3AuZXhpdEFuaW07CisgICAgICAgICAgICAgICAgICAgIG1NYW5hZ2VyLmhpZGVGcmFnbWVudChmLCBtVHJhbnNpdGlvbiwgbVRyYW5zaXRpb25TdHlsZSk7CisgICAgICAgICAgICAgICAgfSBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIE9QX1NIT1c6IHsKKyAgICAgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG9wLmZyYWdtZW50OworICAgICAgICAgICAgICAgICAgICBpZiAobUFkZFRvQmFja1N0YWNrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmLm1CYWNrU3RhY2tOZXN0aW5nKys7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZi5tTmV4dEFuaW0gPSBvcC5lbnRlckFuaW07CisgICAgICAgICAgICAgICAgICAgIG1NYW5hZ2VyLnNob3dGcmFnbWVudChmLCBtVHJhbnNpdGlvbiwgbVRyYW5zaXRpb25TdHlsZSk7CisgICAgICAgICAgICAgICAgfSBicmVhazsKKyAgICAgICAgICAgICAgICBkZWZhdWx0OiB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlVua25vd24gY21kOiAiICsgb3AuY21kKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIG9wID0gb3AubmV4dDsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgbU1hbmFnZXIubW92ZVRvU3RhdGUobU1hbmFnZXIubUN1clN0YXRlLCBtVHJhbnNpdGlvbiwKKyAgICAgICAgICAgICAgICBtVHJhbnNpdGlvblN0eWxlLCB0cnVlKTsKKyAgICAgICAgaWYgKG1NYW5hZ2VyLm1OZWVkTWVudUludmFsaWRhdGUgJiYgbU1hbmFnZXIubUFjdGl2aXR5ICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1NYW5hZ2VyLm1BY3Rpdml0eS5pbnZhbGlkYXRlT3B0aW9uc01lbnUoKTsKKyAgICAgICAgICAgIG1NYW5hZ2VyLm1OZWVkTWVudUludmFsaWRhdGUgPSBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgaWYgKG1BZGRUb0JhY2tTdGFjaykgeworICAgICAgICAgICAgbU1hbmFnZXIuYWRkQmFja1N0YWNrU3RhdGUodGhpcyk7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgcG9wRnJvbUJhY2tTdGFjaygpIHsKKyAgICAgICAgT3Agb3AgPSBtVGFpbDsKKyAgICAgICAgd2hpbGUgKG9wICE9IG51bGwpIHsKKyAgICAgICAgICAgIHN3aXRjaCAob3AuY21kKSB7CisgICAgICAgICAgICAgICAgY2FzZSBPUF9BREQ6IHsKKyAgICAgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG9wLmZyYWdtZW50OworICAgICAgICAgICAgICAgICAgICBpZiAobUFkZFRvQmFja1N0YWNrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmLm1CYWNrU3RhY2tOZXN0aW5nLS07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgbU1hbmFnZXIucmVtb3ZlRnJhZ21lbnQoZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFnbWVudE1hbmFnZXIucmV2ZXJzZVRyYW5zaXQobVRyYW5zaXRpb24pLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UcmFuc2l0aW9uU3R5bGUpOworICAgICAgICAgICAgICAgIH0gYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBPUF9SRVBMQUNFOiB7CisgICAgICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBvcC5mcmFnbWVudDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1BZGRUb0JhY2tTdGFjaykgeworICAgICAgICAgICAgICAgICAgICAgICAgZi5tQmFja1N0YWNrTmVzdGluZy0tOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG1NYW5hZ2VyLnJlbW92ZUZyYWdtZW50KGYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRnJhZ21lbnRNYW5hZ2VyLnJldmVyc2VUcmFuc2l0KG1UcmFuc2l0aW9uKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVHJhbnNpdGlvblN0eWxlKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG9wLnJlbW92ZWQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPG9wLnJlbW92ZWQuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFnbWVudCBvbGQgPSBvcC5yZW1vdmVkLmdldChpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUFkZFRvQmFja1N0YWNrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9sZC5tQmFja1N0YWNrTmVzdGluZy0tOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTWFuYWdlci5hZGRGcmFnbWVudChvbGQsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBPUF9SRU1PVkU6IHsKKyAgICAgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG9wLmZyYWdtZW50OworICAgICAgICAgICAgICAgICAgICBpZiAobUFkZFRvQmFja1N0YWNrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmLm1CYWNrU3RhY2tOZXN0aW5nLS07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgbU1hbmFnZXIuYWRkRnJhZ21lbnQoZiwgZmFsc2UpOworICAgICAgICAgICAgICAgIH0gYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBPUF9ISURFOiB7CisgICAgICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBvcC5mcmFnbWVudDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1BZGRUb0JhY2tTdGFjaykgeworICAgICAgICAgICAgICAgICAgICAgICAgZi5tQmFja1N0YWNrTmVzdGluZy0tOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG1NYW5hZ2VyLnNob3dGcmFnbWVudChmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyYWdtZW50TWFuYWdlci5yZXZlcnNlVHJhbnNpdChtVHJhbnNpdGlvbiksIG1UcmFuc2l0aW9uU3R5bGUpOworICAgICAgICAgICAgICAgIH0gYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBPUF9TSE9XOiB7CisgICAgICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBvcC5mcmFnbWVudDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1BZGRUb0JhY2tTdGFjaykgeworICAgICAgICAgICAgICAgICAgICAgICAgZi5tQmFja1N0YWNrTmVzdGluZy0tOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG1NYW5hZ2VyLmhpZGVGcmFnbWVudChmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyYWdtZW50TWFuYWdlci5yZXZlcnNlVHJhbnNpdChtVHJhbnNpdGlvbiksIG1UcmFuc2l0aW9uU3R5bGUpOworICAgICAgICAgICAgICAgIH0gYnJlYWs7CisgICAgICAgICAgICAgICAgZGVmYXVsdDogeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJVbmtub3duIGNtZDogIiArIG9wLmNtZCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBvcCA9IG9wLnByZXY7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIG1NYW5hZ2VyLm1vdmVUb1N0YXRlKG1NYW5hZ2VyLm1DdXJTdGF0ZSwKKyAgICAgICAgICAgICAgICBGcmFnbWVudE1hbmFnZXIucmV2ZXJzZVRyYW5zaXQobVRyYW5zaXRpb24pLCBtVHJhbnNpdGlvblN0eWxlLCB0cnVlKTsKKyAgICAgICAgaWYgKG1NYW5hZ2VyLm1OZWVkTWVudUludmFsaWRhdGUgJiYgbU1hbmFnZXIubUFjdGl2aXR5ICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1NYW5hZ2VyLm1BY3Rpdml0eS5pbnZhbGlkYXRlT3B0aW9uc01lbnUoKTsKKyAgICAgICAgICAgIG1NYW5hZ2VyLm1OZWVkTWVudUludmFsaWRhdGUgPSBmYWxzZTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBwdWJsaWMgU3RyaW5nIGdldE5hbWUoKSB7CisgICAgICAgIHJldHVybiBtTmFtZTsKKyAgICB9CisgICAgCisgICAgcHVibGljIGludCBnZXRUcmFuc2l0aW9uKCkgeworICAgICAgICByZXR1cm4gbVRyYW5zaXRpb247CisgICAgfQorICAgIAorICAgIHB1YmxpYyBpbnQgZ2V0VHJhbnNpdGlvblN0eWxlKCkgeworICAgICAgICByZXR1cm4gbVRyYW5zaXRpb25TdHlsZTsKKyAgICB9Cit9CmRp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0ZURhdGFiYXNlIGRiID0gU1FMaXRlRGF0YWJhc2Uub3Blbk9yQ3JlYXRlRGF0YWJhc2UoZi5nZXRQYXRoKCksIGZhY3RvcnksIGVycm9ySGFuZGxlcik7CisgICAgICAgIHNldEZpbGVQZXJtaXNzaW9uc0Zyb21Nb2RlKGYuZ2V0UGF0aCgpLCBtb2RlLCAwKTsKKyAgICAgICAgcmV0dXJuIGRiOworICAgIH0KKworICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBib29sZWFuIGRlbGV0ZURhdGFiYXNlKFN0cmluZyBuYW1lKSB7CiAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICBGaWxlIGYgPSB2YWxpZGF0ZUZpbGVQYXRoKG5hbWUsIGZhbHNlKTsKQEAgLTYyMCw3ICs2MzAsOCBAQAogICAgICAgICAgICAgICAgICAgICArICIgSXMgdGhpcyByZWFsbHkgd2hhdCB5b3Ugd2FudD8iKTsKICAgICAgICAgfQogICAgICAgICBtTWFpblRocmVhZC5nZXRJbnN0cnVtZW50YXRpb24oKS5leGVjU3RhcnRBY3Rpdml0eSgKLSAgICAgICAgICAgIGdldE91dGVyQ29udGV4dCgpLCBtTWFpblRocmVhZC5nZXRBcHBsaWNhdGlvblRocmVhZCgpLCBudWxsLCBudWxsLCBpbnRlbnQsIC0xKTsKKyAgICAgICAgICAgIGdldE91dGVyQ29udGV4dCgpLCBtTWFpblRocmVhZC5nZXRBcHBsaWNhdGlvblRocmVhZCgpLCBudWxsLAorICAgICAgICAgICAgKEFjdGl2aXR5KW51bGwsIGludGVudCwgLTEpOwogICAgIH0KIAogICAgIEBPdmVycmlkZQpAQCAtMjczNyw2ICsyNzQ4LDEzIEBACiAgICAgICAgICAgICAgICAgcmV0dXJuIHYgIT0gbnVsbCA/IHYgOiBkZWZWYWx1ZTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgcHVibGljIFNldDxTdHJpbmc+IGdldFN0cmluZ1NldChTdHJpbmcga2V5LCBTZXQ8U3RyaW5nPiBkZWZWYWx1ZXMpIHsKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgICAgIFNldDxTdHJpbmc+IHYgPSAoU2V0PFN0cmluZz4pIG1NYXAuZ2V0KGtleSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIHYgIT0gbnVsbCA/IHYgOiBkZWZWYWx1ZXM7CisgICAgICAgICAgICB9CisgICAgICAgIH0KIAogICAgICAgICBwdWJsaWMgaW50IGdldEludChTdHJpbmcga2V5LCBpbnQgZGVmVmFsdWUpIHsKICAgICAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewpAQCAtMjc3OSw2ICsyNzk3LDEyIEBACiAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHB1YmxpYyBFZGl0b3IgcHV0U3RyaW5nU2V0KFN0cmluZyBrZXksIFNldDxTdHJpbmc+IHZhbHVlcykgeworICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgICAgICAgICBtTW9kaWZpZWQucHV0KGtleSwgdmFsdWVzKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQogICAgICAgICAgICAgcHVibGljIEVkaXRvciBwdXRJbnQoU3RyaW5nIGtleSwgaW50IHZhbHVlKSB7CiAgICAgICAgICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICAgICAgICAgIG1Nb2RpZmllZC5wdXQoa2V5LCB2YWx1ZSk7CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9hcHAvRnJhZ21lbnQuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL2FwcC9GcmFnbWVudC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZ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RhdGUiOworICAgIAorICAgIGZpbmFsIFN0cmluZyBtQ2xhc3NOYW1lOworICAgIGZpbmFsIGludCBtSW5kZXg7CisgICAgZmluYWwgYm9vbGVhbiBtRnJvbUxheW91dDsKKyAgICBmaW5hbCBpbnQgbUZyYWdtZW50SWQ7CisgICAgZmluYWwgaW50IG1Db250YWluZXJJZDsKKyAgICBmaW5hbCBTdHJpbmcgbVRhZzsKKyAgICBmaW5hbCBib29sZWFuIG1SZXRhaW5JbnN0YW5jZTsKKyAgICAKKyAgICBCdW5kbGUgbVNhdmVkRnJhZ21lbnRTdGF0ZTsKKyAgICAKKyAgICBGcmFnbWVudCBtSW5zdGFuY2U7CisgICAgCisgICAgcHVibGljIEZyYWdtZW50U3RhdGUoRnJhZ21lbnQgZnJhZykgeworICAgICAgICBtQ2xhc3NOYW1lID0gZnJhZy5nZXRDbGFzcygpLmdldE5hbWUoKTsKKyAgICAgICAgbUluZGV4ID0gZnJhZy5tSW5kZXg7CisgICAgICAgIG1Gcm9tTGF5b3V0ID0gZnJhZy5tRnJvbUxheW91dDsKKyAgICAgICAgbUZyYWdtZW50SWQgPSBmcmFnLm1GcmFnbWVudElkOworICAgICAgICBtQ29udGFpbmVySWQgPSBmcmFnLm1Db250YWluZXJJZDsKKyAgICAgICAgbVRhZyA9IGZyYWcubVRhZzsKKyAgICAgICAgbVJldGFpbkluc3RhbmNlID0gZnJhZy5tUmV0YWluSW5zdGFuY2U7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBGcmFnbWVudFN0YXRlKFBhcmNlbCBpbikgeworICAgICAgICBtQ2xhc3NOYW1lID0gaW4ucmVhZFN0cmluZygpOworICAgICAgICBtSW5kZXggPSBpbi5yZWFkSW50KCk7CisgICAgICAgIG1Gcm9tTGF5b3V0ID0gaW4ucmVhZEludCgpICE9IDA7CisgICAgICAgIG1GcmFnbWVudElkID0gaW4ucmVhZEludCgpOworICAgICAgICBtQ29udGFpbmVySWQgPSBpbi5yZWFkSW50KCk7CisgICAg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luZGV4KG1JbmRleCk7CisgICAgICAgIG1JbnN0YW5jZS5tRnJvbUxheW91dCA9IG1Gcm9tTGF5b3V0OworICAgICAgICBtSW5zdGFuY2UubUZyYWdtZW50SWQgPSBtRnJhZ21lbnRJZDsKKyAgICAgICAgbUluc3RhbmNlLm1Db250YWluZXJJZCA9IG1Db250YWluZXJJZDsKKyAgICAgICAgbUluc3RhbmNlLm1UYWcgPSBtVGFnOworICAgICAgICBtSW5zdGFuY2UubVJldGFpbkluc3RhbmNlID0gbVJldGFpbkluc3RhbmNlOworICAgICAgICAKKyAgICAgICAgcmV0dXJuIG1JbnN0YW5jZTsKKyAgICB9CisgICAgCisgICAgcHVibGljIGludCBkZXNjcmliZUNvbnRlbnRzKCkgeworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB3cml0ZVRvUGFyY2VsKFBhcmNlbCBkZXN0LCBpbnQgZmxhZ3MpIHsKKyAgICAgICAgZGVzdC53cml0ZVN0cmluZyhtQ2xhc3NOYW1lKTsKKyAgICAgICAgZGVzdC53cml0ZUludChtSW5kZXgpOworICAgICAgICBkZXN0LndyaXRlSW50KG1Gcm9tTGF5b3V0ID8gMSA6IDApOworICAgICAgICBkZXN0LndyaXRlSW50KG1GcmFnbWVudElkKTsKKyAgICAgICAgZGVzdC53cml0ZUludChtQ29udGFpbmVySWQpOworICAgICAgICBkZXN0LndyaXRlU3RyaW5nKG1UYWcpOworICAgICAgICBkZXN0LndyaXRlSW50KG1SZXRhaW5JbnN0YW5jZSA/IDEgOiAwKTsKKyAgICAgICAgZGVzdC53cml0ZUJ1bmRsZShtU2F2ZWRGcmFnbWVudFN0YXRlKTsKKyAgICB9CisgICAgCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBQYXJjZWxhYmxlLkNyZWF0b3I8RnJhZ21lbnRTdGF0ZT4gQ1JFQVRPUgorICAgICAgICAgICAgPSBuZXcgUGFyY2VsYWJsZS5DcmVhdG9yPEZyYWdtZW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uZEV4Y2VwdGlvbiwKKyAgICAgICAgICAgIElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbiwgSW5zdGFudGlhdGlvbkV4Y2VwdGlvbiwKKyAgICAgICAgICAgIElsbGVnYWxBY2Nlc3NFeGNlcHRpb24sIEludm9jYXRpb25UYXJnZXRFeGNlcHRpb24geworICAgICAgICBDbGFzcyBjbGF6eiA9IHNDbGFzc01hcC5nZXQoZm5hbWUpOworCisgICAgICAgIGlmIChjbGF6eiA9PSBudWxsKSB7CisgICAgICAgICAgICAvLyBDbGFzcyBub3QgZm91bmQgaW4gdGhlIGNhY2hlLCBzZWUgaWYgaXQncyByZWFsLCBhbmQgdHJ5IHRvIGFkZCBpdAorICAgICAgICAgICAgY2xhenogPSBhY3Rpdml0eS5nZXRDbGFzc0xvYWRlcigpLmxvYWRDbGFzcyhmbmFtZSk7CisgICAgICAgICAgICBzQ2xhc3NNYXAucHV0KGZuYW1lLCBjbGF6eik7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIChGcmFnbWVudCljbGF6ei5uZXdJbnN0YW5jZSgpOworICAgIH0KKyAgICAKKyAgICB2b2lkIHJlc3RvcmVWaWV3U3RhdGUoKSB7CisgICAgICAgIGlmIChtU2F2ZWRWaWV3U3RhdGUgIT0gbnVsbCkgeworICAgICAgICAgICAgbVZpZXcucmVzdG9yZUhpZXJhcmNoeVN0YXRlKG1TYXZlZFZpZXdTdGF0ZSk7CisgICAgICAgICAgICBtU2F2ZWRWaWV3U3RhdGUgPSBudWxsOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIHZvaWQgc2V0SW5kZXgoaW50IGluZGV4KSB7CisgICAgICAgIG1JbmRleCA9IGluZGV4OworICAgICAgICBtV2hvID0gImFuZHJvaWQ6ZnJhZ21lbnQ6IiArIG1JbmRleDsKKyAgIH0KKyAgICAKKyAgICB2b2lkIGNsZWFySW5kZXgoKSB7CisgICAgICAgIG1JbmRleCA9IC0xOworICAgICAgICBtV2hvID0gbnVsbDsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogU3ViY2xhc3NlcyBjYW4gbm90IG92ZXJyaWRlIGVxdWFscygpLgorICAgICAqLworICAgIEBPdmVycmlkZSBmaW5hbCBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG8pIHsKKyAgICAgICAgcmV0dXJuIHN1cGVyLmVxdWFscyhvKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTdWJjbGFzc2VzIGNhbiBub3Qgb3ZlcnJpZGUgaGFzaENvZGUoKS4KKyAgICAgKi8KKyAgICBAT3ZlcnJpZGUgZmluYWwgcHVibGljIGludCBoYXNoQ29kZSgpIHsKKyAgICAgICAgcmV0dXJuIHN1cGVyLmhhc2hDb2RlKCk7CisgICAgfQorICAgIAorICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CisgICAgICAgIFN0cmluZ0J1aWxkZXIgc2IgPSBuZXcgU3RyaW5nQnVpbGRlcigxMjgpOworICAgICAgICBzYi5hcHBlbmQoIkZyYWdtZW50eyIpOworICAgICAgICBzYi5hcHBlbmQoSW50ZWdlci50b0hleFN0cmluZyhTeXN0ZW0uaWRlbnRpdHlIYXNoQ29kZSh0aGlzKSkpOworICAgICAgICBpZiAobUluZGV4ID49IDApIHsKKyAgICAgICAgICAgIHNiLmFwcGVuZCgiICMiKTsKKyAgICAgICAgICAgIHNiLmFwcGVuZChtSW5kZXgpOworICAgICAgICB9CisgICAgICAgIGlmIChtRnJhZ21lbnRJZCAhPSAwKSB7CisgICAgICAgICAgICBzYi5hcHBlbmQoIiBpZD0weCIpOworICAgICAgICAgICAgc2IuYXBwZW5kKEludGVnZXIudG9IZXhTdHJpbmcobUZyYWdtZW50SWQpKTsKKyAgICAgICAgfQorICAgICAgICBpZiAobVRhZyAhPSBudWxsKSB7CisgICAgICAgICAgICBzYi5hcHBlbmQoIiAiKTsKKyAgICAgICAgICAgIHNiLmFwcGVuZChtVGFnKTsKKyAgICAgICAgfQorICAgICAgICBzYi5hcHBlbmQoJ30nKTsKKyAgICAgICAgcmV0dXJuIHNiLnRvU3RyaW5nKCk7CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIFJldHVybiB0aGUgaWRlbnRpZmllciB0aGlzIGZyYWdtZW50IGlzIGtub3duIGJ5LiAgVGhpcyBpcyBlaXRoZXIKKyAgICAgKiB0aGUgYW5kcm9pZDppZCB2YWx1ZSBzdXBwbGllZCBpbiBhIGxheW91dCBvciB0aGUgY29udGFpbmVyIHZpZXcgSUQKKyAgICAgKiBzdXBwbGllZCB3aGVuIGFkZGluZyB0aGUgZnJhZ21lbnQuCisgICAgICovCisgICAgZmluYWwgcHVibGljIGludCBnZXRJZCgpIHsKKyAgICAgICAgcmV0dXJuIG1GcmFnbWVudElkOworICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBHZXQgdGhlIHRhZyBuYW1lIG9mIHRoZSBmcmFnbWVudCwgaWYgc3BlY2lmaWVkLgorICAgICAqLworICAgIGZpbmFsIHB1YmxpYyBTdHJpbmcgZ2V0VGFnKCkgeworICAgICAgICByZXR1cm4gbVRhZzsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogUmV0dXJuIHRoZSBBY3Rpdml0eSB0aGlzIGZyYWdtZW50IGlzIGN1cnJlbnRseSBhc3NvY2lhdGVkIHdpdGguCisgICAgICovCisgICAgZmluYWwgcHVibGljIEFjdGl2aXR5IGdldEFjdGl2aXR5KCkgeworICAgICAgICByZXR1cm4gbUFjdGl2aXR5OworICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBSZXR1cm4gdHJ1ZSBpZiB0aGUgZnJhZ21lbnQgaXMgY3VycmVudGx5IGFkZGVkIHRvIGl0cyBhY3Rpdml0eS4KKyAgICAgKi8KKyAgICBmaW5hbCBwdWJsaWMgYm9vbGVhbiBpc0FkZGVkKCkgeworICAgICAgICByZXR1cm4gbUFjdGl2aXR5ICE9IG51bGwgJiYgbUF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HVibGljIHZvaWQgc2V0SGFzT3B0aW9uc01lbnUoYm9vbGVhbiBoYXNNZW51KSB7CisgICAgICAgIGlmIChtSGFzTWVudSAhPSBoYXNNZW51KSB7CisgICAgICAgICAgICBtSGFzTWVudSA9IGhhc01lbnU7CisgICAgICAgICAgICBpZiAoaXNBZGRlZCgpICYmICFpc0hpZGRlbigpKSB7CisgICAgICAgICAgICAgICAgbUFjdGl2aXR5LmludmFsaWRhdGVPcHRpb25zTWVudSgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIENhbGwge0BsaW5rIEFjdGl2aXR5I3N0YXJ0QWN0aXZpdHkoSW50ZW50KX0gb24gdGhlIGZyYWdtZW50J3MKKyAgICAgKiBjb250YWluaW5nIEFjdGl2aXR5LgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHN0YXJ0QWN0aXZpdHkoSW50ZW50IGludGVudCkgeworICAgICAgICBtQWN0aXZpdHkuc3RhcnRBY3Rpdml0eUZyb21GcmFnbWVudCh0aGlzLCBpbnRlbnQsIC0xKTsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogQ2FsbCB7QGxpbmsgQWN0aXZpdHkjc3RhcnRBY3Rpdml0eUZvclJlc3VsdChJbnRlbnQsIGludCl9IG9uIHRoZSBmcmFnbWVudCdzCisgICAgICogY29udGFpbmluZyBBY3Rpdml0eS4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzdGFydEFjdGl2aXR5Rm9yUmVzdWx0KEludGVudCBpbnRlbnQsIGludCByZXF1ZXN0Q29kZSkgeworICAgICAgICBtQWN0aXZpdHkuc3RhcnRBY3Rpdml0eUZyb21GcmFnbWVudCh0aGlzLCBpbnRlbnQsIHJlcXVlc3RDb2RlKTsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogUmVjZWl2ZSB0aGUgcmVzdWx0IGZyb20gYSBwcmV2aW91cyBjYWxsIHRvCisgICAgICoge0BsaW5rICNzdGFydEFjdGl2aXR5Rm9yUmVzdWx0KEludGVudCwgaW50KX0uICBUaGlzIGZvbGxvd3MgdGhlCisgICAgICogcmVsYXRlZCBBY3Rpdml0eSBBUEkgYXMgZGVzY3JpYmVkIHRoZXJlIGluCisgICAgICoge0BsaW5rIEFjdGl2aXR5I29uQWN0aXZpdHlSZXN1bHQoaW50LCBpbnQsIEludGVudCl9LgorICAgICAqIAorICAgICAqIEBwYXJhbSByZXF1ZXN0Q29kZSBUaGUgaW50ZWdlciByZXF1ZXN0IGNvZGUgb3JpZ2luYWxseSBzdXBwbGllZCB0bworICAgICAqICAgICAgICAgICAgICAgICAgICBzdGFydEFjdGl2aXR5Rm9yUmVzdWx0KCksIGFsbG93aW5nIHlvdSB0byBpZGVudGlmeSB3aG8gdGhpcworICAgICAqICAgICAgICAgICAgICAgICAgICByZXN1bHQgY2FtZSBmcm9tLgorICAgICAqIEBwYXJhbSByZXN1bHRDb2RlIFRoZSBpbnRlZ2VyIHJlc3VsdCBjb2RlIHJldHVybmVkIGJ5IHRoZSBjaGlsZCBhY3Rpdml0eQorICAgICAqICAgICAgICAgICAgICAgICAgIHRocm91Z2ggaXRzIHNldFJlc3VsdCgpLgorICAgICAqIEBwYXJhbSBkYXRhIEFuIEludGVudCwgd2hpY2ggY2FuIHJldHVybiByZXN1bHQgZGF0YSB0byB0aGUgY2FsbGVyCisgICAgICogICAgICAgICAgICAgICAodmFyaW91cyBkYXRhIGNhbiBiZSBhdHRhY2hlZCB0byBJbnRlbnQgImV4dHJhcyIpLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIG9uQWN0aXZpdHlSZXN1bHQoaW50IHJlcXVlc3RDb2RlLCBpbnQgcmVzdWx0Q29kZSwgSW50ZW50IGRhdGEpIHsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogQ2FsbGVkIHdoZW4gYSBmcmFnbWVudCBpcyBiZWluZyBjcmVhdGVkIGFzIHBhcnQgb2YgYSB2aWV3IGxheW91dAorICAgICAq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hbmltYXRpb24uQW5pbWF0aW9uOworaW1wb3J0IGFuZHJvaWQudmlldy5hbmltYXRpb24uQW5pbWF0aW9uVXRpbHM7CisKK2ltcG9ydCBqYXZhLnV0aWwuQXJyYXlMaXN0OworCitmaW5hbCBjbGFzcyBGcmFnbWVudE1hbmFnZXJTdGF0ZSBpbXBsZW1lbnRzIFBhcmNlbGFibGUgeworICAgIEZyYWdtZW50U3RhdGVbXSBtQWN0aXZlOworICAgIGludFtdIG1BZGRlZDsKKyAgICBCYWNrU3RhY2tTdGF0ZVtdIG1CYWNrU3RhY2s7CisgICAgCisgICAgcHVibGljIEZyYWdtZW50TWFuYWdlclN0YXRlKCkgeworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgRnJhZ21lbnRNYW5hZ2VyU3RhdGUoUGFyY2VsIGluKSB7CisgICAgICAgIG1BY3RpdmUgPSBpbi5jcmVhdGVUeXBlZEFycmF5KEZyYWdtZW50U3RhdGUuQ1JFQVRPUik7CisgICAgICAgIG1BZGRlZCA9IGluLmNyZWF0ZUludEFycmF5KCk7CisgICAgICAgIG1CYWNrU3RhY2sgPSBpbi5jcmVhdGVUeXBlZEFycmF5KEJhY2tTdGFja1N0YXRlLkNSRUFUT1IpOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgaW50IGRlc2NyaWJlQ29udGVudHMoKSB7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHdyaXRlVG9QYXJjZWwoUGFyY2VsIGRlc3QsIGludCBmbGFncykgeworICAgICAgICBkZXN0LndyaXRlVHlwZWRBcnJheShtQWN0aXZlLCBmbGFncyk7CisgICAgICAgIGRlc3Qud3JpdGVJbnRBcnJheShtQWRkZWQpOworICAgICAgICBkZXN0LndyaXRlVHlwZWRBcnJheShtQmFja1N0YWNrLCBmbGFncyk7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgUGFyY2VsYWJsZS5DcmVhdG9yPEZyYWdtZW50T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gVGVtcG9yYXJ5IHZhcnMgZm9yIHN0YXRlIHNhdmUgYW5kIHJlc3RvcmUuCisgICAgQnVuZGxlIG1TdGF0ZUJ1bmRsZSA9IG51bGw7CisgICAgU3BhcnNlQXJyYXk8UGFyY2VsYWJsZT4gbVN0YXRlQXJyYXkgPSBudWxsOworICAgIAorICAgIEFuaW1hdGlvbiBsb2FkQW5pbWF0aW9uKEZyYWdtZW50IGZyYWdtZW50LCBpbnQgdHJhbnNpdCwgYm9vbGVhbiBlbnRlciwKKyAgICAgICAgICAgIGludCB0cmFuc2l0aW9uU3R5bGUpIHsKKyAgICAgICAgQW5pbWF0aW9uIGFuaW1PYmogPSBmcmFnbWVudC5vbkNyZWF0ZUFuaW1hdGlvbih0cmFuc2l0aW9uU3R5bGUsIGVudGVyLAorICAgICAgICAgICAgICAgIGZyYWdtZW50Lm1OZXh0QW5pbSk7CisgICAgICAgIGlmIChhbmltT2JqICE9IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBhbmltT2JqOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAoZnJhZ21lbnQubU5leHRBbmltICE9IDApIHsKKyAgICAgICAgICAgIEFuaW1hdGlvbiBhbmltID0gQW5pbWF0aW9uVXRpbHMubG9hZEFuaW1hdGlvbihtQWN0aXZpdHksIGZyYWdtZW50Lm1OZXh0QW5pbSk7CisgICAgICAgICAgICBpZiAoYW5pbSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGFuaW07CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmICh0cmFuc2l0ID09IDApIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpbnQgc3R5bGVJbmRleCA9IHRyYW5zaXRUb1N0eWxlSW5kZXgodHJhbnNpdCwgZW50ZXIpOworICAgICAgICBpZiAoc3R5bGVJbmRleCA8IDApIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAodHJhbnNpdGlvblN0eWxlID09IDAgJiYgbUFjdGl2aXR5LmdldFdpbmRvdygpICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRyYW5zaXRpb25TdHlsZSA9IG1BY3Rpdml0eS5nZXRXaW5kb3coKS5nZXRBdHRyaWJ1dGVzKCkud2luZG93QW5pbWF0aW9uczsKKyAgICAgICAgfQorICAgICAgICBpZiAodHJhbnNpdGlvblN0eWxlID09IDApIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBUeXBlZEFycmF5IGF0dHJzID0gbUFjdGl2aXR5Lm9idGFpblN0eWxlZEF0dHJpYnV0ZXModHJhbnNpdGlvblN0eWxlLAorICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd0FuaW1hdGlvbik7CisgICAgICAgIGludCBhbmltID0gYXR0cnMuZ2V0UmVzb3VyY2VJZChzdHlsZUluZGV4LCAwKTsKKyAgICAgICAgYXR0cnMucmVjeWNsZSgpOworICAgICAgICAKKyAgICAgICAgaWYgKGFuaW0gPT0gMCkgeworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHJldHVybiBBbmltYXRpb25VdGlscy5sb2FkQW5pbWF0aW9uKG1BY3Rpdml0eSwgYW5pbSk7CisgICAgfQorICAgIAorICAgIHZvaWQgbW92ZVRvU3RhdGUoRnJhZ21lbnQgZiwgaW50IG5ld1N0YXRlLCBpbnQgdHJhbnNpdCwgaW50IHRyYW5zaXRpb25TdHlsZSkgeworICAgICAgICAvLyBGcmFnbWVudHMgdGhhdCBhcmUgbm90IGN1cnJlbnRseSBhZGRlZCB3aWxsIHNpdCBpbiB0aGUgb25DcmVhdGUoKSBzdGF0ZS4KKyAgICAgICAgaWYgKCFmLm1BZGRlZCAmJiBuZXdTdGF0ZSA+IEZyYWdtZW50LkNSRUFURUQpIHsKKyAgICAgICAgICAgIG5ld1N0YXRlID0gRnJhZ21lbnQuQ1JFQVRFRDsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgaWYgKGYubVN0YXRlIDwgbmV3U3RhdGUpIHsKKyAgICAgICAgICAgIHN3aXRjaCAoZi5tU3RhdGUpIHsKKyAgICAgICAgICAgICAgICBjYXNlIEZyYWdtZW50LklOSVRJQUxJWklORzoKKyAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJtb3ZldG8gQ1JFQVRFRDogIiArIGYpOworICAgICAgICAgICAgICAgICAgICBmLm1BY3Rpdml0eSA9IG1BY3Rpdml0eTsKKyAgICAgICAgICAgICAgICAgICAgZi5tQ2FsbGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIGYub25BdHRhY2gobUFjdGl2aXR5KTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFmLm1DYWxsZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBTdXBlck5vdENhbGxlZEV4Y2VwdGlvbigiRnJhZ21lbnQgIiArIGYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGRpZCBub3QgY2FsbCB0aHJvdWdoIHRvIHN1cGVyLm9uQXR0YWNoKCkiKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFmLm1SZXRhaW5pbmcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGYubUNhbGxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgZi5vbkNyZWF0ZShmLm1TYXZlZEZyYWdtZW50U3RhdGUpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFmLm1DYWxsZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgU3VwZXJOb3RDYWxsZWRFeGNlcHRpb24oIkZyYWdtZW50ICIgKyBmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZGlkIG5vdCBjYWxsIHRocm91Z2ggdG8gc3VwZXIub25DcmVhdGUoKSIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGYubVJldGFpbmluZyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBpZiAoZi5tRnJvbUxheW91dCkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gRm9yIGZyYWdtZW50cyB0aGF0IGFyZSBwYXJ0IG9mIHRoZSBjb250ZW50IHZpZXcKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxheW91dCwgd2UgbmVlZCB0byBpbnN0YW50aWF0ZSB0aGUgdmlldyBpbW1lZGlhdGVseQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gYW5kIHRoZSBpbmZsYXRlciB3aWxsIHRha2UgY2FyZSBvZiBhZGRpbmcgaXQuCisgICAgICAgICAgICAgICAgICAgICAgICBmLm1WaWV3ID0gZi5vbkNyZWF0ZVZpZXcobUFjdGl2aXR5LmdldExheW91dEluZmxhdGVyKCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIGYubVNhdmVkRnJhZ21lbnRTdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZi5tVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZi5tVmlldy5zZXRTYXZlRnJvbVBhcmVudEVuYWJsZWQoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYucmVzdG9yZVZpZXdTdGF0ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmLm1IaWRkZW4pIGYubVZpZXcuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOyAKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGNhc2UgRnJhZ21lbnQuQ1JFQVRFRDoKKyAgICAgICAgICAgICAgICAgICAgaWYgKG5ld1N0YXRlID4gRnJhZ21lbnQuQ1JFQVRFRCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJtb3ZldG8gQ09OVEVOVDogIiArIGYpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFmLm1Gcm9tTGF5b3V0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVmlld0dyb3VwIGNvbnRhaW5lciA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGYubUNvbnRhaW5lcklkICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGFpbmVyID0gKFZpZXdHcm91cCltQWN0aXZpdHkuZmluZFZpZXdCeUlkKGYubUNvbnRhaW5lcklkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbnRhaW5lciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJOZXcgdmlldyBmb3VuZCBmb3IgaWQgMHgiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgSW50ZWdlci50b0hleFN0cmluZyhmLm1Db250YWluZXJJZCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGZvciBmcmFnbWVudCAiICsgZik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZi5tQ29udGFpbmVyID0gY29udGFpbmVyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYubVZpZXcgPSBmLm9uQ3JlYXRlVmlldyhtQWN0aXZpdHkuZ2V0TGF5b3V0SW5mbGF0ZXIoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRhaW5lciwgZi5tU2F2ZWRGcmFnbWVudFN0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZi5tVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYubVZpZXcuc2V0U2F2ZUZyb21QYXJlbnRFbmFibGVkKGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbnRhaW5lciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBbmltYXRpb24gYW5pbSA9IGxvYWRBbmltYXRpb24oZiwgdHJhbnNpdCwgdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblN0eWxlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbmltICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmLm1WaWV3LnNldEFuaW1hdGlvbihhbmltKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRhaW5lci5hZGRWaWV3KGYubVZpZXcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZi5yZXN0b3JlVmlld1N0YXRlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGYubUhpZGRlbikgZi5tVmlldy5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgZi5tQ2FsbGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBmLm9uUmVhZHkoZi5tU2F2ZWRGcmFnbWVudFN0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZi5tQ2FsbGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFN1cGVyTm90Q2FsbGVkRXhjZXB0aW9uKCJGcmFnbWVudCAiICsgZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGRpZCBub3QgY2FsbCB0aHJvdWdoIHRvIHN1cGVyLm9uUmVhZHkoKSIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZi5tU2F2ZWRGcmFnbWVudFN0YXRlID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGNhc2UgRnJhZ21lbnQuQ09OVEVOVDoKKyAgICAgICAgICAgICAgICAgICAgaWYgKG5ld1N0YXRlID4gRnJhZ21lbnQuQ09OVEVOVCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJtb3ZldG8gU1RBUlRFRDogIiArIGYpOworICAgICAgICAgICAgICAgICAgICAgICAgZi5tQ2FsbGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBmLm9uU3RhcnQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZi5tQ2FsbGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFN1cGVyTm90Q2FsbGVkRXhjZXB0aW9uKCJGcmFnbWVudCAiICsgZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGRpZCBub3QgY2FsbCB0aHJvdWdoIHRvIHN1cGVyLm9uU3RhcnQoKSIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY2FzZSBGcmFnbWVudC5TVEFSVEVEOgorICAgICAgICAgICAgICAgICAgICBpZiAobmV3U3RhdGUgPiBGcmFnbWVudC5TVEFSVEVEKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIm1vdmV0byBSRVNVTUVEOiAiICsgZik7CisgICAgICAgICAgICAgICAgICAgICAgICBmLm1DYWxsZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGYub25SZXN1bWUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZi5tQ2FsbGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFN1cGVyTm90Q2FsbGVkRXhjZXB0aW9uKCJGcmFnbWVudCAiICsgZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGRpZCBub3QgY2FsbCB0aHJvdWdoIHRvIHN1cGVyLm9uUmVzdW1lKCkiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgaWYgKGYubVN0YXRlID4gbmV3U3RhdGUpIHsKKyAgICAgICAgICAgIHN3aXRjaCAoZi5tU3RhdGUpIHsKKyAgICAgICAgICAgICAgICBjYXNlIEZyYWdtZW50LlJFU1VNRUQ6CisgICAgICAgICAgICAgICAgICAgIGlmIChuZXdTdGF0ZSA8IEZyYWdtZW50LlJFU1VNRUQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAibW92ZWZyb20gUkVTVU1FRDogIiArIGYpOworICAgICAgICAgICAgICAgICAgICAgICAgZi5tQ2FsbGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBmLm9uUGF1c2UoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZi5tQ2FsbGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFN1cGVyTm90Q2FsbGVkRXhjZXB0aW9uKCJGcmFnbWVudCAiICsgZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGRpZCBub3QgY2FsbCB0aHJvdWdoIHRvIHN1cGVyLm9uUGF1c2UoKSIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY2FzZSBGcmFnbWVudC5TVEFSVEVEOgorICAgICAgICAgICAgICAgICAgICBpZiAobmV3U3RhdGUgPCBGcmFnbWVudC5TVEFSVEVEKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIm1vdmVmcm9tIFNUQVJURUQ6ICIgKyBmKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGYubUNhbGxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgZi5vblN0b3AoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZi5tQ2FsbGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFN1cGVyTm90Q2FsbGVkRXhjZXB0aW9uKCJGcmFnbWVudCAiICsgZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGRpZCBub3QgY2FsbCB0aHJvdWdoIHRvIHN1cGVyLm9uU3RvcCgpIik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBjYXNlIEZyYWdtZW50LkNPTlRFTlQ6CisgICAgICAgICAgICAgICAgICAgIGlmIChuZXdTdGF0ZSA8IEZyYWdtZW50LkNPTlRFTlQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAibW92ZWZyb20gQ09OVEVOVDogIiArIGYpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGYubVZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYubUNhbGxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYub25EZXN0cm95VmlldygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZi5tQ2FsbGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBTdXBlck5vdENhbGxlZEV4Y2VwdGlvbigiRnJhZ21lbnQgIiArIGYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZGlkIG5vdCBjYWxsIHRocm91Z2ggdG8gc3VwZXIub25EZXN0cm95ZWRWaWV3KCkiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTmVlZCB0byBzYXZlIHRoZSBjdXJyZW50IHZpZXcgc3RhdGUgaWYgbm90CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZG9uZSBhbHJlYWR5LgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbUFjdGl2aXR5LmlzRmluaXNoaW5nKCkgJiYgZi5tU2F2ZWRGcmFnbWVudFN0YXRlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2F2ZUZyYWdtZW50Vmlld1N0YXRlKGYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZi5tQ29udGFpbmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1DdXJTdGF0ZSA+IEZyYWdtZW50LklOSVRJQUxJWklORykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQW5pbWF0aW9uIGFuaW0gPSBsb2FkQW5pbWF0aW9uKGYsIHRyYW5zaXQsIGZhbHNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uU3R5bGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuaW0gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYubVZpZXcuc2V0QW5pbWF0aW9uKGFuaW0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYubUNvbnRhaW5lci5yZW1vdmVWaWV3KGYubVZpZXcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGYubUNvbnRhaW5lciA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgICAgICBmLm1WaWV3ID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGNhc2UgRnJhZ21lbnQuQ1JFQVRFRDoKKyAgICAgICAgICAgICAgICAgICAgaWYgKG5ld1N0YXRlIDwgRnJhZ21lbnQuQ1JFQVRFRCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJtb3ZlZnJvbSBDUkVBVEVEOiAiICsgZik7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWYubVJldGFpbmluZykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYubUNhbGxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYub25EZXN0cm95KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFmLm1DYWxsZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFN1cGVyTm90Q2FsbGVkRXhjZXB0aW9uKCJGcmFnbWVudCAiICsgZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBkaWQgbm90IGNhbGwgdGhyb3VnaCB0byBzdXBlci5vbkRlc3Ryb3koKSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgZi5tQ2FsbGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBmLm9uRGV0YWNoKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWYubUNhbGxlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBTdXBlck5vdENhbGxlZEV4Y2VwdGlvbigiRnJhZ21lbnQgIiArIGYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBkaWQgbm90IGNhbGwgdGhyb3VnaCB0byBzdXBlci5vbkRldGFjaCgpIik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBmLm1BY3Rpdml0eSA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgZi5tU3RhdGUgPSBuZXdTdGF0ZTsKKyAgICB9CisgICAgCisgICAgdm9pZCBtb3ZlVG9TdGF0ZShpbnQgbmV3U3RhdGUsIGJvb2xlYW4gYWx3YXlzKSB7CisgICAgICAgIG1vdmVUb1N0YXRlKG5ld1N0YXRlLCAwLCAwLCBhbHdheXMpOworICAgIH0KKyAgICAKKyAgICB2b2lkIG1vdmVUb1N0YXRlKGludCBuZXdTdGF0ZSwgaW50IHRyYW5zaXQsIGludCB0cmFuc2l0U3R5bGUsIGJvb2xlYW4gYWx3YXlzKSB7CisgICAgICAgIGlmIChtQWN0aXZpdHkgPT0gbnVsbCAmJiBuZXdTdGF0ZSAhPSBGcmFnbWVudC5JTklUSUFMSVpJTkcpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIk5vIGFjdGl2aXR5Iik7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmICghYWx3YXlzICYmIG1DdXJTdGF0ZSA9PSBuZXdTdGF0ZSkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBtQ3VyU3RhdGUgPSBuZXdTdGF0ZTsKKyAgICAgICAgaWYgKG1BY3RpdmUgIT0gbnVsbCkgeworICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPG1BY3RpdmUuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICBGcmFnbWVudCBmID0gbUFjdGl2ZS5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGYgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtb3ZlVG9TdGF0ZShmLCBuZXdTdGF0ZSwgdHJhbnNpdCwgdHJhbnNpdFN0eWxlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgdm9pZCBtYWtlQWN0aXZlKEZyYWdtZW50IGYpIHsKKyAgICAgICAgaWYgKGYubUluZGV4ID49IDApIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgaWYgKG1BdmFpbEluZGljZXMgPT0gbnVsbCB8fCBtQXZhaWxJbmRpY2VzLnNpemUoKSA8PSAwKSB7CisgICAgICAgICAgICBpZiAobUFjdGl2ZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgbUFjdGl2ZSA9IG5ldyBBcnJheUxpc3Q8RnJhZ21lbnQ+KCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmLnNldEluZGV4KG1BY3RpdmUuc2l6ZSgpKTsKKyAgICAgICAgICAgIG1BY3RpdmUuYWRkKGYpOworICAgICAgICAgICAgCisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBmLnNldEluZGV4KG1BdmFpbEluZGljZXMucmVtb3ZlKG1BdmFpbEluZGljZXMuc2l6ZSgpLTEpKTsKKyAgICAgICAgICAgIG1BY3RpdmUuc2V0KGYubUluZGV4LCBmKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICB2b2lkIG1ha2VJbmFjdGl2ZShGcmFnbWVudCBmKSB7CisgICAgICAgIGlmIChmLm1JbmRleCA8IDApIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgbUFjdGl2ZS5zZXQoZi5tSW5kZXgsIG51bGwpOworICAgICAgICBpZiAobUF2YWlsSW5kaWNlcyA9PSBudWxsKSB7CisgICAgICAgICAgICBtQXZhaWxJbmRpY2VzID0gbmV3IEFycmF5TGlzdDxJbnRlZ2VyPigpOworICAgICAgICB9CisgICAgICAgIG1BdmFpbEluZGljZXMuYWRkKGYubUluZGV4KTsKKyAgICAgICAgZi5jbGVhckluZGV4KCk7CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIGFkZEZyYWdtZW50KEZyYWdtZW50IGZyYWdtZW50LCBib29sZWFuIG1vdmVUb1N0YXRlTm93KSB7CisgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAiYWRkOiAiICsgZnJhZ21lbnQpOworICAgICAgICBpZiAobUFkZGVkID09IG51bGwpIHsKKyAgICAgICAgICAgIG1BZGRlZCA9IG5ldyBBcnJheUxpc3Q8RnJhZ21lbnQ+KCk7CisgICAgICAgIH0KKyAgICAgICAgbUFkZGVkLmFkZChmcmFnbWVudCk7CisgICAgICAgIG1ha2VBY3RpdmUoZnJhZ21lbnQpOworICAgICAgICBmcmFnbWVudC5tQWRkZWQgPSB0cnVlOworICAgICAgICBpZiAoZnJhZ21lbnQubUhhc01lbnUpIHsKKyAgICAgICAgICAgIG1OZWVkTWVudUludmFsaWRhdGUgPSB0cnVlOworICAgICAgICB9CisgICAgICAgIGlmIChtb3ZlVG9TdGF0ZU5vdykgeworICAgICAgICAgICAgbW92ZVRvU3RhdGUoZnJhZ21lbnQsIG1DdXJTdGF0ZSwgMCwgMCk7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgcmVtb3ZlRnJhZ21lbnQoRnJhZ21lbnQgZnJhZ21lbnQsIGludCB0cmFuc2l0aW9uLCBpbnQgdHJhbnNpdGlvblN0eWxlKSB7CisgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAicmVtb3ZlOiAiICsgZnJhZ21lbnQpOworICAgICAgICBtQWRkZWQucmVtb3ZlKGZyYWdtZW50KTsKKyAgICAgICAgZmluYWwgYm9vbGVhbiBpbmFjdGl2ZSA9IGZyYWdtZW50Lm1CYWNrU3RhY2tOZXN0aW5nIDw9IDA7CisgICAgICAgIGlmIChpbmFjdGl2ZSkgeworICAgICAgICAgICAgbWFrZUluYWN0aXZlKGZyYWdtZW50KTsKKyAgICAgICAgfQorICAgICAgICBpZiAoZnJhZ21lbnQubUhhc01lbnUpIHsKKyAgICAgICAgICAgIG1OZWVkTWVudUludmFsaWRhdGUgPSB0cnVlOworICAgICAgICB9CisgICAgICAgIGZyYWdtZW50Lm1BZGRlZCA9IGZhbHNlOworICAgICAgICBtb3ZlVG9TdGF0ZShmcmFnbWVudCwgaW5hY3RpdmUgPyBGcmFnbWVudC5JTklUSUFMSVpJTkcgOiBGcmFnbWVudC5DUkVBVEVELAorICAgICAgICAgICAgICAgIHRyYW5zaXRpb24sIHRyYW5zaXRpb25TdHlsZSk7CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIGhpZGVGcmFnbWVudChGcmFnbWVudCBmcmFnbWVudCwgaW50IHRyYW5zaXRpb24sIGludCB0cmFuc2l0aW9uU3R5bGUpIHsKKyAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJoaWRlOiAiICsgZnJhZ21lbnQpOworICAgICAgICBpZiAoIWZyYWdtZW50Lm1IaWRkZW4pIHsKKyAgICAgICAgICAgIGZyYWdtZW50Lm1IaWRkZW4gPSB0cnVlOworICAgICAgICAgICAgaWYgKGZyYWdtZW50Lm1WaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBBbmltYXRpb24gYW5pbSA9IGxvYWRBbmltYXRpb24oZnJhZ21lbnQsIHRyYW5zaXRpb24sIGZhbHNlLAorICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblN0eWxlKTsKKyAgICAgICAgICAgICAgICBpZiAoYW5pbSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGZyYWdtZW50Lm1WaWV3LnNldEFuaW1hdGlvbihhbmltKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZnJhZ21lbnQubVZpZXcuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGZyYWdtZW50Lm1BZGRlZCAmJiBmcmFnbWVudC5tSGFzTWVudSkgeworICAgICAgICAgICAgICAgIG1OZWVkTWVudUludmFsaWRhdGUgPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZnJhZ21lbnQub25IaWRkZW5DaGFuZ2VkKHRydWUpOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIHNob3dGcmFnbWVudChGcmFnbWVudCBmcmFnbWVudCwgaW50IHRyYW5zaXRpb24sIGludCB0cmFuc2l0aW9uU3R5bGUpIHsKKyAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJzaG93OiAiICsgZnJhZ21lbnQpOworICAgICAgICBpZiAoZnJhZ21lbnQubUhpZGRlbikgeworICAgICAgICAgICAgZnJhZ21lbnQubUhpZGRlbiA9IGZhbHNlOworICAgICAgICAgICAgaWYgKGZyYWdtZW50Lm1WaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBBbmltYXRpb24gYW5pbSA9IGxvYWRBbmltYXRpb24oZnJhZ21lbnQsIHRyYW5zaXRpb24sIHRydWUsCisgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uU3R5bGUpOworICAgICAgICAgICAgICAgIGlmIChhbmltICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgZnJhZ21lbnQubVZpZXcuc2V0QW5pbWF0aW9uKGFuaW0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmcmFnbWVudC5tVmlldy5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoZnJhZ21lbnQubUFkZGVkICYmIGZyYWdtZW50Lm1IYXNNZW51KSB7CisgICAgICAgICAgICAgICAgbU5lZWRNZW51SW52YWxpZGF0ZSA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmcmFnbWVudC5vbkhpZGRlbkNoYW5nZWQoZmFsc2UpOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIHB1YmxpYyBGcmFnbWVudCBmaW5kRnJhZ21lbnRCeUlkKGludCBpZCkgeworICAgICAgICBpZiAobUFjdGl2ZSAhPSBudWxsKSB7CisgICAgICAgICAgICAvLyBGaXJzdCBsb29rIHRocm91Z2ggYWRkZWQgZnJhZ21lbnRzLgorICAgICAgICAgICAgZm9yIChpbnQgaT1tQWRkZWQuc2l6ZSgpLTE7IGk+PTA7IGktLSkgeworICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBtQWRkZWQuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChmICE9IG51bGwgJiYgZi5tRnJhZ21lbnRJZCA9PSBpZCkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBOb3cgZm9yIGFueSBrbm93biBmcmFnbWVudC4KKyAgICAgICAgICAgIGZvciAoaW50IGk9bUFjdGl2ZS5zaXplKCktMTsgaT49MDsgaS0tKSB7CisgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG1BY3RpdmUuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChmICE9IG51bGwgJiYgZi5tRnJhZ21lbnRJZCA9PSBpZCkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBGcmFnbWVudCBmaW5kRnJhZ21lbnRCeVRhZyhTdHJpbmcgdGFnKSB7CisgICAgICAgIGlmIChtQWN0aXZlICE9IG51bGwgJiYgdGFnICE9IG51bGwpIHsKKyAgICAgICAgICAgIC8vIEZpcnN0IGxvb2sgdGhyb3VnaCBhZGRlZCBmcmFnbWVudHMuCisgICAgICAgICAgICBmb3IgKGludCBpPW1BZGRlZC5zaXplKCktMTsgaT49MDsgaS0tKSB7CisgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG1BZGRlZC5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGYgIT0gbnVsbCAmJiB0YWcuZXF1YWxzKGYubVRhZykpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGY7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gTm93IGZvciBhbnkga25vd24gZnJhZ21lbnQuCisgICAgICAgICAgICBmb3IgKGludCBpPW1BY3RpdmUuc2l6ZSgpLTE7IGk+PTA7IGktLSkgeworICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBtQWN0aXZlLmdldChpKTsKKyAgICAgICAgICAgICAgICBpZiAoZiAhPSBudWxsICYmIHRhZy5lcXVhbHMoZi5tVGFnKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBGcmFnbWVudCBmaW5kRnJhZ21lbnRCeVdobyhTdHJpbmcgd2hvKSB7CisgICAgICAgIGlmIChtQWN0aXZlICE9IG51bGwgJiYgd2hvICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGk9bUFjdGl2ZS5zaXplKCktMTsgaT49MDsgaS0tKSB7CisgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG1BY3RpdmUuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChmICE9IG51bGwgJiYgd2hvLmVxdWFscyhmLm1XaG8pKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgYWRkQmFja1N0YWNrU3RhdGUoQmFja1N0YWNrRW50cnkgc3RhdGUpIHsKKyAgICAgICAgaWYgKG1CYWNrU3RhY2sgPT0gbnVsbCkgeworICAgICAgICAgICAgbUJhY2tTdGFjayA9IG5ldyBBcnJheUxpc3Q8QmFja1N0YWNrRW50cnk+KCk7CisgICAgICAgIH0KKyAgICAgICAgbUJhY2tTdGFjay5hZGQoc3RhdGUpOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgYm9vbGVhbiBwb3BCYWNrU3RhY2tTdGF0ZShIYW5kbGVyIGhhbmRsZXIsIFN0cmluZyBuYW1lKSB7CisgICAgICAgIGlmIChtQmFja1N0YWNrID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICBpZiAobmFtZSA9PSBudWxsKSB7CisgICAgICAgICAgICBpbnQgbGFzdCA9IG1CYWNrU3RhY2suc2l6ZSgpLTE7CisgICAgICAgICAgICBpZiAobGFzdCA8IDApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmaW5hbCBCYWNrU3RhY2tFbnRyeSBic3MgPSBtQmFja1N0YWNrLnJlbW92ZShsYXN0KTsKKyAgICAgICAgICAgIGhhbmRsZXIucG9zdChuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgICAgICBic3MucG9wRnJvbUJhY2tTdGFjaygpOworICAgICAgICAgICAgICAgICAgICBtb3ZlVG9TdGF0ZShtQ3VyU3RhdGUsIHJldmVyc2VUcmFuc2l0KGJzcy5nZXRUcmFuc2l0aW9uKCkpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJzcy5nZXRUcmFuc2l0aW9uU3R5bGUoKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpbnQgaW5kZXggPSBtQmFja1N0YWNrLnNpemUoKS0xOworICAgICAgICAgICAgd2hpbGUgKGluZGV4ID49IDApIHsKKyAgICAgICAgICAgICAgICBCYWNrU3RhY2tFbnRyeSBic3MgPSBtQmFja1N0YWNrLmdldChpbmRleCk7CisgICAgICAgICAgICAgICAgaWYgKG5hbWUuZXF1YWxzKGJzcy5nZXROYW1lKCkpKSB7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChpbmRleCA8IDAgfHwgaW5kZXggPT0gbUJhY2tTdGFjay5zaXplKCktMSkgeworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGZpbmFsIEFycmF5TGlzdDxCYWNrU3RhY2tFbnRyeT4gc3RhdGVzCisgICAgICAgICAgICAgICAgICAgID0gbmV3IEFycmF5TGlzdDxCYWNrU3RhY2tFbnRyeT4oKTsKKyAgICAgICAgICAgIGZvciAoaW50IGk9bUJhY2tTdGFjay5zaXplKCktMTsgaT5pbmRleDsgaS0tKSB7CisgICAgICAgICAgICAgICAgc3RhdGVzLmFkZChtQmFja1N0YWNrLnJlbW92ZShpKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBoYW5kbGVyLnBvc3QobmV3IFJ1bm5hYmxlKCkgeworICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPHN0YXRlcy5zaXplKCk7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGVzLmdldChpKS5wb3BGcm9tQmFja1N0YWNrKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgbW92ZVRvU3RhdGUobUN1clN0YXRlLCB0cnVlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisgICAgCisgICAgQXJyYXlMaXN0PEZyYWdtZW50PiByZXRhaW5Ob25Db25maWcoKSB7CisgICAgICAgIEFycmF5TGlzdDxGcmFnbWVudD4gZnJhZ21lbnRzID0gbnVsbDsKKyAgICAgICAgaWYgKG1BY3RpdmUgIT0gbnVsbCkgeworICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPG1BY3RpdmUuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICBGcmFnbWVudCBmID0gbUFjdGl2ZS5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGYgIT0gbnVsbCAmJiBmLm1SZXRhaW5JbnN0YW5jZSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoZnJhZ21lbnRzID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZyYWdtZW50cyA9IG5ldyBBcnJheUxpc3Q8RnJhZ21lbnQ+KCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZnJhZ21lbnRzLmFkZChmKTsKKyAgICAgICAgICAgICAgICAgICAgZi5tUmV0YWluaW5nID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZyYWdtZW50czsKKyAgICB9CisgICAgCisgICAgdm9pZCBzYXZlRnJhZ21lbnRWaWV3U3RhdGUoRnJhZ21lbnQgZikgeworICAgICAgICBpZiAoZi5tVmlldyA9PSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1TdGF0ZUFycmF5ID09IG51bGwpIHsKKyAgICAgICAgICAgIG1TdGF0ZUFycmF5ID0gbmV3IFNwYXJzZUFycmF5PFBhcmNlbGFibGU+KCk7CisgICAgICAgIH0KKyAgICAgICAgZi5tVmlldy5zYXZlSGllcmFyY2h5U3RhdGUobVN0YXRlQXJyYXkpOworICAgICAgICBpZiAobVN0YXRlQXJyYXkuc2l6ZSgpID4gMCkgeworICAgICAgICAgICAgZi5tU2F2ZWRWaWV3U3RhdGUgPSBtU3RhdGVBcnJheTsKKyAgICAgICAgICAgIG1TdGF0ZUFycmF5ID0gbnVsbDsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBQYXJjZWxhYmxlIHNhdmVBbGxTdGF0ZSgpIHsKKyAgICAgICAgaWYgKG1BY3RpdmUgPT0gbnVsbCB8fCBtQWN0aXZlLnNpemUoKSA8PSAwKSB7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgLy8gRmlyc3QgY29sbGVjdCBhbGwgYWN0aXZlIGZyYWdtZW50cy4KKyAgICAgICAgaW50IE4gPSBtQWN0aXZlLnNpemUoKTsKKyAgICAgICAgRnJhZ21lbnRTdGF0ZVtdIGFjdGl2ZSA9IG5ldyBGcmFnbWVudFN0YXRlW05dOworICAgICAgICBib29sZWFuIGhhdmVGcmFnbWVudHMgPSBmYWxzZTsKKyAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG1BY3RpdmUuZ2V0KGkpOworICAgICAgICAgICAgaWYgKGYgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGhhdmVGcmFnbWVudHMgPSB0cnVlOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIEZyYWdtZW50U3RhdGUgZnMgPSBuZXcgRnJhZ21lbnRTdGF0ZShmKTsKKyAgICAgICAgICAgICAgICBhY3RpdmVbaV0gPSBmczsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBpZiAobVN0YXRlQnVuZGxlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbVN0YXRlQnVuZGxlID0gbmV3IEJ1bmRsZSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmLm9uU2F2ZUluc3RhbmNlU3RhdGUobVN0YXRlQnVuZGxlKTsKKyAgICAgICAgICAgICAgICBpZiAoIW1TdGF0ZUJ1bmRsZS5pc0VtcHR5KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgZnMubVNhdmVkRnJhZ21lbnRTdGF0ZSA9IG1TdGF0ZUJ1bmRsZTsKKyAgICAgICAgICAgICAgICAgICAgbVN0YXRlQnVuZGxlID0gbnVsbDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgaWYgKGYubVZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBzYXZlRnJhZ21lbnRWaWV3U3RhdGUoZik7CisgICAgICAgICAgICAgICAgICAgIGlmIChmLm1TYXZlZFZpZXdTdGF0ZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZnMubVNhdmVkRnJhZ21lbnRTdGF0ZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnMubVNhdmVkRnJhZ21lbnRTdGF0ZSA9IG5ldyBCdW5kbGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGZzLm1TYXZlZEZyYWdtZW50U3RhdGUucHV0U3BhcnNlUGFyY2VsYWJsZUFycmF5KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFnbWVudFN0YXRlLlZJRVdfU1RBVEVfVEFHLCBmLm1TYXZlZFZpZXdTdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmICghaGF2ZUZyYWdtZW50cykgeworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGludFtdIGFkZGVkID0gbnVsbDsKKyAgICAgICAgQmFja1N0YWNrU3RhdGVbXSBiYWNrU3RhY2sgPSBudWxsOworICAgICAgICAKKyAgICAgICAgLy8gQnVpbGQgbGlzdCBvZiBjdXJyZW50bHkgYWRkZWQgZnJhZ21lbnRzLgorICAgICAgICBOID0gbUFkZGVkLnNpemUoKTsKKyAgICAgICAgaWYgKE4gPiAwKSB7CisgICAgICAgICAgICBhZGRlZCA9IG5ldyBpbnRbTl07CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CisgICAgICAgICAgICAgICAgYWRkZWRbaV0gPSBtQWRkZWQuZ2V0KGkpLm1JbmRleDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgLy8gTm93IHNhdmUgYmFjayBzdGFjay4KKyAgICAgICAgaWYgKG1CYWNrU3RhY2sgIT0gbnVsbCkgeworICAgICAgICAgICAgTiA9IG1CYWNrU3RhY2suc2l6ZSgpOworICAgICAgICAgICAgaWYgKE4gPiAwKSB7CisgICAgICAgICAgICAgICAgYmFja1N0YWNrID0gbmV3IEJhY2tTdGFja1N0YXRlW05dOworICAgICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgYmFja1N0YWNrW2ldID0gbmV3IEJhY2tTdGFja1N0YXRlKHRoaXMsIG1CYWNrU3RhY2suZ2V0KGkpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIEZyYWdtZW50TWFuYWdlclN0YXRlIGZtcyA9IG5ldyBGcmFnbWVudE1hbmFnZXJTdGF0ZSgpOworICAgICAgICBmbXMubUFjdGl2ZSA9IGFjdGl2ZTsKKyAgICAgICAgZm1zLm1BZGRlZCA9IGFkZGVkOworICAgICAgICBmbXMubUJhY2tTdGFjayA9IGJhY2tTdGFjazsKKyAgICAgICAgcmV0dXJuIGZtczsKKyAgICB9CisgICAgCisgICAgdm9pZCByZXN0b3JlQWxsU3RhdGUoUGFyY2VsYWJsZSBzdGF0ZSwgQXJyYXlMaXN0PEZyYWdtZW50PiBub25Db25maWcpIHsKKyAgICAgICAgLy8gSWYgdGhlcmUgaXMgbm8gc2F2ZWQgc3RhdGUgYXQgYWxsLCB0aGVuIHRoZXJlIGNhbiBub3QgYmUKKyAgICAgICAgLy8gYW55IG5vbkNvbmZpZyBmcmFnbWVudHMgZWl0aGVyLCBzbyB0aGF0IGlzIHRoYXQuCisgICAgICAgIGlmIChzdGF0ZSA9PSBudWxsKSByZXR1cm47CisgICAgICAgIEZyYWdtZW50TWFuYWdlclN0YXRlIGZtcyA9IChGcmFnbWVudE1hbmFnZXJTdGF0ZSlzdGF0ZTsKKyAgICAgICAgaWYgKGZtcy5tQWN0aXZlID09IG51bGwpIHJldHVybjsKKyAgICAgICAgCisgICAgICAgIC8vIEZpcnN0IHJlLWF0dGFjaCBhbnkgbm9uLWNvbmZpZyBpbnN0YW5jZXMgd2UgYXJlIHJldGFpbmluZyBiYWNrCisgICAgICAgIC8vIHRvIHRoZWlyIHNhdmVkIHN0YXRlLCBzbyB3ZSBkb24ndCB0cnkgdG8gaW5zdGFudGlhdGUgdGhlbSBhZ2Fpbi4KKyAgICAgICAgaWYgKG5vbkNvbmZpZyAhPSBudWxsKSB7CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8bm9uQ29uZmlnLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG5vbkNvbmZpZy5nZXQoaSk7CisgICAgICAgICAgICAgICAgRnJhZ21lbnRTdGF0ZSBmcyA9IGZtcy5tQWN0aXZlW2YubUluZGV4XTsKKyAgICAgICAgICAgICAgICBmcy5tSW5zdGFuY2UgPSBmOworICAgICAgICAgICAgICAgIGYubVNhdmVkVmlld1N0YXRlID0gbnVsbDsKKyAgICAgICAgICAgICAgICBmLm1CYWNrU3RhY2tOZXN0aW5nID0gMDsKKyAgICAgICAgICAgICAgICBmLm1BZGRlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGlmIChmcy5tU2F2ZWRGcmFnbWVudFN0YXRlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgZi5tU2F2ZWRWaWV3U3RhdGUgPSBmcy5tU2F2ZWRGcmFnbWVudFN0YXRlLmdldFNwYXJzZVBhcmNlbGFibGVBcnJheSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFnbWVudFN0YXRlLlZJRVdfU1RBVEVfVEFHKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIC8vIEJ1aWxkIHRoZSBmdWxsIGxpc3Qgb2YgYWN0aXZlIGZyYWdtZW50cywgaW5zdGFudGlhdGluZyB0aGVtIGZyb20KKyAgICAgICAgLy8gdGhlaXIgc2F2ZWQgc3RhdGUuCisgICAgICAgIG1BY3RpdmUgPSBuZXcgQXJyYXlMaXN0PEZyYWdtZW50PihmbXMubUFjdGl2ZS5sZW5ndGgpOworICAgICAgICBpZiAobUF2YWlsSW5kaWNlcyAhPSBudWxsKSB7CisgICAgICAgICAgICBtQXZhaWxJbmRpY2VzLmNsZWFyKCk7CisgICAgICAgIH0KKyAgICAgICAgZm9yIChpbnQgaT0wOyBpPGZtcy5tQWN0aXZlLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICBGcmFnbWVudFN0YXRlIGZzID0gZm1zLm1BY3RpdmVbaV07CisgICAgICAgICAgICBpZiAoZnMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1BY3RpdmUuYWRkKGZzLmluc3RhbnRpYXRlKG1BY3Rpdml0eSkpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtQWN0aXZlLmFkZChudWxsKTsKKyAgICAgICAgICAgICAgICBpZiAobUF2YWlsSW5kaWNlcyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1BdmFpbEluZGljZXMgPSBuZXcgQXJyYXlMaXN0PEludGVnZXI+KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG1BdmFpbEluZGljZXMuYWRkKGkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICAvLyBCdWlsZCB0aGUgbGlzdCBvZiBjdXJyZW50bHkgYWRkZWQgZnJhZ21lbnRzLgorICAgICAgICBpZiAoZm1zLm1BZGRlZCAhPSBudWxsKSB7CisgICAgICAgICAgICBtQWRkZWQgPSBuZXcgQXJyYXlMaXN0PEZyYWdtZW50PihmbXMubUFkZGVkLmxlbmd0aCk7CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8Zm1zLm1BZGRlZC5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBtQWN0aXZlLmdldChmbXMubUFkZGVkW2ldKTsKKyAgICAgICAgICAgICAgICBpZiAoZiA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIk5vIGluc3RhbnRpYXRlZCBmcmFnbWVudCBmb3IgaW5kZXggIyIgKyBmbXMubUFkZGVkW2ldKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZi5tQWRkZWQgPSB0cnVlOworICAgICAgICAgICAgICAgIGYubUltbWVkaWF0ZUFjdGl2aXR5ID0gbUFjdGl2aXR5OworICAgICAgICAgICAgICAgIG1BZGRlZC5hZGQoZik7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtQWRkZWQgPSBudWxsOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICAvLyBCdWlsZCB0aGUgYmFjayBzdGFjay4KKyAgICAgICAgaWYgKGZtcy5tQmFja1N0YWNrICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1CYWNrU3RhY2sgPSBuZXcgQXJyYXlMaXN0PEJhY2tTdGFja0VudHJ5PihmbXMubUJhY2tTdGFjay5sZW5ndGgpOworICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPGZtcy5tQmFja1N0YWNrLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgQmFja1N0YWNrRW50cnkgYnNlID0gZm1zLm1CYWNrU3RhY2tbaV0uaW5zdGFudGlhdGUodGhpcyk7CisgICAgICAgICAgICAgICAgbUJhY2tTdGFjay5hZGQoYnNlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG1CYWNrU3RhY2sgPSBudWxsOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIGF0dGFjaEFjdGl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vb2xlYW4gc2hvdyA9IGZhbHNlOworICAgICAgICBpZiAobUFjdGl2ZSAhPSBudWxsKSB7CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8bUFkZGVkLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG1BZGRlZC5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGYgIT0gbnVsbCAmJiAhZi5tSGlkZGVuICYmIGYubUhhc01lbnUpIHsKKyAgICAgICAgICAgICAgICAgICAgc2hvdyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIGYub25DcmVhdGVPcHRpb25zTWVudShtZW51LCBpbmZsYXRlcik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBzaG93OworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgYm9vbGVhbiBkaXNwYXRjaFByZXBhcmVPcHRpb25zTWVudShNZW51IG1lbnUpIHsKKyAgICAgICAgYm9vbGVhbiBzaG93ID0gZmFsc2U7CisgICAgICAgIGlmIChtQWN0aXZlICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxtQWRkZWQuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICBGcmFnbWVudCBmID0gbUFkZGVkLmdldChpKTsKKyAgICAgICAgICAgICAgICBpZiAoZiAhPSBudWxsICYmICFmLm1IaWRkZW4gJiYgZi5tSGFzTWVudSkgeworICAgICAgICAgICAgICAgICAgICBzaG93ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgZi5vblByZXBhcmVPcHRpb25zTWVudShtZW51KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHNob3c7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBib29sZWFuIGRpc3BhdGNoT3B0aW9uc0l0ZW1TZWxlY3RlZChNZW51SXRlbSBpdGVtKSB7CisgICAgICAgIGlmIChtQWN0aXZlICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxtQWRkZWQuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICBGcmFnbWVudCBmID0gbUFkZGVkLmdldChpKTsKKyAgICAgICAgICAgICAgICBpZiAoZiAhPSBudWxsICYmICFmLm1IaWRkZW4gJiYgZi5tSGFzTWVudSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoZi5vbk9wdGlvbnNJdGVtU2VsZWN0ZWQoaXRlbSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisgICAgCisgICAgcHVibGljIGJvb2xlYW4gZGlzcGF0Y2hDb250ZXh0SXRlbVNlbGVjdGVkKE1lbnVJdGVtIGl0ZW0pIHsKKyAgICAgICAgaWYgKG1BY3RpdmUgIT0gbnVsbCkgeworICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPG1BZGRlZC5zaXplKCk7IGkrKykgeworICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBtQWRkZWQuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChmICE9IG51bGwgJiYgIWYubUhpZGRlbikgeworICAgICAgICAgICAgICAgICAgICBpZiAoZi5vbkNvbnRleHRJdGVtU2VsZWN0ZWQoaXRlbSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgZGlzcGF0Y2hPcHRpb25zTWVudUNsb3NlZChNZW51IG1lbnUpIHsKKyAgICAgICAgaWYgKG1BY3RpdmUgIT0gbnVsbCkgeworICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPG1BZGRlZC5zaXplKCk7IGkrKykgeworICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBtQWRkZWQuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChmICE9IG51bGwgJiYgIWYubUhpZGRlbiAmJiBmLm1IYXNNZW51KSB7CisgICAgICAgICAgICAgICAgICAgIGYub25PcHRpb25zTWVudUNsb3NlZChtZW51KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHVibGljIHN0YXRpYyBpbnQgcmV2ZXJzZVRyYW5zaXQoaW50IHRyYW5zaXQpIHsKKyAgICAgICAgaW50IHJldiA9IDA7CisgICAgICAgIHN3aXRjaCAodHJhbnNpdCkgeworICAgICAgICAgICAgY2FzZSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfRU5URVI6CisgICAgICAgICAgICAgICAgcmV2ID0gRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX0VYSVQ7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9FWElUOgorICAgICAgICAgICAgICAgIHJldiA9IEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9FTlRFUjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX1NIT1c6CisgICAgICAgICAgICAgICAgcmV2ID0gRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX0hJREU7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9ISURFOgorICAgICAgICAgICAgICAgIH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5UUkFOU0lUX1RBU0tfVE9fQkFDSzoKKyAgICAgICAgICAgICAgICByZXYgPSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfVEFTS19UT19GUk9OVDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX1dBTExQQVBFUl9PUEVOOgorICAgICAgICAgICAgICAgIHJldiA9IEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9XQUxMUEFQRVJfQ0xPU0U7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9XQUxMUEFQRVJfQ0xPU0U6CisgICAgICAgICAgICAgICAgcmV2ID0gRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX1dBTExQQVBFUl9PUEVOOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfV0FMTFBBUEVSX0lOVFJBX09QRU46CisgICAgICAgICAgICAgICAgcmV2ID0gRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX1dBTExQQVBFUl9JTlRSQV9DTE9TRTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX1dBTExQQVBFUl9JTlRSQV9DTE9TRToKKyAgICAgICAgICAgICAgICByZXYgPSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfV0FMTFBBUEVSX0lOVFJBX09QRU47CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJldjsKKyAgICAgICAgCisgICAgfQorICAgIAorICAgIHB1YmxpYyBzdGF0aWMgaW50IHRyYW5zaXRUb1N0eWxlSW5kZXgoaW50IHRyYW5zaXQsIGJvb2xlYW4gZW50ZXIpIHsKKyAgICAgICAgaW50IGFuaW1BdHRyID0gLTE7CisgICAgICAgIHN3aXRjaCAodHJhbnNpdCkgeworICAgICAgICAgICAgY2FzZSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfRU5URVI6CisgICAgICAgICAgICAgICAgYW5pbUF0dHIgPSBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5XaW5kb3dBbmltYXRpb25fd2luZG93RW50ZXJBbmltYXRpb247CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9FWElUOgorICAgICAgICAgICAgICAgIGFuaW1BdHRyID0gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2luZG93QW5pbWF0aW9uX3dpbmRvd0V4aXRBbmltYXRpb247CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9TSE9XOgorICAgICAgICAgICAgICAgIGFuaW1BdHRyID0gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2luZG93QW5pbWF0aW9uX3dpbmRvd1Nob3dBbmltYXRpb247CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9ISURFOgorICAgICAgICAgICAgICAgIGFuaW1BdHRyID0gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2luZG93QW5pbWF0aW9uX3dpbmRvd0hpZGVBbmltYXRpb247CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9BQ1RJVklUWV9PUEVOOgorICAgICAgICAgICAgICAgIGFuaW1BdHRyID0gZW50ZXIKKyAgICAgICAgICAgICAgICAgICAgICAgID8gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2luZG93QW5pbWF0aW9uX2FjdGl2aXR5T3BlbkVudGVyQW5pbWF0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICA6IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd0FuaW1hdGlvbl9hY3Rpdml0eU9wZW5FeGl0QW5pbWF0aW9uOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfQUNUSVZJVFlfQ0xPU0U6CisgICAgICAgICAgICAgICAgYW5pbUF0dHIgPSBlbnRlcgorICAgICAgICAgICAgICAgICAgICAgICAgPyBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5XaW5kb3dBbmltYXRpb25fYWN0aXZpdHlDbG9zZUVudGVyQW5pbWF0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICA6IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd0FuaW1hdGlvbl9hY3Rpdml0eUNsb3NlRXhpdEFuaW1hdGlvbjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX1RBU0tfT1BFTjoKKyAgICAgICAgICAgICAgICBhbmltQXR0ciA9IGVudGVyCisgICAgICAgICAgICAgICAgICAgICAgICA/IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd0FuaW1hdGlvbl90YXNrT3BlbkVudGVyQW5pbWF0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICA6IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd0FuaW1hdGlvbl90YXNrT3BlbkV4aXRBbmltYXRpb247CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9UQVNLX0NMT1NFOgorICAgICAgICAgICAgICAgIGFuaW1BdHRyID0gZW50ZXIKKyAgICAgICAgICAgICAgICAgICAgICAgID8gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2luZG93QW5pbWF0aW9uX3Rhc2tDbG9zZUVudGVyQW5pbWF0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICA6IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd0FuaW1hdGlvbl90YXNrQ2xvc2VFeGl0QW5pbWF0aW9uOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfVEFTS19UT19GUk9OVDoKKyAgICAgICAgICAgICAgICBhbmltQXR0ciA9IGVudGVyCisgICAgICAgICAgICAgICAgICAgICAgICA/IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd0FuaW1hdGlvbl90YXNrVG9Gcm9udEVudGVyQW5pbWF0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICA6IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd0FuaW1hdGlvbl90YXNrVG9Gcm9udEV4aXRBbmltYXRpb247CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9UQVNLX1RPX0JBQ0s6CisgICAgICAgICAgICAgICAgYW5pbUF0dHIgPSBlbnRlcgorICAgICAgICAgICAgICAgICAgICAgICAgPyBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5XaW5kb3dBbmltYXRpb25fdGFza1RvQmFja0VudGVyQW5pbWF0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICA6IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd0FuaW1hdGlvbl90YXNrVG9CYWNrRXhpdEFuaW1hdGlvbjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX1dBTExQQVBFUl9PUEVOOgorICAgICAgICAgICAgICAgIGFuaW1BdHRyID0gZW50ZXIKKyAgICAgICAgICAgICAgICAgICAgICAgID8gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2luZG93QW5pbWF0aW9uX3dhbGxwYXBlck9wZW5FbnRlckFuaW1hdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgOiBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5XaW5kb3dBbmltYXRpb25fd2FsbHBhcGVyT3BlbkV4aXRBbmltYXRpb247CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9XQUxMUEFQRVJfQ0xPU0U6CisgICAgICAgICAgICAgICAgYW5pbUF0dHIgPSBlbnRlcgorICAgICAgICAgICAgICAgICAgICAgICAgPyBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5XaW5kb3dBbmltYXRpb25fd2FsbHBhcGVyQ2xvc2VFbnRlckFuaW1hdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgOiBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5XaW5kb3dBbmltYXRpb25fd2FsbHBhcGVyQ2xvc2VFeGl0QW5pbWF0aW9uOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfV0FMTFBBUEVSX0lOVFJBX09QRU46CisgICAgICAgICAgICAgICAgYW5pbUF0dHIgPSBlbnRlcgorICAgICAgICAgICAgICAgICAgICAgICAgPyBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5XaW5kb3dBbmltYXRpb25fd2FsbHBhcGVySW50cmFPcGVuRW50ZXJBbmltYXRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgIDogY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2luZG93QW5pbWF0aW9uX3dhbGxwYXBlckludHJhT3BlbkV4aXRBbmltYXRpb247CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9XQUxMUEFQRVJfSU5UUkFfQ0xPU0U6CisgICAgICAgICAgICAgICAgYW5pbUF0dHIgPSBlbnRlcgorICAgICAgICAgICAgICAgICAgICAgICAgPyBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5XaW5kb3dBbmltYXRpb25fd2FsbHBhcGVySW50cmFDbG9zZUVudGVyQW5pbWF0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICA6IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd0FuaW1hdGlvbl93YWxscGFwZXJJbnRyYUNsb3NlRXhpdEFuaW1hdGlvbjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gYW5pbUF0dHI7CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvYXBwL0ZyYWdtZW50VHJhbnNhY3Rpb24uamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL2FwcC9GcmFnbWVudFRyYW5zYWN0aW9uLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uODQwZjI3NAotLS0gL2Rldi9udWxsCisrKyBiL2NvcmUvamF2YS9hbmRyb2lkL2Fw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BhIGNvbnRhaW5lciwgaXRzIHZpZXcKKyAgICAgKiBpcyBhbHNvIHJlbW92ZWQgZnJvbSB0aGF0IGNvbnRhaW5lci4KKyAgICAgKiAKKyAgICAgKiBAcGFyYW0gZnJhZ21lbnQgVGhlIGZyYWdtZW50IHRvIGJlIHJlbW92ZWQuCisgICAgICogCisgICAgICogQHJldHVybiBSZXR1cm5zIHRoZSBzYW1lIEZyYWdtZW50VHJhbnNhY3Rpb24gaW5zdGFuY2UuCisgICAgICovCisgICAgcHVibGljIEZyYWdtZW50VHJhbnNhY3Rpb24gcmVtb3ZlKEZyYWdtZW50IGZyYWdtZW50KTsKKyAgICAKKyAgICAvKioKKyAgICAgKiBIaWRlcyBhbiBleGlzdGluZyBmcmFnbWVudC4gIFRoaXMgaXMgb25seSByZWxldmFudCBmb3IgZnJhZ21lbnRzIHdob3NlCisgICAgICogdmlld3MgaGF2ZSBiZWVuIGFkZGVkIHRvIGEgY29udGFpbmVyLCBhcyB0aGlzIHdpbGwgY2F1c2UgdGhlIHZpZXcgdG8KKyAgICAgKiBiZSBoaWRkZW4uCisgICAgICogCisgICAgICogQHBhcmFtIGZyYWdtZW50IFRoZSBmcmFnbWVudCB0byBiZSBoaWRkZW4uCisgICAgICogCisgICAgICogQHJldHVybiBSZXR1cm5zIHRoZSBzYW1lIEZyYWdtZW50VHJhbnNhY3Rpb24gaW5zdGFuY2UuCisgICAgICovCisgICAgcHVibGljIEZyYWdtZW50VHJhbnNhY3Rpb24gaGlkZShGcmFnbWVudCBmcmFnbWVudCk7CisgICAgCisgICAgLyoqCisgICAgICogSGlkZXMgYSBwcmV2aW91c2x5IGhpZGRlbiBmcmFnbWVudC4gIFRoaXMgaXMgb25seSByZWxldmFudCBmb3IgZnJhZ21lbnRzIHdob3NlCisgICAgICogdmlld3MgaGF2ZSBiZWVuIGFkZGVkIHRvIGEgY29udGFpbmVyLCBhcyB0aGlzIHdpbGwgY2F1c2UgdGhlIHZpZXcgdG8KKyAgICAgKiBiZSBzaG93bi4KKyAgICAgKiAKKyAgICAgKiBAcGFyYW0gZnJhZ21lbnQgVGhlIGZyYWdtZW50IHRvIGJlIHNob3duLgorICAgICAqIAorICAgICAqIEByZXR1cm4gUmV0dXJucyB0aGUgc2FtZSBGcmFnbWVudFRyYW5zYWN0aW9uIGluc3RhbmNlLgorICAgICAqLworICAgIHB1YmxpYyBGcmFnbWVudFRyYW5zYWN0aW9uIHNob3coRnJhZ21lbnQgZnJhZ21lbnQpOworICAgIAorICAgIC8qKgorICAgICAqIEJpdCBtYXNrIHRoYXQgaXMgc2V0IGZvciBhbGwgZW50ZXIgdHJhbnNpdGlvbnMuCisgICAgICovCisgICAgcHVibGljIGZpbmFsIGludCBUUkFOU0lUX0VOVEVSX01BU0sgPSAweDEwMDA7CisgICAgCisgICAgLyoqCisgICAgICogQml0IG1hc2sgdGhhdCBpcyBzZXQgZm9yIGFsbCBleGl0IHRyYW5zaXRpb25zLgorICAgICAqLworICAgIHB1YmxpYyBmaW5hbCBpbnQgVFJBTlNJVF9FWElUX01BU0sgPSAweDIwMDA7CisgICAgCisgICAgLyoqIE5vdCBzZXQgdXAgZm9yIGEgdHJhbnNpdGlvbi4gKi8KKyAgICBwdWJsaWMgZmluYWwgaW50IFRSQU5TSVRfVU5TRVQgPSAtMTsKKyAgICAvKiogTm8gYW5pbWF0aW9uIGZvciB0cmFuc2l0aW9uLiAqLworICAgIHB1YmxpYyBmaW5hbCBpbnQgVFJBTlNJVF9OT05FID0gMDsKKyAgICAvKiogV2luZG93IGhhcyBiZWVuIGFkZGVkIHRvIHRoZSBzY3JlZW4uICovCisgICAgcHVibGljIGZpbmFsIGludCBUUkFOU0lUX0VOVEVSID0gMSB8IFRSQU5TSVRfRU5URVJfTUFTSzsKKyAgICAvKiogV2luZG93IGhhcyBiZWVuIHJlbW92ZWQgZnJvbSB0aGUgc2NyZWVuLiAqLworICAgIHB1YmxpYyBmaW5hbCBpbnQgVFJBTlNJVF9FWElUID0gMiB8IFRSQU5TSV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tlbiwgYXBwbGljYXRpb24sIGludGVudCwKKyAgICAgICAgICAgICAgICBpbmZvLCB0aXRsZSwgcGFyZW50LCBpZCwKKyAgICAgICAgICAgICAgICAoQWN0aXZpdHkuTm9uQ29uZmlndXJhdGlvbkluc3RhbmNlcylsYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlLAorICAgICAgICAgICAgICAgIG5ldyBDb25maWd1cmF0aW9uKCkpOwogICAgICAgICByZXR1cm4gYWN0aXZpdHk7CiAgICAgfQogCkBAIC0xMDU4LDIxICsxMDYwLDIzIEBACiAgICAgfQogICAgIAogICAgIHB1YmxpYyB2b2lkIGNhbGxBY3Rpdml0eU9uRGVzdHJveShBY3Rpdml0eSBhY3Rpdml0eSkgewotICAgICAgaWYgKG1XYWl0aW5nQWN0aXZpdGllcyAhPSBudWxsKSB7Ci0gICAgICAgICAgc3luY2hyb25pemVkIChtU3luYykgewotICAgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1XYWl0aW5nQWN0aXZpdGllcy5zaXplKCk7Ci0gICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKLSAgICAgICAgICAgICAgICAgIGZpbmFsIEFjdGl2aXR5V2FpdGVyIGF3ID0gbVdhaXRpbmdBY3Rpdml0aWVzLmdldChpKTsKLSAgICAgICAgICAgICAgICAgIGZpbmFsIEludGVudCBpbnRlbnQgPSBhdy5pbnRlbnQ7Ci0gICAgICAgICAgICAgICAgICBpZiAoaW50ZW50LmZpbHRlckVxdWFscyhhY3Rpdml0eS5nZXRJbnRlbnQoKSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICBhdy5hY3Rpdml0eSA9IGFjdGl2aXR5OwotICAgICAgICAgICAgICAgICAgICAgIG1NZXNzYWdlUXVldWUuYWRkSWRsZUhhbmRsZXIobmV3IEFjdGl2aXR5R29pbmcoYXcpKTsKLSAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgfQotICAgICAgICAgIH0KLSAgICAgIH0KKyAgICAgIC8vIFRPRE86IHRoZSBmb2xsb3dpbmcgYmxvY2sgY2F1c2VzIGludGVybWl0dGVudCBoYW5ncyB3aGVuIHVzaW5nIHN0YXJ0QWN0aXZpdHkKKyAgICAgIC8vIHRlbXBvcmFyaWx5IGNvbW1lbnQgb3V0IHVudGlsIHJvb3QgY2F1c2UgaXMgZml4ZWQgKGJ1ZyAyNjMwNjgzKQorLy8gICAgICBpZiAobVdhaXRpbmdBY3Rpdml0aWVzICE9IG51bGwpIHsKKy8vICAgICAgICAgIHN5bmNocm9uaXplZCAobVN5bmMpIHsKKy8vICAgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1XYWl0aW5nQWN0aXZpdGllcy5zaXplKCk7CisvLyAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworLy8gICAgICAgICAgICAgICAgICBmaW5hbCBBY3Rpdml0eVdhaXRlciBhdyA9IG1XYWl0aW5nQWN0aXZpdGllcy5nZXQoaSk7CisvLyAgICAgICAgICAgICAgICAgIGZpbmFsIEludGVudCBpbnRlbnQgPSBhdy5pbnRlbnQ7CisvLyAgICAgICAgICAgICAgICAgIGlmIChpbnRlbnQuZmlsdGVyRXF1YWxzKGFjdGl2aXR5LmdldEludGVudCgpKSkgeworLy8gICAgICAgICAgICAgICAgICAgICAgYXcuYWN0aXZpdHkgPSBhY3Rpdml0eTsKKy8vICAgICAgICAgICAgICAgICAgICAgIG1NZXNzYWdlUXVldWUuYWRkSWRsZUhhbmRsZXIobmV3IEFjdGl2aXR5R29pbmcoYXcpKTsKKy8vICAgICAgICAgICAgICAgICAgfQorLy8gICAgICAgICAgICAgIH0KKy8vICAgICAgICAgIH0KKy8vICAgICAgfQogICAgICAgCi0gICAgICBhY3Rpdml0eS5vbkRlc3Ryb3koKTsKKyAgICAgIGFjdGl2aXR5LnBlcmZvcm1EZXN0cm95KCk7CiAgICAgICAKICAgICAgIGlmIChtQWN0aXZpdHlNb25pdG9ycyAhPS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HJvaWQuY29udGVudC5BY3Rpdml0eU5vdEZvdW5kRXhjZXB0aW9uCisgICAgICogCisgICAgICogQHNlZSBBY3Rpdml0eSNzdGFydEFjdGl2aXR5KEludGVudCkKKyAgICAgKiBAc2VlIEFjdGl2aXR5I3N0YXJ0QWN0aXZpdHlGb3JSZXN1bHQoSW50ZW50LCBpbnQpCisgICAgICogQHNlZSBBY3Rpdml0eSNzdGFydEFjdGl2aXR5RnJvbUNoaWxkCisgICAgICogCisgICAgICoge0BoaWRlfQorICAgICAqLworICAgIHB1YmxpYyBBY3Rpdml0eVJlc3VsdCBleGVjU3RhcnRBY3Rpdml0eSgKKyAgICAgICAgQ29udGV4dCB3aG8sIElCaW5kZXIgY29udGV4dFRocmVhZCwgSUJpbmRlciB0b2tlbiwgRnJhZ21lbnQgdGFyZ2V0LAorICAgICAgICBJbnRlbnQgaW50ZW50LCBpbnQgcmVxdWVzdENvZGUpIHsKKyAgICAgICAgSUFwcGxpY2F0aW9uVGhyZWFkIHdob1RocmVhZCA9IChJQXBwbGljYXRpb25UaHJlYWQpIGNvbnRleHRUaHJlYWQ7CisgICAgICAgIGlmIChtQWN0aXZpdHlNb25pdG9ycyAhPSBudWxsKSB7CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1TeW5jKSB7CisgICAgICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtQWN0aXZpdHlNb25pdG9ycy5zaXplKCk7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgICAgICAgICBmaW5hbCBBY3Rpdml0eU1vbml0b3IgYW0gPSBtQWN0aXZpdHlNb25pdG9ycy5nZXQoaSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChhbS5tYXRjaCh3aG8sIG51bGwsIGludGVudCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFtLm1IaXRzKys7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW0uaXNCbG9ja2luZygpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlcXVlc3RDb2RlID49IDAgPyBhbS5nZXRSZXN1bHQoKSA6IG51bGw7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICB0cnkgeworICAgICAgICAgICAgaW50IHJlc3VsdCA9IEFjdGl2aXR5TWFuYWdlck5hdGl2ZS5nZXREZWZhdWx0KCkKKyAgICAgICAgICAgICAgICAuc3RhcnRBY3Rpdml0eSh3aG9UaHJlYWQsIGludGVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGludGVudC5yZXNvbHZlVHlwZUlmTmVlZGVkKHdoby5nZXRDb250ZW50UmVzb2x2ZXIoKSksCisgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCAwLCB0b2tlbiwgdGFyZ2V0ICE9IG51bGwgPyB0YXJnZXQubVdobyA6IG51bGwsCisgICAgICAgICAgICAgICAgICAgICAgICByZXF1ZXN0Q29kZSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAgIGNoZWNrU3RhcnRBY3Rpdml0eVJlc3VsdChyZXN1bHQsIGludGVudCk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCiAgICAgLypwYWNrYWdlKi8gZmluYWwgdm9pZCBpbml0KEFjdGl2aXR5VGhyZWFkIHRocmVhZCwKICAgICAgICAgICAgIENvbnRleHQgaW5zdHJDb250ZXh0LCBDb250ZXh0IGFwcENvbnRleHQsIENvbXBvbmVudE5hbWUgY29tcG9uZW50LCAKICAgICAgICAgICAgIElJbnN0cnVtZW50YXRpb25XYXRjaGVyIHdhdGNoZXIpIHsKZGlmZiAtLWdpdCBhL2Nvc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Pbkl0ZW1DbGlja0xpc3RlbmVyKCkgeworICAgICAgICBwdWJsaWMgdm9pZCBvbkl0ZW1DbGljayhBZGFwdGVyVmlldzw/PiBwYXJlbnQsIFZpZXcgdiwgaW50IHBvc2l0aW9uLCBsb25nIGlkKSB7CisgICAgICAgICAgICBvbkxpc3RJdGVtQ2xpY2soKExpc3RWaWV3KXBhcmVudCwgdiwgcG9zaXRpb24sIGlkKTsKKyAgICAgICAgfQorICAgIH07CisKKyAgICBMaXN0QWRhcHRlciBtQWRhcHRlcjsKKyAgICBMaXN0VmlldyBtTGlzdDsKKworICAgIHB1YmxpYyBMaXN0RnJhZ21lbnQoKSB7CisgICAgfQorCisgICAgLyoqCisgICAgICogUHJvdmlkZSBkZWZhdWx0IGltcGxlbWVudGF0aW9uIHRvIHJldHVybiBhIHNpbXBsZSBsaXN0IHZpZXcuCisgICAgICovCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIFZpZXcgb25DcmVhdGVWaWV3KExheW91dEluZmxhdGVyIGluZmxhdGVyLCBWaWV3R3JvdXAgY29udGFpbmVyLAorICAgICAgICAgICAgQnVuZGxlIHNhdmVkSW5zdGFuY2VTdGF0ZSkgeworICAgICAgICByZXR1cm4gaW5mbGF0ZXIuaW5mbGF0ZShjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmxheW91dC5saXN0X2NvbnRlbnQsCisgICAgICAgICAgICAgICAgY29udGFpbmVyLCBmYWxzZSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQXR0YWNoIHRvIGxpc3QgdmlldyBvbmNlIEZyYWdtZW50IGlzIHJlYWR5IHRvIHJ1bi4KKyAgICAgKi8KKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBvblJlYWR5KEJ1bmRsZSBzYXZlZEluc3RhbmNlU3RhdGUpIHsKKyAgICAgICAgc3VwZXIub25SZWFkeShzYXZlZEluc3RhbmNlU3RhdGUpOworICAgICAgICBlbnN1cmVMaXN0KCk7CisgICAgfQ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worICAgICAgICBlbnN1cmVMaXN0KCk7CisgICAgICAgIHJldHVybiBtTGlzdC5nZXRTZWxlY3RlZEl0ZW1JZCgpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEdldCB0aGUgYWN0aXZpdHkncyBsaXN0IHZpZXcgd2lkZ2V0LgorICAgICAqLworICAgIHB1YmxpYyBMaXN0VmlldyBnZXRMaXN0VmlldygpIHsKKyAgICAgICAgZW5zdXJlTGlzdCgpOworICAgICAgICByZXR1cm4gbUxpc3Q7CisgICAgfQorCisgICAgLyoqCisgICAgICogR2V0IHRoZSBMaXN0QWRhcHRlciBhc3NvY2lhdGVkIHdpdGggdGhpcyBhY3Rpdml0eSdzIExpc3RWaWV3LgorICAgICAqLworICAgIHB1YmxpYyBMaXN0QWRhcHRlciBnZXRMaXN0QWRhcHRlcigpIHsKKyAgICAgICAgcmV0dXJuIG1BZGFwdGVyOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBlbnN1cmVMaXN0KCkgeworICAgICAgICBpZiAobUxpc3QgIT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIFZpZXcgcm9vdCA9IGdldFZpZXcoKTsKKyAgICAgICAgaWYgKHJvb3QgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiQ29udGVudCB2aWV3IG5vdCB5ZXQgY3JlYXRlZCIpOworICAgICAgICB9CisgICAgICAgIFZpZXcgZW1wdHlWaWV3ID0gcm9vdC5maW5kVmlld0J5SWQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC5lbXB0eSk7CisgICAgICAgIG1MaXN0ID0gKExpc3RWaWV3KXJvb3QuZmluZFZpZXdCeUlkKGNvbS5hbmRyb2lkLmludGVybmFsLlIuaWQubGlzdCk7CisgICAgICAgIGlmIChtTGlzdCA9PSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2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ICAgTG9hZGVySW5mbzxEPiBpbmZvID0gbUxvYWRlcnMuZ2V0KGlkKTsKKyAgICAgICAgaWYgKGluZm8gIT0gbnVsbCkgeworICAgICAgICAgICAgLy8gS2VlcCB0cmFjayBvZiB0aGUgcHJldmlvdXMgaW5zdGFuY2Ugb2YgdGhpcyBsb2FkZXIgc28gd2UgY2FuIGRlc3Ryb3kKKyAgICAgICAgICAgIC8vIGl0IHdoZW4gdGhlIG5ldyBvbmUgY29tcGxldGVzLgorICAgICAgICAgICAgbUluYWN0aXZlTG9hZGVycy5wdXQoaWQsIGluZm8pOworICAgICAgICB9CisgICAgICAgIGluZm8gPSBuZXcgTG9hZGVySW5mbzxEPigpOworICAgICAgICBpbmZvLmFyZ3MgPSBhcmdzOworICAgICAgICBtTG9hZGVycy5wdXQoaWQsIGluZm8pOworICAgICAgICBMb2FkZXI8RD4gbG9hZGVyID0gb25DcmVhdGVMb2FkZXIoaWQsIGFyZ3MpOworICAgICAgICBpbmZvLmxvYWRlciA9IGxvYWRlcjsKKyAgICAgICAgaWYgKG1TdGFydGVkKSB7CisgICAgICAgICAgICAvLyBUaGUgYWN0aXZpdHkgd2lsbCBzdGFydCBhbGwgZXhpc3RpbmcgbG9hZGVycyBpbiBpdCdzIG9uU3RhcnQoKSwgc28gb25seSBzdGFydCB0aGVtCisgICAgICAgICAgICAvLyBoZXJlIGlmIHdlJ3JlIHBhc3QgdGhhdCBwb2ludCBvZiB0aGUgYWN0aXZpdGl5J3MgbGlmZSBjeWNsZQorICAgICAgICAgICAgbG9hZGVyLnJlZ2lzdGVyTGlzdGVuZXIoaWQsIHRoaXMpOworICAgICAgICAgICAgbG9hZGVyLnN0YXJ0TG9hZGluZygpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBsb2FkZXI7CisgICAgfQorCisgICAgcHJvdGVjdGVkIGFic3RyYWN0IExvYWRlcjxEPiBvbkNyZWF0ZUxvYWRlcihpbnQgaWQsIEJ1bmRsZSBhcmdzKTsKKyAgICBwcm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gIGlmIChtTG9hZGVycyA9PSBudWxsKSB7CisgICAgICAgICAgICAvLyBMb29rIGZvciBhIHBhc3NlZCBhbG9uZyBsb2FkZXIgYW5kIGNyZWF0ZSBhIG5ldyBvbmUgaWYgaXQncyBub3QgdGhlcmUKKy8vIFRPRE86IHVuY29tbWVudCBvbmNlIGdldExhc3ROb25Db25maWd1cmF0aW9uSW5zdGFuY2UgbWV0aG9kIGlzIGF2YWlsYWJsZQorLy8gICAgICAgICAgICBtTG9hZGVycyA9IChIYXNoTWFwPEludGVnZXIsIExvYWRlckluZm8+KSBnZXRMYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlKCk7CisgICAgICAgICAgICBpZiAobUxvYWRlcnMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1Mb2FkZXJzID0gbmV3IEhhc2hNYXA8SW50ZWdlciwgTG9hZGVySW5mbzxEPj4oKTsKKyAgICAgICAgICAgICAgICBvbkluaXRpYWxpemVMb2FkZXJzKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1JbmFjdGl2ZUxvYWRlcnMgPT0gbnVsbCkgeworICAgICAgICAgICAgbUluYWN0aXZlTG9hZGVycyA9IG5ldyBIYXNoTWFwPEludGVnZXIsIExvYWRlckluZm88RD4+KCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBvblN0YXJ0KCkgeworICAgICAgICBzdXBlci5vblN0YXJ0KCk7CisKKyAgICAgICAgLy8gQ2FsbCBvdXQgdG8gc3ViIGNsYXNzZXMgc28gdGhleSBjYW4gc3RhcnQgdGhlaXIgbG9hZGVycworICAgICAgICAvLyBMZXQgdGhlIGV4aXN0aW5nIGxvYWRlcnMga25vdyB0aGF0IHdlIHdhbnQgdG8gYmUgbm90aWZpZWQgd2hlbiBhIGxvYWQgaXMgY29tcGxldGUKKyAgICAgICAgZm9yIChIYXNoTWFwLkVudHJ5PEludGVnZXIsIExvYWRlckluZm88RD4+IGVudHJ5IDogbUxvYWRlcnMuZW50cnlTZXQoKSkgeworICAgICAgICAgICAgTG9hZGVySW5mbzxEPiBpbmZvID0gZW50cnkuZ2V0VmFsdWUoKTsKKyAgICAgICAgICAgIExvYWRlcjxEPiBsb2FkZXIgPSBpbmZvLmxvYWRlcjsKKyAgICAgICAgICAgIGludCBpZCA9IGVudHJ5LmdldEtleSgpOworICAgICAgICAgICAgaWYgKGxvYWRlciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICBsb2FkZXIgPSBvbkNyZWF0ZUxvYWRlcihpZCwgaW5mby5hcmdzKTsKKyAgICAgICAgICAgICAgIGluZm8ubG9hZGVyID0gbG9hZGVyOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbG9hZGVyLnJlZ2lzdGVyTGlzdGVuZXIoaWQsIHRoaXMpOworICAgICAgICAgICAgbG9hZGVyLnN0YXJ0TG9hZGluZygpOworICAgICAgICB9CisKKyAgICAgICAgbVN0YXJ0ZWQgPSB0cnVlOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIG9uU3RvcCgpIHsKKyAgICAgICAgc3VwZXIub25TdG9wKCk7CisKKyAgICAgICAgZm9yIChIYXNoTWFwLkVudHJ5PEludGVnZXIsIExvYWRlckluZm88RD4+IGVudHJ5IDogbUxvYWRlcnMuZW50cnlTZXQoKSkgeworICAgICAgICAgICAgTG9hZGVySW5mbzxEPiBpbmZvID0gZW50cnkuZ2V0VmFsdWUoKTsKKyAgICAgICAgICAgIExvYWRlcjxEPiBsb2FkZXIgPSBpbmZvLmxvYWRlcjsKKyAgICAgICAgICAgIGlmIChsb2FkZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBMZXQgdGhlIGxvYWRlciBrbm93IHdlJ3JlIGRvbmUgd2l0aCBpdAorICAgICAgICAgICAgbG9hZGVyLnVucmVn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gICAgICBMb2FkZXI8RD4gbG9hZGVyID0gaW5mby5sb2FkZXI7CisgICAgICAgICAgICAgICAgaWYgKGxvYWRlciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBsb2FkZXIuZGVzdHJveSgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogU3RvcHMgYW5kIHJlbW92ZXMgdGhlIGxvYWRlciB3aXRoIHRoZSBnaXZlbiBJRC4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzdG9wTG9hZGluZyhpbnQgaWQpIHsKKyAgICAgICAgaWYgKG1Mb2FkZXJzICE9IG51bGwpIHsKKyAgICAgICAgICAgIExvYWRlckluZm88RD4gaW5mbyA9IG1Mb2FkZXJzLnJlbW92ZShpZCk7CisgICAgICAgICAgICBpZiAoaW5mbyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgTG9hZGVyPEQ+IGxvYWRlciA9IGluZm8ubG9hZGVyOworICAgICAgICAgICAgICAgIGlmIChsb2FkZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBsb2FkZXIudW5yZWdpc3Rlckxpc3RlbmVyKHRoaXMpOworICAgICAgICAgICAgICAgICAgICBsb2FkZXIuZGVzdHJveSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gdGhlIExvYWRlciB3aXRoIHRoZSBnaXZlbiBpZCBvciBudWxsIGlmIG5vIG1hdGNoaW5nIExvYWRlcgorICAgICAqIGlzIGZvdW5kLgorICAgICAqLworICAgIHB1YmxpYyBMb2FkZXI8RD4gZ2V0TG9hZGVyKGludCBpZCkgeworICAgICAgICBMb2FkZXJJbmZvPEQ+IGxvYWRlckluZm8gPSBtTG9hZGVycy5nZXQoaWQpOworICAgICAgICBpZ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25Db25maWd1cmF0aW9uSW5zdGFuY2VzLmdldChyLmlkKTsKKyAgICAgICAgICAgICAgICBpbnN0YW5jZU9iaiA9IGxhc3ROb25Db25maWd1cmF0aW9uSW5zdGFuY2VzLmdldChyLmlkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEFjdGl2aXR5Lk5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZXMgaW5zdGFuY2UgPSBudWxsOworICAgICAgICAgICAgaWYgKGluc3RhbmNlT2JqICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpbnN0YW5jZSA9IG5ldyBBY3Rpdml0eS5Ob25Db25maWd1cmF0aW9uSW5zdGFuY2VzKCk7CisgICAgICAgICAgICAgICAgaW5zdGFuY2UuYWN0aXZpdHkgPSBpbnN0YW5jZU9iajsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIAogICAgICAgICAgICAgLy8gV2UgbmVlZCB0byBoYXZlIGFsd2F5cyBjcmVhdGVkIHRoZSBhY3Rpdml0eS4KQEAgLTM0Niw3ICszNDksNyBAQAogICAgIH0KIAogICAgIHByaXZhdGUgV2luZG93IHBlcmZvcm1EZXN0cm95KExvY2FsQWN0aXZpdHlSZWNvcmQgciwgYm9vbGVhbiBmaW5pc2gpIHsKLSAgICAgICAgV2luZG93IHdpbiA9IG51bGw7CisgICAgICAgIFdpbmRvdyB3aW47CiAgICAgICAgIHdpbiA9IHIud2luZG93OwogICAgICAgICBpZiAoci5jdXJTdGF0ZSA9PSBSRVNVTUVEICYmICFmaW5pc2gpIHsKICAgICAgICAgICAgIHBlcmZvcm1QYXVzZShyLCBmaW5pc2gpOwpAQCAtMzgwLDcgKzM4Myw4IEBACiAgICAgICAgIGlmIChyICE9IG51bGwpIHsKICAgICAgICAgICAgIHdpbiA9IHBlcmZvcm1EZXN0cm95KHIsIGZpbmlzaCk7CiAgICAgICAgICAgICBpZiAoZmluaXNoKSB7Ci0gICAgICAgICAgICAgICAgbUFjdGl2aXRpZXMucmVtb3ZlKHIpOworICAgICAgICAgICAgICAgIG1BY3Rpdml0aWVzLnJlbW92ZShpZCk7CisgICAgICAgICAgICAgICAgbUFjdGl2aXR5QXJyYXkucmVtb3ZlKHIpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIHJldHVybiB3aW47CkBAIC00NDEsMTAgKzQ0NSw4IEBACiAgICAgICovCiAgICAgcHVibGljIHZvaWQgZGlzcGF0Y2hDcmVhdGUoQnVuZGxlIHN0YXRlKSB7CiAgICAgICAgIGlmIChzdGF0ZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICBmaW5hbCBJdGVyYXRvcjxTdHJpbmc+IGkgPSBzdGF0ZS5rZXlTZXQoKS5pdGVyYXRvcigpOwotICAgICAgICAgICAgd2hpbGUgKGkuaGFzTmV4dCgpKSB7CisgICAgICAgICAgICBmb3IgKFN0cmluZyBpZCA6IHN0YXRlLmtleVNldCgpKSB7CiAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIGlkID0gaS5uZXh0KCk7CiAgICAgICAgICAgICAgICAgICAgIGZpbmFsIEJ1bmRsZSBhc3RhdGUgPSBzdGF0ZS5nZXRCdW5kbGUoaWQpOwogICAgICAgICAgICAgICAgICAgICBMb2NhbEFjdGl2aXR5UmVjb3JkIHIgPSBtQWN0aXZpdGllcy5nZXQoaWQpOwogICAgICAgICAgICAgICAgICAgICBpZiAociAhPSBudWxsKSB7CkBAIC00NTcsOSArNDU5LDcgQEAKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgICAgICAgICAgIC8vIFJlY292ZXIgZnJvbSAtYWxsLSBhcHAgZXJyb3JzLgotICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICJFeGNlcHRpb24gdGhyb3duIHdoZW4gcmVzdG9ya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pbGwgYmUgdGhyb3duLgorICAgICAqCisgICAgICogQHBhcmFtIGFkbWluIFdoaWNoIHtAbGluayBEZXZpY2VBZG1pblJlY2VpdmVyfSB0aGlzIHJlcXVlc3QgaXMgYXNzb2NpYXRlZAorICAgICAqICAgICAgICAgICAgd2l0aC4KKyAgICAgKiBAcGFyYW0gbGVuZ3RoIFRoZSBuZXcgZGVzaXJlZCBtaW5pbXVtIG51bWJlciBvZiB1cHBlciBjYXNlIGxldHRlcnMKKyAgICAgKiAgICAgICAgICAgIHJlcXVpcmVkIGluIHRoZSBwYXNzd29yZC4gQSB2YWx1ZSBvZiAwIG1lYW5zIHRoZXJlIGlzIG5vCisgICAgICogICAgICAgICAgICByZXN0cmljdGlvbi4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRQYXNzd29yZE1pbmltdW1VcHBlckNhc2UoQ29tcG9uZW50TmFtZSBhZG1pbiwgaW50IGxlbmd0aCkgeworICAgICAgICBpZiAobVNlcnZpY2UgIT0gbnVsbCkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBtU2VydmljZS5zZXRQYXNzd29yZE1pbmltdW1VcHBlckNhc2UoYWRtaW4sIGxlbmd0aCk7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkZhaWxlZCB0YWxraW5nIHdpdGggZGV2aWNlIHBvbGljeSBzZXJ2aWNlIiwgZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXRyaWV2ZSB0aGUgY3VycmVudCBudW1iZXIgb2YgdXBwZXIgY2FzZSBsZXR0ZXJzIHJlcXVpcmVkIGluIHRoZQorICAgICAqIHBhc3N3b3JkIGZvciBhbGwgYWRtaW5zIG9yIGEgcGFydGljdWxhciBvbmUuIFRoaXMgaXMgdGhlIHNhbWUgdmFsdWUgYXMKKyAgICAgKiB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GhhcyBub3QsIGEgc2VjdXJpdHkgZXhjZXB0aW9uIHdpbGwgYmUgdGhyb3duLgorICAgICAqCisgICAgICogQHBhcmFtIGFkbWluIFdoaWNoIHtAbGluayBEZXZpY2VBZG1pblJlY2VpdmVyfSB0aGlzIHJlcXVlc3QgaXMgYXNzb2NpYXRlZAorICAgICAqICAgICAgICAgICAgd2l0aC4KKyAgICAgKiBAcGFyYW0gbGVuZ3RoIFRoZSBuZXcgZGVzaXJlZCBtaW5pbXVtIG51bWJlciBvZiBsb3dlciBjYXNlIGxldHRlcnMKKyAgICAgKiAgICAgICAgICAgIHJlcXVpcmVkIGluIHRoZSBwYXNzd29yZC4gQSB2YWx1ZSBvZiAwIG1lYW5zIHRoZXJlIGlzIG5vCisgICAgICogICAgICAgICAgICByZXN0cmljdGlvbi4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRQYXNzd29yZE1pbmltdW1Mb3dlckNhc2UoQ29tcG9uZW50TmFtZSBhZG1pbiwgaW50IGxlbmd0aCkgeworICAgICAgICBpZiAobVNlcnZpY2UgIT0gbnVsbCkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBtU2VydmljZS5zZXRQYXNzd29yZE1pbmltdW1Mb3dlckNhc2UoYWRtaW4sIGxlbmd0aCk7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkZhaWxlZCB0YWxraW5nIHdpdGggZGV2aWNlIHBvbGljeSBzZXJ2aWNlIiwgZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXRyaWV2ZSB0aGUgY3VycmVudCBudW1iZXIgb2YgbG93ZXIgY2FzZSBsZXR0ZXJzIHJlcXVpcmVkIGluIHRoZQorICAgICAqIHBhc3N3b3JkIGZvciBhbGwgYWRtaW5zIG9yIGEgcGFydGljdWxhciBvbmUuIFR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9IHRvIGJlIGFibGUgdG8gY2FsbAorICAgICAqIHRoaXMgbWV0aG9kOyBpZiBpdCBoYXMgbm90LCBhIHNlY3VyaXR5IGV4Y2VwdGlvbiB3aWxsIGJlIHRocm93bi4KKyAgICAgKgorICAgICAqIEBwYXJhbSBhZG1pbiBXaGljaCB7QGxpbmsgRGV2aWNlQWRtaW5SZWNlaXZlcn0gdGhpcyByZXF1ZXN0IGlzIGFzc29jaWF0ZWQKKyAgICAgKiAgICAgICAgICAgIHdpdGguCisgICAgICogQHBhcmFtIGxlbmd0aCBUaGUgbmV3IGRlc2lyZWQgbWluaW11bSBudW1iZXIgb2YgbGV0dGVycyByZXF1aXJlZCBpbiB0aGUKKyAgICAgKiAgICAgICAgICAgIHBhc3N3b3JkLiBBIHZhbHVlIG9mIDAgbWVhbnMgdGhlcmUgaXMgbm8gcmVzdHJpY3Rpb24uCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0UGFzc3dvcmRNaW5pbXVtTGV0dGVycyhDb21wb25lbnROYW1lIGFkbWluLCBpbnQgbGVuZ3RoKSB7CisgICAgICAgIGlmIChtU2VydmljZSAhPSBudWxsKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIG1TZXJ2aWNlLnNldFBhc3N3b3JkTWluaW11bUxldHRlcnMoYWRtaW4sIGxlbmd0aCk7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkZhaWxlZCB0YWxraW5nIHdpdGggZGV2aWNlIHBvbGljeSBzZXJ2aWNlIiwgZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXRyaWV2ZSB0aGUgY3VycmVudCBudW1iZXIgb2YgbGV0dGVycyByZXF1aXJlZCBpbiB0aGUgcGFzc3dvcmQgZm9yIGFsbAorICAgICAqIGFkbWlucyBvciBhIHBhcnRpY3VsYXIgb25lLiBUaGlzIGlzIHRoZSBzYW1lIHZhbHVlIGFzCisgICAgICogc2V0IGJ5IHsjbGluayB7QGxpbmsgI3NldFBhc3N3b3JkTWluaW11bUxldHRlcnMoQ29tcG9uZW50TmFtZSwgaW50KX0KKyAgICAgKiBhbmQgb25seSBhcHBsaWVzIHdoZW4gdGhlIHBhc3N3b3JkIHF1YWxpdHkgaXMKKyAgICAgKiB7QGxpbmsgI1BBU1NXT1JEX1FVQUxJVFlfQ09NUExFWH0uCisgICAgICoKKyAgICAgKiBAcGFyYW0gYWRtaW4gVGhlIG5hbWUgb2YgdGhlIGFkbWluIGNvbXBvbmVudCB0byBjaGVjaywgb3IgbnVsbCB0bworICAgICAqICAgICAgICAgICAgYWdncmVnYXRlIGFsbCBhZG1pbnMuCisgICAgICogQHJldHVybiBUaGUgbWluaW11bSBudW1iZXIgb2YgbGV0dGVycyByZXF1aXJlZCBpbiB0aGUgcGFzc3dvcmQuCisgICAgICovCisgICAgcHVibGljIGludCBnZXRQYXNzd29yZE1pbmltdW1MZXR0ZXJzKENvbXBvbmVudE5hbWUgYWRtaW4pIHsKKyAgICAgICAgaWYgKG1TZXJ2aWNlICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmdldFBhc3N3b3JkTWluaW11bUxldHRlcnMoYWRtaW4pOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJGYWlsZWQgdGFsa2luZyB3aXRoIGRldmljZSBwb2xpY3kgc2VydmljZSIsIGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIC8qKgorICAgICAqIENhbGxlZCBieSBhbiBhcHBsaWNhdGlvbiB0aGF0IGlzIGFkbWluaXN0ZXJpbmcgdGhlIGRldmljZSB0byBzZXQgdGhlCisgICAgICogbWlu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5vdCwgYSBzZWN1cml0eSBleGNlcHRpb24gd2lsbCBiZSB0aHJvd24uCisgICAgICoKKyAgICAgKiBAcGFyYW0gYWRtaW4gV2hpY2gge0BsaW5rIERldmljZUFkbWluUmVjZWl2ZXJ9IHRoaXMgcmVxdWVzdCBpcyBhc3NvY2lhdGVkCisgICAgICogICAgICAgICAgICB3aXRoLgorICAgICAqIEBwYXJhbSBsZW5ndGggVGhlIG5ldyBkZXNpcmVkIG1pbmltdW0gbnVtYmVyIG9mIG51bWVyaWNhbCBkaWdpdHMgcmVxdWlyZWQKKyAgICAgKiAgICAgICAgICAgIGluIHRoZSBwYXNzd29yZC4gQSB2YWx1ZSBvZiAwIG1lYW5zIHRoZXJlIGlzIG5vIHJlc3RyaWN0aW9uLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldFBhc3N3b3JkTWluaW11bU51bWVyaWMoQ29tcG9uZW50TmFtZSBhZG1pbiwgaW50IGxlbmd0aCkgeworICAgICAgICBpZiAobVNlcnZpY2UgIT0gbnVsbCkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBtU2VydmljZS5zZXRQYXNzd29yZE1pbmltdW1OdW1lcmljKGFkbWluLCBsZW5ndGgpOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJGYWlsZWQgdGFsa2luZyB3aXRoIGRldmljZSBwb2xpY3kgc2VydmljZSIsIGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0cmlldmUgdGhlIGN1cnJlbnQgbnVtYmVyIG9mIG51bWVyaWNhbCBkaWdpdHMgcmVxdWlyZWQgaW4gdGhlIHBhc3N3b3JkCisgICAgICogZm9yIGFsbCBhZG1pbnMgb3IgYSBwYXJ0aWN1bGFyIG9uZS4gVGhpcyBpcyB0aGUgc2FtZSB2YWx1ZSBhcworICAgICAqIHNldCBieSB7I2xpbmsge0BsaW5rICNzZXRQYXNzd29yZE1pbmltdW1OdW1lcmljKENvbXBvbmVudE5hbWUsIGludCl9CisgICAgICogYW5kIG9ubHkgYXBwbGllcyB3aGVuIHRoZSBwYXNzd29yZCBxdWFsaXR5IGlzCisgICAgICoge0BsaW5rICNQQVNTV09SRF9RVUFMSVRZX0NPTVBMRVh9LgorICAgICAqCisgICAgICogQHBhcmFtIGFkbWluIFRoZSBuYW1lIG9mIHRoZSBhZG1pbiBjb21wb25lbnQgdG8gY2hlY2ssIG9yIG51bGwgdG8KKyAgICAgKiAgICAgICAgICAgIGFnZ3JlZ2F0ZSBhbGwgYWRtaW5zLgorICAgICAqIEByZXR1cm4gVGhlIG1pbmltdW0gbnVtYmVyIG9mIG51bWVyaWNhbCBkaWdpdHMgcmVxdWlyZWQgaW4gdGhlIHBhc3N3b3JkLgorICAgICAqLworICAgIHB1YmxpYyBpbnQgZ2V0UGFzc3dvcmRNaW5pbXVtTnVtZXJpYyhDb21wb25lbnROYW1lIGFkbWluKSB7CisgICAgICAgIGlmIChtU2VydmljZSAhPSBudWxsKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5nZXRQYXNzd29yZE1pbmltdW1OdW1lcmljKGFkbWluKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiRmFpbGVkIHRhbGtpbmcgd2l0aCBkZXZpY2UgcG9saWN5IHNlcnZpY2UiLCBlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gMDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDYWxsZWQgYnkgYW4gYXBwbGljYXRpb24gdGhhdCBpcyBhZG1pbmlzdGVyaW5nIHRoZSBkZXZpY2UgdG8gc2V0IHRoZQorICAgICAqIG1pbmltdW0gbnVtYmVyIG9mIH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bXVtU3ltYm9scyhDb21wb25lbnROYW1lLCBpbnQpfQorICAgICAqIGFuZCBvbmx5IGFwcGxpZXMgd2hlbiB0aGUgcGFzc3dvcmQgcXVhbGl0eSBpcworICAgICAqIHtAbGluayAjUEFTU1dPUkRfUVVBTElUWV9DT01QTEVYfS4KKyAgICAgKgorICAgICAqIEBwYXJhbSBhZG1pbiBUaGUgbmFtZSBvZiB0aGUgYWRtaW4gY29tcG9uZW50IHRvIGNoZWNrLCBvciBudWxsIHRvCisgICAgICogICAgICAgICAgICBhZ2dyZWdhdGUgYWxsIGFkbWlucy4KKyAgICAgKiBAcmV0dXJuIFRoZSBtaW5pbXVtIG51bWJlciBvZiBzeW1ib2xzIHJlcXVpcmVkIGluIHRoZSBwYXNzd29yZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGdldFBhc3N3b3JkTWluaW11bVN5bWJvbHMoQ29tcG9uZW50TmFtZSBhZG1pbikgeworICAgICAgICBpZiAobVNlcnZpY2UgIT0gbnVsbCkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UuZ2V0UGFzc3dvcmRNaW5pbXVtU3ltYm9scyhhZG1pbik7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkZhaWxlZCB0YWxraW5nIHdpdGggZGV2aWNlIHBvbGljeSBzZXJ2aWNlIiwgZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgICAgLyoqCisgICAgICogQ2FsbGVkIGJ5IGFuIGFwcGxpY2F0aW9uIHRoYXQgaXMgYWRtaW5pc3RlcmluZyB0aGUgZGV2aWNlIHRvIHNldCB0aGUKKyAgICAgKiBtaW5pbXVtIG51bWJlciBvZiBub24tbGV0dGVyIGNoYXJhY3RlcnMgKG51bWVyaWNhbCBkaWdpdHMgb3Igc3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QogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgLyoqCiAgICAgICogQGhpZGUKICAgICAgKi8KQEAgLTU0Myw3ICs5MjYsNyBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgLyoqCiAgICAgICogQGhpZGUKICAgICAgKi8KQEAgLTU1NiwxMCArOTM5LDEwIEBACiAgICAgICAgICAgICBMb2cudyhUQUcsICJVbmFibGUgdG8gcmV0cmlldmUgZGV2aWNlIHBvbGljeSAiICsgY24sIGUpOwogICAgICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgUmVzb2x2ZUluZm8gcmkgPSBuZXcgUmVzb2x2ZUluZm8oKTsKICAgICAgICAgcmkuYWN0aXZpdHlJbmZvID0gYWk7Ci0gICAgICAgIAorCiAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICByZXR1cm4gbmV3IERldmljZUFkbWluSW5mbyhtQ29udGV4dCwgcmkpOwogICAgICAgICB9IGNhdGNoIChYbWxQdWxsUGFyc2VyRXhjZXB0aW9uIGUpIHsKQEAgLTU3MCw3ICs5NTMsNyBAQAogICAgICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICAvKioKICAgICAgKiBAaGlkZQogICAgICAqLwpAQCAtNTg3LDE2ICs5NzAsMTggQEAKICAgICAvKioKICAgICAgKiBAaGlkZQogICAgICAqLwotICAgIHB1YmxpYyB2b2lkIHNldEFjdGl2ZVBhc3N3b3JkU3RhdGUoaW50IHF1YWxpdHksIGludCBsZW5ndGgpIHsKKyAgICBwdWJsaWMgdm9pZCBzZXRBY3RpdmVQYXNzd29yZFN0YXRlKGludCBxdWFsaXR5LCBpbnQgbGVuZ3RoLCBpbnQgbGV0dGVycywgaW50IHVwcGVyY2FzZSwKKyAgICAgICAgICAgIGludCBsb3dlcmNhc2UsIGludCBudW1iZXJzLCBpbnQgc3ltYm9scywgaW50IG5vbmxldHRlcikgewogICAgICAgICBpZiAobVNlcnZpY2UgIT0gbnVsbCkgewogICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBtU2VydmljZS5zZXRBY3RpdmVQYXNzd29yZFN0YXRlKHF1YWxpdHksIGxlbmd0aCk7CisgICAgICAgICAgICAgICAgbVNlcnZpY2Uuc2V0QWN0aXZlUGFzc3dvcmRTdGF0ZShxdWFsaXR5LCBsZW5ndGgsIGxldHRlcnMsIHVwcGVyY2FzZSwgbG93ZXJjYXNlLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVtYmVycywgc3ltYm9scywgbm9ubGV0dGVyKTsKICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiRmFpbGVkIHRhbGtpbmcgd2l0aCBkZXZpY2UgcG9saWN5IHNlcnZpY2UiLCBlKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIC8qKgogICAgICAqIEBoaWRlCiAgICAgICovCkBAIC02MDksNyArOTk0LDcgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIC8qKgogICAgICAqIEBoaWRlCiAgICAgICovCmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9hcHAvYWRtaW4vSURldmljZVBvbGljeU1hbmFnZXIuYWlkbCBiL2NvcmUvamF2YS9hbmRyb2lkL2FwcC9hZG1pbi9JRGV2aWNlUG9saWN5TWFuYWdlci5haWRsCmluZGV4IDZmYzRkYzUuLjNhZGE5NWMgMTAwNjQ0Ci0tLSBhL2NvcmUvamF2YS9hbmRyb2lkL2FwcC9hZG1pbi9JRGV2aWNlUG9saWN5TWFuYWdlci5haWRsCisrKyBiL2NvcmUvamF2YS9hbmRyb2lkL2FwcC9hZG1pbi9JRGV2aWNlUG9saWN5TWFuYWdlci5haWRsCk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hbHNlIG9uIGltbWVkaWF0ZSBlcnJvciwgdHJ1ZSBvdGhlcndpc2UKKyAgICAgKiAgQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgYm9vbGVhbiBjb25uZWN0SW5wdXREZXZpY2UoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgeworICAgICAgICBpZiAoREJHKSBsb2coImNvbm5lY3RJbnB1dERldmljZSgiICsgZGV2aWNlICsgIikiKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5jb25uZWN0SW5wdXREZXZpY2UoZGV2aWNlKTsKKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIiIsIGUpOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqIEluaXRpYXRlIGRpc2Nvbm5lY3QgZnJvbSBhbiBJbnB1dCBEZXZpY2UuCisgICAgICogIFRoaXMgZnVuY3Rpb24gcmV0dXJuIGZhbHNlIG9uIGVycm9yIGFuZCB0cnVlIGlmIHRoZSBkaXNjb25uZWN0aW9uCisgICAgICogIGF0dGVtcHQgaXMgYmVpbmcgbWFkZS4KKyAgICAgKgorICAgICAqICBMaXN0ZW4gZm9yIElOUFVUX0RFVklDRV9TVEFURV9DSEFOR0VEX0FDVElPTiB0byBmaW5kIG91dCB3aGVuCisgICAgICogIGRpc2Nvbm5lY3QgaXMgY29tcGxldGVkLgorICAgICAqCisgICAgICogIEBwYXJhbSBkZXZpY2UgUmVtb3RlIEJUIGRldmljZS4KKyAgICAgKiAgQHJldHVybiBmYWxzZSBvbiBpbW1lZGlhdGUgZXJyb3IsIHRydWUgb3RoZXJ3aXNlCisgICAgICogIEBoaWRlCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gZGlzY29ubmVjdElucHV0RGV2aWNlKEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICAgICAgaWYgKERCRykgbG9nKCJkaXNjb25uZWN0SW5wdXREZXZpY2UoIiArIGRldmljZSArICIpIik7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UuZGlzY29ubmVjdElucHV0RGV2aWNlKGRldmljZSk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShUQUcsICIiLCBlKTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKiBDaGVjayBpZiBhIHNwZWNpZmllZCBJbnB1dERldmljZSBpcyBjb25uZWN0ZWQuCisgICAgICoKKyAgICAgKiAgQHBhcmFtIGRldmljZSBSZW1vdGUgQlQgZGV2aWNlLgorICAgICAqICBAcmV0dXJuIFRydWUgaWYgY29ubmVjdGVkICwgZmFsc2Ugb3RoZXJ3aXNlIGFuZCBvbiBlcnJvci4KKyAgICAgKiAgQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgYm9vbGVhbiBpc0lucHV0RGV2aWNlQ29ubmVjdGVkKEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICAgICAgaWYgKERCRykgbG9nKCJpc0lucHV0RGV2aWNlQ29ubmVjdGVkKCIgKyBkZXZpY2UgKyAiKSIpOworICAgICAgICBpbnQgc3RhdGUgPSBnZXRJbnB1dERldmljZVN0YXRlKGRldmljZSk7CisgICAgICAgIGlmIChzdGF0ZSA9PSBTVEFURV9DT05ORUNURUQpIHJldHVybiB0cnVlOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgLyoqIENoZWNrIGlmIGFueSBJbnB1dCBEZXZpY2UgaXMgY29ubmVjdGVkLgorICAgICAqCisgICAgICogQHJldHVybiBhIHVubW9kaWZpYWJsZSBzZXQgb2YgY29ubmVjdGVkIElucHV0IERldmljZXMsIG9yIG51bGwgb24gZXJyb3IuCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgU2V0PEJsdWV0b290aERldmljZT4gZ2V0Q29ubmVjdGVkSW5wdXREZXZpY2VzKCkgeworICAgICAgICBpZiAoREJHKSBsb2coImdldENvbm5lY3RlZElucHV0RGV2aWNlcygpIik7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXR1cm4gQ29sbGVjdGlvbnMudW5tb2RpZmlhYmxlU2V0KAorICAgICAgICAgICAgICAgICAgICBuZXcgSGFzaFNldDxCbHVldG9vdGhEZXZpY2U+KAorICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXlzLmFzTGlzdChtU2VydmljZS5nZXRDb25uZWN0ZWRJbnB1dERldmljZXMoKSkpKTsKKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIiIsIGUpOworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKiogR2V0IHRoZSBzdGF0ZSBvZiBhbiBJbnB1dCBEZXZpY2UuCisgICAgICoKKyAgICAgKiAgQHBhcmFtIGRldmljZSBSZW1vdGUgQlQgZGV2aWNlLgorICAgICAqICBAcmV0dXJuIFRoZSBjdXJyZW50IHN0YXRlIG9mIHRoZSBJbnB1dCBEZXZpY2UKKyAgICAgKiAgQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGdldElucHV0RGV2aWNlU3RhdGUoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgeworICAgICAgICBpZiAoREJHKSBsb2coImdldElucHV0RGV2aWNlU3RhdGUoIiArIGRldmljZSArICIpIik7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UuZ2V0SW5wdXREZXZpY2VTdGF0ZShkZXZpY2UpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiIiwgZSk7CisgICAgICAgICAgICByZXR1cm4gU1RBVEVfRElTQ09OTkVDVEVEOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0IHByaW9yaXR5IG9mIGFuIGlucHV0IGRldmljZS4KKyAgICAgKgorICAgICAqIFByaW9yaXR5IGlzIGEgbm9uLW5lZ2F0aXZlIGludGVnZXIuIFByaW9yaXR5IGNhbiB0YWtlIHRoZSBmb2xsb3dpbmcKKyAgICAgKiB2YWx1ZXM6CisgICAgICoge0BsaW5rIFBSSU9SSVRZX09OfSwge0BsaW5rIFBSSU9SSVRZX09GRn0sIHtAbGluayBQUklPUklUWV9BVVRPX0NPTk5FQ1R9CisgICAgICoKKyAgICAgKiBAcGFyYW0gZGV2aWNlIFBhaXJlZCBkZXZpY2UuCisgICAgICogQHBhcmFtIHByaW9yaXR5IEludGVnZXIgcHJpb3JpdHkKKyAgICAgKiBAcmV0dXJuIHRydWUgaWYgcHJpb3JpdHkgaXMgc2V0LCBmYWxzZSBvbiBlcnJvcgorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIHNldElucHV0RGV2aWNlUHJpb3JpdHkoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSwgaW50IHByaW9yaXR5KSB7CisgICAgICAgIGlmIChEQkcpIGxvZygic2V0SW5wdXREZXZpY2VQcmlvcml0eSgiICsgZGV2aWNlICsgIiwgIiArIHByaW9yaXR5ICsgIikiKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5zZXRJbnB1dERldmljZVByaW9yaXR5KGRldmljZSwgcHJpb3JpdHkpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiIiwgZSk7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBHZXQgdGhlIHByaW9yaXR5IGFzc29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Bc3luY1Rhc2tMb2FkZXIudGhpcy5kaXNwYXRjaE9uTG9hZENvbXBsZXRlKGRhdGEpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uQ2FuY2VsbGVkKCkgeworICAgICAgICAgICAgQXN5bmNUYXNrTG9hZGVyLnRoaXMub25DYW5jZWxsZWQocmVzdWx0KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIExvYWRUYXNrIG1UYXNrOworCisgICAgcHVibGljIEFzeW5jVGFza0xvYWRlcihDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgc3VwZXIoY29udGV4dCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogRm9yY2UgYW4gYXN5bmNocm9ub3VzIGxvYWQuIFVubGlrZSB7QGxpbmsgI3N0YXJ0TG9hZGluZygpfSB0aGlzIHdpbGwgaWdub3JlIGEgcHJldmlvdXNseQorICAgICAqIGxvYWRlZCBkYXRhIHNldCBhbmQgbG9hZCBhIG5ldyBvbmUuCisgICAgICovCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZm9yY2VMb2FkKCkgeworICAgICAgICBjYW5jZWxMb2FkKCk7CisgICAgICAgIG1UYXNrID0gbmV3IExvYWRUYXNrKCk7CisgICAgICAgIG1UYXNrLmV4ZWN1dGUoKFZvaWRbXSkgbnVsbCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQXR0ZW1wdCB0byBjYW5jZWwgdGhlIGN1cnJlbnQgbG9hZCB0YXNrLiBTZWUge0BsaW5rIEFzeW5jVGFzayNjYW5jZWwoYm9vbGVhbil9CisgICAgICogZm9yIG1vcmUgaW5mby4KKyAgICAgKgorICAgICAqIEByZXR1cm4gPHR0PmZhbHNlPC90dD4gaWYgdGhlIHRhc2sgY291bGQgbm90IGJlIGNhbmNlbGVkLAorICAgICAqICAgICAgICAgdHlwaWNhbGx5IGJlY2F1c2UgaXQgaGFzIGFscmVhZHkgY29tcG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k7CisgICAgU3RyaW5nW10gbVByb2plY3Rpb247CisgICAgU3RyaW5nIG1TZWxlY3Rpb247CisgICAgU3RyaW5nW10gbVNlbGVjdGlvbkFyZ3M7CisgICAgU3RyaW5nIG1Tb3J0T3JkZXI7CisKKyAgICAvKiBSdW5zIG9uIGEgd29ya2VyIHRocmVhZCAqLworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBDdXJzb3IgbG9hZEluQmFja2dyb3VuZCgpIHsKKyAgICAgICAgQ3Vyc29yIGN1cnNvciA9IGdldENvbnRleHQoKS5nZXRDb250ZW50UmVzb2x2ZXIoKS5xdWVyeShtVXJpLCBtUHJvamVjdGlvbiwgbVNlbGVjdGlvbiwKKyAgICAgICAgICAgICAgICBtU2VsZWN0aW9uQXJncywgbVNvcnRPcmRlcik7CisgICAgICAgIC8vIEVuc3VyZSB0aGUgY3Vyc29yIHdpbmRvdyBpcyBmaWxsZWQKKyAgICAgICAgaWYgKGN1cnNvciAhPSBudWxsKSB7CisgICAgICAgICAgICBjdXJzb3IuZ2V0Q291bnQoKTsKKyAgICAgICAgICAgIGN1cnNvci5yZWdpc3RlckNvbnRlbnRPYnNlcnZlcihtT2JzZXJ2ZXIpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBjdXJzb3I7CisgICAgfQorCisgICAgLyogUnVucyBvbiB0aGUgVUkgdGhyZWFkICovCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZGVsaXZlclJlc3VsdChDdXJzb3IgY3Vyc29yKSB7CisgICAgICAgIGlmIChtU3RvcHBlZCkgeworICAgICAgICAgICAgLy8gQW4gYXN5bmMgcXVlcnkgY2FtZSBpbiB3aGlsZSB0aGUgbG9hZGVyIGlzIHN0b3BwZWQKKyAgICAgICAgICAgIGN1cnNvci5jbG9zZSgpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIG1DdXJzb3IgPSBjdXJzb3I7CisgICAgICAgIHN1cGVyLmRlbGl2ZXJSZXN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AgIH0KKworICAgIHB1YmxpYyBVcmkgZ2V0VXJpKCkgeworICAgICAgICByZXR1cm4gbVVyaTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRVcmkoVXJpIHVyaSkgeworICAgICAgICBtVXJpID0gdXJpOworICAgIH0KKworICAgIHB1YmxpYyBTdHJpbmdbXSBnZXRQcm9qZWN0aW9uKCkgeworICAgICAgICByZXR1cm4gbVByb2plY3Rpb247CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0UHJvamVjdGlvbihTdHJpbmdbXSBwcm9qZWN0aW9uKSB7CisgICAgICAgIG1Qcm9qZWN0aW9uID0gcHJvamVjdGlvbjsKKyAgICB9CisKKyAgICBwdWJsaWMgU3RyaW5nIGdldFNlbGVjdGlvbigpIHsKKyAgICAgICAgcmV0dXJuIG1TZWxlY3Rpb247CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0U2VsZWN0aW9uKFN0cmluZyBzZWxlY3Rpb24pIHsKKyAgICAgICAgbVNlbGVjdGlvbiA9IHNlbGVjdGlvbjsKKyAgICB9CisKKyAgICBwdWJsaWMgU3RyaW5nW10gZ2V0U2VsZWN0aW9uQXJncygpIHsKKyAgICAgICAgcmV0dXJuIG1TZWxlY3Rpb25BcmdzOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFNlbGVjdGlvbkFyZ3MoU3RyaW5nW10gc2VsZWN0aW9uQXJncykgeworICAgICAgICBtU2VsZWN0aW9uQXJncyA9IHNlbGVjdGlvbkFyZ3M7CisgICAgfQorCisgICAgcHVibGljIFN0cmluZyBnZXRTb3J0T3JkZXIoKSB7CisgICAgICAgIHJldHVybiBtU29ydE9yZGVyOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFNvcnRPcmRlcihTdHJpbmcgc29ydE9yZGVyKSB7CisgICAgICAgIG1Tb3J0T3JkZXIgPSBzb3J0T3JkZXI7CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2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gICAgICAgICB3YWtlTG9jayA9IG1Qb3dlck1hbmFnZXIubmV3V2FrZUxvY2soUG93ZXJNYW5hZ2VyLlBBUlRJQUxfV0FLRV9MT0NLLCBuYW1lKTsKKyAgICAgICAgICAgICAgICB3YWtlTG9jay5zZXRSZWZlcmVuY2VDb3VudGVkKGZhbHNlKTsKKyAgICAgICAgICAgICAgICBtV2FrZUxvY2tzLnB1dCh3YWtlTG9ja0tleSwgd2FrZUxvY2spOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHdha2VMb2NrOworICAgICAgICB9CisKICAgICAgICAgcHJpdmF0ZSB2b2lkIHdhaXRVbnRpbFJlYWR5VG9SdW4oKSB7CiAgICAgICAgICAgICBDb3VudERvd25MYXRjaCBsYXRjaCA9IG1SZWFkeVRvUnVuTGF0Y2g7CiAgICAgICAgICAgICBpZiAobGF0Y2ggIT0gbnVsbCkgewpAQCAtMTQ3Nyw4ICsxNDk0LDkgQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9IGZpbmFsbHkgewogICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gaXNTeW5jSW5Qcm9ncmVzcyA9IG1BY3RpdmVTeW5jQ29udGV4dCAhPSBudWxsOwotICAgICAgICAgICAgICAgIGlmICghaXNTeW5jSW5Qcm9ncmVzcykgeworICAgICAgICAgICAgICAgIGlmICghaXNTeW5jSW5Qcm9ncmVzcyAmJiBtU3luY1dha2VMb2NrICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgbVN5bmNXYWtlTG9jay5yZWxlYXNlKCk7CisgICAgICAgICAgICAgICAgICAgIG1TeW5jV2FrZUxvY2sgPSBudWxsOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBtYW5hZ2VTeW5jTm90aWZpY2F0aW9uKCk7CiAgICAgICAgICAgICAgICAgbWFuYWdlRXJyb3JOb3RpZmljYXRpb24oKTsKQEAgLTE3MDQsNyArMTcyMiwyNiBAQAogICA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AgICAgICBnZXRDb250ZXh0KCkuZ2V0UGFja2FnZU5hbWUoKSArICIvIiArIHJlc291cmNlKTsKKyAgICAgICAgICAgICAgICBwYXJzZXIgPSBnZXRSZXNvdXJjZVhtbFB1bGxQYXJzZXIocmVzb3VyY2VVcmkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKHBhcnNlciAhPSBudWxsKSB7CisgICAgICAgICAgICBYTUxDdXJzb3IgeG1sQ3Vyc29yID0gbmV3IFhNTEN1cnNvcihzZWxlY3Rpb24sIHByb2plY3Rpb24pOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICB4bWxDdXJzb3IucGFyc2VXaXRoKHBhcnNlcik7CisgICAgICAgICAgICAgICAgcmV0dXJuIHhtbEN1cnNvcjsKKyAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cudyhMT0dfVEFHLCAiSS9PIGVycm9yIHdoaWxlIHBhcnNpbmcgWE1MICIgKyB1cmksIGUpOworICAgICAgICAgICAgfSBjYXRjaCAoWG1sUHVsbFBhcnNlckV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgTG9nLncoTE9HX1RBRywgIkVycm9yIHdoaWxlIHBhcnNpbmcgWE1MICIgKyB1cmksIGUpOworICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICBpZiAobUh0dHBDbGllbnQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtSHR0cENsaWVudC5jbG9zZSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIC8qKgorICAgICAqIENyZWF0ZXMgYW4gWG1sUHVsbFBhcnNlciBmb3IgdGhlIHByb3ZpZGVkIFVSTC4gQ2FuIGJlIG92ZXJsb2FkZWQgdG8gcHJvdmlkZSB5b3VyIG93biBwYXJzZXIuCisgICAgICogQHBhcmFtIHVybCBUaGUgVVJMIG9mIHRoZSBYTUwgZG9jdW1lbnQgdGhhdCBpcyB0byBiZSBwYXJzZWQuCisgICAgICogQHJldHVybiBBbiBYbWxQdWxsUGFyc2VyIG9uIHRoaXMgZG9jdW1lbnQuCisgICAgICovCisgICAgcHJvdGVjdGVkIFhtbFB1bGxQYXJzZXIgZ2V0VXJpWG1sUHVsbFBhcnNlcihTdHJpbmcgdXJsKSB7CisgICAgICAgIFhtbFB1bGxQYXJzZXIgcGFyc2VyID0gbnVsbDsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIFhtbFB1bGxQYXJzZXJGYWN0b3J5IGZhY3RvcnkgPSBYbWxQdWxsUGFyc2VyRmFjdG9yeS5uZXdJbnN0YW5jZSgpOworICAgICAgICAgICAgZmFjdG9yeS5zZXROYW1lc3BhY2VBd2FyZSh0cnVlKTsKKyAgICAgICAgICAgIHBhcnNlciA9IGZhY3RvcnkubmV3UHVsbFBhcnNlcigpOworICAgICAgICB9IGNhdGNoIChYbWxQdWxsUGFyc2VyRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJVbmFibGUgdG8gY3JlYXRlIFhtbFB1bGxQYXJzZXIiLCBlKTsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisKKyAgICAgICAgSW5wdXRTdHJlYW0gaW5wdXRTdHJlYW0gPSBudWxsOworICAgICAgICB0cnkgeworICAgICAgICAgICAgZmluYWwgSHR0cEdldCBnZXQgPSBuZXcgSHR0cEdldCh1cmwpOworICAgICAgICAgICAgbUh0dHBDbGllbnQgPSBBbmRyb2lkSHR0cENsaWVudC5uZXdJbnN0YW5jZSgiQW5kcm9pZCIpOworICAgICAgICAgICAgSHR0cFJlc3BvbnNlIHJlc3BvbnNlID0gbUh0dHBDbGllbnQuZXhlY3V0ZShnZXQpOworICAgICAgICAgICAgaWYgKHJlc3BvbnNlLmdldFN0YXR1c0xpbmUoKS5nZXRTdGF0dXNDb2RlKCkgPT0gSHR0cFN0YXR1cy5TQ19PSykgeworICAgICAgICAgICAgICAgIGZpbmFsIEh0dHBFbnRpdHkgZW50aXR5ID0gcmVzcG9uc2UuZ2V0RW50aXR5KCk7CisgICAgICAgICAgICAgICAgaWYgKGVudGl0eSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGlucHV0U3RyZWFtID0gZW50aXR5LmdldENvbnRlbnQoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy53KExPR19UQUcsICJFcnJvciB3aGlsZSByZXRyaWV2aW5nIFhNTCBmaWxlICIgKyB1cmwsIGUpOworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKworICAgICAgICB0cnkgeworICAgICAgICAgICAgcGFyc2VyLnNldElucHV0KGlucHV0U3RyZWFtLCBudWxsKTsKKyAgICAgICAgfSBjYXRjaCAoWG1sUHVsbFBhcnNlckV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cudyhMT0dfVEFHLCAiRXJyb3Igd2hpbGUgcmVhZGluZyBYTUwgZmlsZSBmcm9tICIgKyB1cmwsIGUpOworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gcGFyc2VyOworICAgIH0KKworICAgIC8qKgorICAgICAqIENyZWF0ZXMgYW4gWG1sUHVsbFBhcnNlciBmb3IgdGhlIHByb3ZpZGVkIGxvY2FsIHJlc291cmNlLiBDYW4gYmUgb3ZlcmxvYWRlZCB0byBwcm92aWRlIHlvdXIKKyAgICAgKiBvd24gcGFyc2VyLgorICAgICAqIEBwYXJhbSByZXNvdXJjZVVyaSBBIGZ1bGx5IHF1YWxpZmllZCByZXNvdXJjZSBuYW1lIHJlZmVyZW5jaW5nIGEgbG9jYWwgWE1MIHJlc291cmNlLgorICAgICAqIEByZXR1cm4gQW4gWG1sUHVsbFBhcnNlciBvbiB0aGlzIHJlc291cmNlLgorICAgICAqLworICAgIHByb3RlY3RlZCBYbWxQdWxsUGFyc2VyIGdldFJlc291cmNlWG1sUHVsbFBhcnNlcihVcmkgcmVzb3VyY2VVcmkpIHsKKyAgICAgICAgT3BlblJlc291cmNlSWRSZXN1bHQgcmVzb3VyY2VJZDsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJlc291cmNlSWQgPSBnZXRDb250ZXh0KCkuZ2V0Q29udGVudFJlc29sdmVyKCkuZ2V0UmVzb3VyY2VJZChyZXNvdXJjZVVyaSk7CisgICAgICAgICAgICByZXR1cm4gcmVzb3VyY2VJZC5yLmdldFhtbChyZXNvdXJjZUlkLmlkKTsKKyAgICAgICAgfSBjYXRjaCAoRmlsZU5vdEZvdW5kRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy53KExPR19UQUcsICJYTUwgcmVzb3VyY2Ugbm90IGZvdW5kOiAiICsgcmVzb3VyY2VVcmkudG9TdHJpbmcoKSwgZSk7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgInZuZC5hbmRyb2lkLmN1cnNvci5kaXIveG1sZG9jIi4KKyAgICAgKi8KKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgU3RyaW5nIGdldFR5cGUoVXJpIHVyaSkgeworICAgICAgICByZXR1cm4gInZuZC5hbmRyb2lkLmN1cnNvci5kaXIveG1sZG9jIjsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUaGlzIENvbnRlbnRQcm92aWRlciBpcyByZWFkLW9ubHkuIFRoaXMgbWV0aG9kIHRocm93cyBhbiBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbi4KKyAgICAgKiovCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIFVy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HJpdmF0ZSBTdHJpbmdbXSBtQXR0cmlidXRlTmFtZXM7CisgICAgICAgIHByaXZhdGUgU3RyaW5nW10gbUN1cnJlbnRWYWx1ZXM7CisgICAgICAgIHByaXZhdGUgQml0U2V0W10gbUFjdGl2ZVRleHREZXB0aE1hc2s7CisgICAgICAgIHByaXZhdGUgZmluYWwgaW50IG1OdW1iZXJPZlByb2plY3Rpb25zOworCisgICAgICAgIHB1YmxpYyBYTUxDdXJzb3IoU3RyaW5nIHNlbGVjdGlvbiwgU3RyaW5nW10gcHJvamVjdGlvbnMpIHsKKyAgICAgICAgICAgIHN1cGVyKHByb2plY3Rpb25zKTsKKyAgICAgICAgICAgIC8vIFRoZSBmaXJzdCBjb2x1bW4gaW4gcHJvamVjdGlvbnMgaXMgdXNlZCBmb3IgdGhlIF9JRAorICAgICAgICAgICAgbU51bWJlck9mUHJvamVjdGlvbnMgPSBwcm9qZWN0aW9ucy5sZW5ndGggLSAxOworICAgICAgICAgICAgbVNlbGVjdGlvblBhdHRlcm4gPSBjcmVhdGVQYXR0ZXJuKHNlbGVjdGlvbik7CisgICAgICAgICAgICBjcmVhdGVQcm9qZWN0aW9uUGF0dGVybihwcm9qZWN0aW9ucyk7CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIFBhdHRlcm4gY3JlYXRlUGF0dGVybihTdHJpbmcgaW5wdXQpIHsKKyAgICAgICAgICAgIFN0cmluZyBwYXR0ZXJuID0gaW5wdXQucmVwbGFjZUFsbCgiLy8iLCAiLyguKi98KSIpLnJlcGxhY2VBbGwoIl4vIiwgIl4vIikgKyAiJCI7CisgICAgICAgICAgICByZXR1cm4gUGF0dGVybi5jb21waWxlKHBhdHRlcm4pOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSB2b2lkIGNyZWF0ZVByb2plY3Rpb25QYXR0ZXJuKFN0cmluZ1tdIHByb2plY3Rpb25zKSB7CisgICAgICAgICAgICBtUHJvamVjdGlvblBhdHRlcm5zID0gbmV3IFBhdHRlcm5bbU51bWJlck9mUHJvamVjdGlvbnNdOworICAgICAgICAgICAgbUF0dHJpYnV0ZU5hbWVzID0gbmV3IFN0cmluZ1ttTnVtYmVyT2ZQcm9qZWN0aW9uc107CisgICAgICAgICAgICBtQWN0aXZlVGV4dERlcHRoTWFzayA9IG5ldyBCaXRTZXRbbU51bWJlck9mUHJvamVjdGlvbnNdOworICAgICAgICAgICAgLy8gQWRkIGEgY29sdW1uIHRvIHN0b3JlIF9JRAorICAgICAgICAgICAgbUN1cnJlbnRWYWx1ZXMgPSBuZXcgU3RyaW5nW21OdW1iZXJPZlByb2plY3Rpb25zICsgMV07CisKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxtTnVtYmVyT2ZQcm9qZWN0aW9uczsgaSsrKSB7CisgICAgICAgICAgICAgICAgbUFjdGl2ZVRleHREZXB0aE1hc2tbaV0gPSBuZXcgQml0U2V0KCk7CisgICAgICAgICAgICAgICAgU3RyaW5nIHByb2plY3Rpb24gPSBwcm9qZWN0aW9uc1tpICsgMV07IC8vICsxIHRvIHNraXAgdGhlIF9JRCBjb2x1bW4KKyAgICAgICAgICAgICAgICBpbnQgYXRJbmRleCA9IHByb2plY3Rpb24ubGFzdEluZGV4T2YoJ0AnLCBwcm9qZWN0aW9uLmxlbmd0aCgpKTsKKyAgICAgICAgICAgICAgICBpZiAoYXRJbmRleCA+PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIG1BdHRyaWJ1dGVOYW1lc1tpXSA9IHByb2plY3Rpb24uc3Vic3RyaW5nKGF0SW5kZXgrMSk7CisgICAgICAgICAgICAgICAgICAgIHByb2plY3Rpb24gPSBwcm9qZWN0aW9uLnN1YnN0cmluZygwLCBhdEluZGV4KTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBtQXR0cmlidXRlTmFtZXNbaV0gPSBudWxsOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8vIENvbmZvcm1zIHR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CBwcm9qZWN0aW9uUGF0dGVybnMgYXJlIHNlYXJjaGVkIGluIG5vZGVQYXRoLgorICAgICAgICAgICAgaW50IGN1cnJlbnROb2RlRGVwdGggPSAtMTsKKworICAgICAgICAgICAgLy8gSW5kZXggd2hlcmUgbG9jYWwgc2VsZWN0ZWQgbm9kZSBwYXRoIHN0YXJ0cyBmcm9tIGluIHBhdGgKKyAgICAgICAgICAgIGludCBjdXJyZW50Tm9kZVBhdGhTdGFydEluZGV4ID0gMDsKKworICAgICAgICAgICAgaW50IGV2ZW50VHlwZSA9IHBhcnNlci5nZXRFdmVudFR5cGUoKTsKKyAgICAgICAgICAgIHdoaWxlIChldmVudFR5cGUgIT0gWG1sUHVsbFBhcnNlci5FTkRfRE9DVU1FTlQpIHsKKworICAgICAgICAgICAgICAgIGlmIChldmVudFR5cGUgPT0gWG1sUHVsbFBhcnNlci5TVEFSVF9UQUcpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gVXBkYXRlIHBhdGgKKyAgICAgICAgICAgICAgICAgICAgcGF0aExlbmd0aFN0YWNrLnB1c2gocGF0aC5sZW5ndGgoKSk7CisgICAgICAgICAgICAgICAgICAgIHBhdGguYXBwZW5kKCcvJyk7CisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBwcmVmaXggPSBudWxsOworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gZ2V0UHJlZml4IGlzIG5vdCBzdXBwb3J0ZWQgYnkgbG9jYWwgWG1sIHJlc291cmNlIHBhcnNlcgorICAgICAgICAgICAgICAgICAgICAgICAgcHJlZml4ID0gcGFyc2VyLmdldFByZWZpeCgpOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSdW50aW1lRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHByZWZpeCA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKHByZWZpeCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBwYXRoLmFwcGVuZChwcmVmaXgpOworICAgICAgICAgICAgICAgICAgICAgICAgcGF0aC5hcHBlbmQoJzonKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBwYXRoLmFwcGVuZChwYXJzZXIuZ2V0TmFtZSgpKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudE5vZGVEZXB0aCA+PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50Tm9kZURlcHRoKys7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBBIG5vZGUgbWF0Y2hpbmcgc2VsZWN0aW9uIGlzIGZvdW5kOiBpbml0aWFsaXplIGNoaWxkIHBhcnNpbmcgbW9kZQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1TZWxlY3Rpb25QYXR0ZXJuLm1hdGNoZXIocGF0aC50b1N0cmluZygpKS5tYXRjaGVzKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50Tm9kZURlcHRoID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50Tm9kZVBhdGhTdGFydEluZGV4ID0gcGF0aC5sZW5ndGgoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ3VycmVudFZhbHVlc1swXSA9IEludGVnZXIudG9TdHJpbmcoZ2V0Q291bnQoKSk7IC8vIF9JRAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbU51bWJlck9mUHJvamVjdGlvbnM7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBSZXNldCB2YWx1ZXMgdG8gZGVmYXVsdCAoZW1wdHkgc3RyaW5nKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ3VycmVudFZhbHVlc1tpICsgMV0gPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVRleHREZXB0aE1hc2tbaV0uY2xlYXIoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAvLyBUaGlzIHRlc3QgaGFzIHRvIGJlIHNlcGFyYXRlZCBmcm9tIHRoZSBwcmV2aW91cyBvbmUgYXMgY3VycmVudE5vZGVEZXB0aCBjYW4KKyAgICAgICAgICAgICAgICAgICAgLy8gYmUgbW9kaWZpZWQgYWJvdmUgKHdoZW4gYSBub2RlIG1hdGNoaW5nIHNlbGVjdGlvbiBpcyBmb3VuZCkuCisgICAgICAgICAgICAgICAgICAgIGlmIChjdXJyZW50Tm9kZURlcHRoID49IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBsb2NhbE5vZGVQYXRoID0gcGF0aC5zdWJzdHJpbmcoY3VycmVudE5vZGVQYXRoU3RhcnRJbmRleCk7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1OdW1iZXJPZlByb2plY3Rpb25zOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobVByb2plY3Rpb25QYXR0ZXJuc1tpXS5tYXRjaGVyKGxvY2FsTm9kZVBhdGgpLm1hdGNoZXMoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgYXR0cmlidXRlID0gbUF0dHJpYnV0ZU5hbWVzW2ldOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXR0cmlidXRlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1DdXJyZW50VmFsdWVzW2kgKyAxXSA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsIGF0dHJpYnV0ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQWN0aXZlVGV4dERlcHRoTWFza1tpXS5zZXQoY3VycmVudE5vZGVEZXB0aCwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXZlbnRUeXBlID09IFhtbFB1bGxQYXJzZXIuRU5EX1RBRykgeworICAgICAgICAgICAgICAgICAgICAvLyBQb3AgbGFzdCBub2RlIGZyb20gcGF0aAorICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgbGVuZ3RoID0gcGF0aExlbmd0aFN0YWNrLnBvcCgpOworICAgICAgICAgICAgICAgICAgICBwYXRoLnNldExlbmd0aChsZW5ndGgpOworCisgICAgICAgICAgICAgICAgICAgIGlmIChjdXJyZW50Tm9kZURlcHRoID49IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXJyZW50Tm9kZURlcHRoID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBMZWF2aW5nIGEgc2VsZWN0aW9uIG1hdGNoaW5nIG5vZGU6IGFkZCBhIG5ldyByb3cgd2l0aCByZXN1bHRzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkUm93KG1DdXJyZW50VmFsdWVzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtTnVtYmVyT2ZQcm9qZWN0aW9uczsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVUZXh0RGVwdGhNYXNrW2ldLnNldChjdXJyZW50Tm9kZURlcHRoLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudE5vZGVEZXB0aC0tOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChldmVudFR5cGUgPT0gWG1sUHVsbFBhcnNlci5URVhUKSAmJiAoIXBhcnNlci5pc1doaXRlc3BhY2UoKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtTnVtYmVyT2ZQcm9qZWN0aW9uczsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGN1cnJlbnROb2RlRGVwdGggPj0gMCkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAobUFjdGl2ZVRleHREZXB0aE1hc2tbaV0uZ2V0KGN1cnJlbnROb2RlRGVwdGgpKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1DdXJyZW50VmFsdWVzW2kgKyAxXSArPSBwYXJzZXIuZ2V0VGV4dCgpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgZXZlbnRUeXBlID0gcGFyc2VyLm5leHQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KK30KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL2NvbnRlbnQvcG0vQXBwbGljYXRpb25JbmZvLmphdmEgYi9jb3JlL2phdmEvYW5kcm9pZC9jb250ZW50L3BtL0FwcGxpY2F0aW9uSW5mby5qYXZhCmluZGV4IDc5MDFiMTU1Li4zNWYyMmRjIDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm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AgICAgICB9Ci0KLSAgICAgICAgLy8gTG9uZy52YWx1ZU9mKCkgcmV0dXJucyBudWxsIHNvbWV0aW1lcyEKLS8vICAgICAgICBMb25nIHJvd2lkID0gTG9uZy52YWx1ZU9mKGdldExvbmcobVJvd0lkQ29sdW1uSW5kZXgpKTsKLSAgICAgICAgTG9uZyByb3dpZCA9IG5ldyBMb25nKGdldExvbmcobVJvd0lkQ29sdW1uSW5kZXgpKTsKLSAgICAgICAgaWYgKHJvd2lkID09IG51bGwpIHsKLSAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIm51bGwgcm93aWQuIG1Sb3dJZENvbHVtbkluZGV4ID0gIiArIG1Sb3dJZENvbHVtbkluZGV4KTsKLSAgICAgICAgfQotCi0gICAgICAgIHN5bmNocm9uaXplZChtVXBkYXRlZFJvd3MpIHsKLSAgICAgICAgICAgIE1hcDxTdHJpbmcsIE9iamVjdD4gcm93ID0gbVVwZGF0ZWRSb3dzLmdldChyb3dpZCk7Ci0gICAgICAgICAgICBpZiAocm93ID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICByb3cgPSBuZXcgSGFzaE1hcDxTdHJpbmcsIE9iamVjdD4oKTsKLSAgICAgICAgICAgICAgICBtVXBkYXRlZFJvd3MucHV0KHJvd2lkLCByb3cpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcm93LnB1dChnZXRDb2x1bW5OYW1lcygpW2NvbHVtbkluZGV4XSwgb2JqKTsKLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiB0cnVlOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIFJldHVybnMgPGNvZGU+dHJ1ZTwvY29kZT4gaWYgdGhlcmUgYXJlIHBlbmRpbmcgdXBkYXRlcyB0aGF0IGhhdmUgbm90IHlldCBiZWVuIGNvbW1pdHRlZC4KLSAgICAgKiAKLSAgICAgKiBAcmV0dXJuIDxjb2RlPnRydWU8L2NvZGU+IGlmIHRoZXJlIGFyZS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hjZXB0aW9uOwogCiAvKioKICAqIE5hdGl2ZSBpbXBsZW1lbnRhdGlvbiBvZiB0aGUgYnVsayBjdXJzb3IuIFRoaXMgaXMgb25seSBmb3IgdXNlIGluIGltcGxlbWVudGluZwpAQCAtMTIwLDI2ICsxMTcsNiBAQAogICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgICAgICBjYXNlIFVQREFURV9ST1dTX1RSQU5TQUNUSU9OOiB7Ci0gICAgICAgICAgICAgICAgICAgIGRhdGEuZW5mb3JjZUludGVyZmFjZShJQnVsa0N1cnNvci5kZXNjcmlwdG9yKTsKLSAgICAgICAgICAgICAgICAgICAgLy8gVE9ETyAtIHdoYXQgQ2xhc3NMb2FkZXIgc2hvdWxkIGJlIHBhc3NlZCB0byByZWFkSGFzaE1hcD8KLSAgICAgICAgICAgICAgICAgICAgLy8gVE9ETyAtIHN3aXRjaCB0byBCdW5kbGUKLSAgICAgICAgICAgICAgICAgICAgSGFzaE1hcDxMb25nLCBNYXA8U3RyaW5nLCBPYmplY3Q+PiB2YWx1ZXMgPSBkYXRhLnJlYWRIYXNoTWFwKG51bGwpOwotICAgICAgICAgICAgICAgICAgICBib29sZWFuIHJlc3VsdCA9IHVwZGF0ZVJvd3ModmFsdWVzKTsKLSAgICAgICAgICAgICAgICAgICAgcmVwbHkud3JpdGVOb0V4Y2VwdGlvbigpOwotICAgICAgICAgICAgICAgICAgICByZXBseS53cml0ZUludCgocmVzdWx0ID09IHRydWUgPyAxIDogMCkpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBjYXNlIERFTEVURV9ST1dfVFJBTlNBQ1RJT046IHsKLSAgICAgICAgICAgICAgICAgICAgZGF0YS5lbmZvcmNlSW50ZXJmYWNlKElCdWxrQ3Vyc29yLmRlc2NyaXB0b3IpOwotICAgICAgICAgICAgICAgICAgICBpbnQgcG9zaXRpb24gPSBkYXRhLnJlYWRJbnQoKTsKLSAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiByZXN1bHQgPSBkZWxldGVSb3cocG9zaXRpb24pOwotICAgICAgICAgICAgICAgICAgICByZXBseS53cml0ZU5vRXhjZXB0aW9uKCk7Ci0gICAgICAgICAgICAgICAgICAgIHJlcGx5LndyaXRlSW50KChyZXN1bHQgPT0gdHJ1ZSA/IDEgOiAwKSk7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICAgICAgICAgIH0KLQogICAgICAgICAgICAgICAgIGNhc2UgT05fTU9WRV9UUkFOU0FDVElPTjogewogICAgICAgICAgICAgICAgICAgICBkYXRhLmVuZm9yY2VJbnRlcmZhY2UoSUJ1bGtDdXJzb3IuZGVzY3JpcHRvcik7CiAgICAgICAgICAgICAgICAgICAgIGludCBwb3NpdGlvbiA9IGRhdGEucmVhZEludCgpOwpAQCAtMzQzLDQ4ICszMjAsNiBAQAogICAgICAgICByZXR1cm4gY291bnQ7CiAgICAgfQogCi0gICAgcHVibGljIGJvb2xlYW4gdXBkYXRlUm93cyhNYXAgdmFsdWVzKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uCi0gICAgewotICAgICAgICBQYXJjZWwgZGF0YSA9IFBhcmNlbC5vYnRhaW4oKTsKLSAgICAgICAgUGFyY2VsIHJlcGx5ID0gUGFyY2VsLm9idGFpbigpOwotCi0gICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJQnVsa0N1cnNvci5kZXNjcmlwdG9yKTsKLQotICAgICAgICBkYXRhLndyaXRlTWFwKHZhbHVlcyk7Ci0KLSAgICAgICAgbVJlbW90ZS50cmFuc2FjdChVUERBVEVfUk9XU19UUkFOU0FDVElPTiwgZGF0YSwgcmVwbHksIDApOwotCi0gICAgICAgIERhdGFiYXNlVXRpbHMucmVhZEV4Y2VwdGlvbkZyb21QYXJjZWwocmVwbHkpO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IuZGVsZXRlUm93KG1Qb3MpOwotICAgICAgICAgICAgaWYgKHJlc3VsdCAhPSBmYWxzZSkgewotICAgICAgICAgICAgICAgIC8vIFRoZSB3aW5kb3cgY29udGFpbnMgdGhlIG9sZCB2YWx1ZSwgZGlzY2FyZCBpdAotICAgICAgICAgICAgICAgIG1XaW5kb3cgPSBudWxsOwotICAgIAotICAgICAgICAgICAgICAgIC8vIEZpeCB1cCB0aGUgcG9zaXRpb24KLSAgICAgICAgICAgICAgICBtQ291bnQgPSBtQnVsa0N1cnNvci5jb3VudCgpOwotICAgICAgICAgICAgICAgIGlmIChtUG9zIDwgbUNvdW50KSB7Ci0gICAgICAgICAgICAgICAgICAgIGludCBvbGRQb3MgPSBtUG9zOwotICAgICAgICAgICAgICAgICAgICBtUG9zID0gLTE7Ci0gICAgICAgICAgICAgICAgICAgIG1vdmVUb1Bvc2l0aW9uKG9sZFBvcyk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgbVBvcyA9IG1Db3VudDsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAvLyBTZW5kIHRoZSBjaGFuZ2Ugbm90aWZpY2F0aW9uCi0gICAgICAgICAgICAgICAgb25DaGFuZ2UodHJ1ZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gcmVzdWx0OwotICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKLSAgICAgICAgICAgIExvZy5lKFRBRywgIlVuYWJsZSB0byBkZWxldGUgcm93IGJlY2F1c2UgdGhlIHJlbW90ZSBwcm9jZXNzIGlzIGRlYWQiKTsKLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgfQotICAgIH0KLQogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBTdHJpbmdbXSBnZXRDb2x1bW5OYW1lcygpIHsKICAgICAgICAgaWYgKG1Db2x1bW5zID09IG51bGwp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0ZWQgYWNyb3NzIHByb2Nlc3MgZm9yIG5vdyIsIGUpOwogICAgICAgICB9CiAgICAgICAgIG1Qcm92aWRlck5hbWUgPSBwcm92aWRlck5hbWU7Ci0gICAgICAgIG1SZWFkT25seSA9ICFhbGxvd1dyaXRlOwogCiAgICAgICAgIGNyZWF0ZUFuZFJlZ2lzdGVyT2JzZXJ2ZXJQcm94eShvYnNlcnZlcik7CiAgICAgfQpAQCAtMTk3LDMxICsxOTEsNiBAQAogICAgICAgICB9CiAgICAgfQogCi0gICAgcHVibGljIGJvb2xlYW4gdXBkYXRlUm93cyhNYXA8PyBleHRlbmRzIExvbmcsID8gZXh0ZW5kcyBNYXA8U3RyaW5nLCBPYmplY3Q+PiB2YWx1ZXMpIHsKLSAgICAgICAgaWYgKG1SZWFkT25seSkgewotICAgICAgICAgICAgTG9nLncoIkNvbnRlbnRQcm92aWRlciIsICJQZXJtaXNzaW9uIERlbmlhbDogbW9kaWZ5aW5nICIKLSAgICAgICAgICAgICAgICAgICAgKyBtUHJvdmlkZXJOYW1lCi0gICAgICAgICAgICAgICAgICAgICsgIiBmcm9tIHBpZD0iICsgQmluZGVyLmdldENhbGxpbmdQaWQoKQotICAgICAgICAgICAgICAgICAgICArICIsIHVpZD0iICsgQmluZGVyLmdldENhbGxpbmdVaWQoKSk7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIG1DdXJzb3IuY29tbWl0VXBkYXRlcyh2YWx1ZXMpOwotICAgIH0KLQotICAgIHB1YmxpYyBib29sZWFuIGRlbGV0ZVJvdyhpbnQgcG9zaXRpb24pIHsKLSAgICAgICAgaWYgKG1SZWFkT25seSkgewotICAgICAgICAgICAgTG9nLncoIkNvbnRlbnRQcm92aWRlciIsICJQZXJtaXNzaW9uIERlbmlhbDogbW9kaWZ5aW5nICIKLSAgICAgICAgICAgICAgICAgICAgKyBtUHJvdmlkZXJOYW1lCi0gICAgICAgICAgICAgICAg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ICogQGRlcHJlY2F0ZWQgdXNlIHtAbGluayAjZ2V0VHlwZShpbnQsIGludCl9IGluc3RlYWQKICAgICAgKi8KKyAgICBARGVwcmVjYXRlZAogICAgIHB1YmxpYyBib29sZWFuIGlzTnVsbChpbnQgcm93LCBpbnQgY29sKSB7Ci0gICAgICAgIGFjcXVpcmVSZWZlcmVuY2UoKTsKLSAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIHJldHVybiBpc051bGxfbmF0aXZlKHJvdyAtIG1TdGFydFBvcywgY29sKTsKLSAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgIHJlbGVhc2VSZWZlcmVuY2UoKTsKLSAgICAgICAgfQorICAgICAgICByZXR1cm4gZ2V0VHlwZShyb3csIGNvbCkgPT0gQ3Vyc29yLkZJRUxEX1RZUEVfTlVMTDsKICAgICB9CiAgICAgCi0gICAgcHJpdmF0ZSBuYXRpdmUgYm9vbGVhbiBpc051bGxfbmF0aXZlKGludCByb3csIGludCBjb2wpOwotICAgIAogICAgIC8qKgogICAgICAqIFJldHVybnMgYSBieXRlIGFycmF5IGZvciB0aGUgZ2l2ZW4gZmllbGQuCiAgICAgICoKQEAgLTI0OCwxOSArMjQzLDQzIEBACiAgICAgcHJpdmF0ZSBuYXRpdmUgYnl0ZVtdIGdldEJsb2JfbmF0aXZlKGludCByb3csIGludCBjb2wpOwogCiAgICAgLyoqCisgICAgICogUmV0dXJucyBkYXRhIHR5cGUgb2YgdGhlIGdpdmVuIGNvbHVtbidzIHZhbHVlLgorICAgICAqPHA+CisgICAgICogUmV0dXJuZWQgY29sdW1uIHR5cGVzIGFyZQorICAgICAqIDx1bD4KKyAgICAgKiAgIDxsaT57QGxpbmsgQ3Vyc29yI0ZJRUxEX1RZUEVfTlVMTH08L2xpPgorICAgICAqICAgPGxpPntAbGluayBDdXJzb3IjRklFTERfVFlQRV9JTlRFR0VSfTwvbGk+CisgICAgICogICA8bGk+e0BsaW5rIEN1cnNvciNGSUVMRF9UWVBFX0ZMT0FUfTwvbGk+CisgICAgICogICA8bGk+e0BsaW5rIEN1cnNvciNGSUVMRF9UWVBFX1NUUklOR308L2xpPgorICAgICAqICAgPGxpPntAbGluayBDdXJzb3IjRklFTERfVFlQRV9CTE9CfTwvbGk+CisgICAgICo8L3VsPgorICAgICAqPC9wPgorICAgICAqCisgICAgICogQHBhcmFtIHJvdyB0aGUgcm93IHRvIHJlYWQgZnJvbSwgcm93IC0gZ2V0U3RhcnRQb3NpdGlvbigpIGJlaW5nIHRoZSBhY3R1YWwgcm93IGluIHRoZSB3aW5kb3cKKyAgICAgKiBAcGFyYW0gY29sIHRoZSBjb2x1bW4gdG8gcmVhZCBmcm9tCisgICAgICogQHJldHVybiB0aGUgdmFsdWUgdHlwZQorICAgICAqLworICAgIHB1YmxpYyBpbnQgZ2V0VHlwZShpbnQgcm93LCBpbnQgY29sKSB7CisgICAgICAgIGFjcXVpcmVSZWZlcmVuY2UoKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJldHVybiBnZXRUeXBlX25hdGl2ZShyb3cgLSBtU3RhcnRQb3MsIGNvbCk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICByZWxlYXNlUmVmZXJlbmNlKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKICAgICAgKiBDaGVja3MgaWYgYSBmaWVsZCBjb250YWlucyBlaXRoZXIgYSBibG9iIG9yIGlzIG51bGwuCiAgICAgICoKICAgICAgKiBAcGFyYW0gcm93IHRoZSByb3cgdG8gcmVhZCBmcm9tLCByb3cgLSBnZXRTdGFydFBvc2l0aW9uKCkgYmVpbmcgdGhlIGFjdHVhbCByb3cgaW4gdGhlIHdpbmRvdwogICAgICAqIEBwYXJhbSBjb2wgdGhlIGNvbHVtbiB0byByZWFkIGZyb20KICAgICAgKiBAcmV0dXJuIHtAY29kZSB0cnVlfSBpZiBnaXZlbiBmaWVsZCBpcyB7QGNvZGUgTlVMTH0gb3IgYSBibG9iCisgICA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yBleHRlbmRzIE1hcDxTdHJpbmcsIE9iamVjdD4+IHZhbHVlcykgewotICAgICAgICByZXR1cm4gbUN1cnNvci5jb21taXRVcGRhdGVzKHZhbHVlcyk7Ci0gICAgfQotCiAgICAgcHVibGljIGludCBnZXRDb3VudCgpIHsKICAgICAgICAgcmV0dXJuIG1DdXJzb3IuZ2V0Q291bnQoKTsKICAgICB9CkBAIC03NCwxNCArNTUsNiBAQAogICAgICAgICBtQ3Vyc29yLmRlYWN0aXZhdGUoKTsKICAgICB9CiAKLSAgICAvKioKLSAgICAgKiBAaGlkZQotICAgICAqIEBkZXByZWNhdGVkCi0gICAgICovCi0gICAgcHVibGljIGJvb2xlYW4gZGVsZXRlUm93KCkgewotICAgICAgICByZXR1cm4gbUN1cnNvci5kZWxldGVSb3coKTsKLSAgICB9Ci0KICAgICBwdWJsaWMgYm9vbGVhbiBtb3ZlVG9GaXJzdCgpIHsKICAgICAgICAgcmV0dXJuIG1DdXJzb3IubW92ZVRvRmlyc3QoKTsKICAgICB9CkBAIC0xNDcsMTQgKzEyMCw2IEBACiAgICAgICAgIHJldHVybiBtQ3Vyc29yLmdldFdhbnRzQWxsT25Nb3ZlQ2FsbHMoKTsKICAgICB9CiAKLSAgICAvKioKLSAgICAgKiBAaGlkZQotICAgICAqIEBkZXByZWNhdGVkCi0gICAgICovCi0gICAgcHVibGljIGJvb2xlYW4gaGFzVXBkYXRlcygpIHsKLSAgICAgICAgcmV0dXJuIG1DdXJzb3IuaGFzVXBkYXRlcygpOwotICAgIH0KLQogICAgIHB1YmxpYyBib29sZWFuIGlzQWZ0ZXJMYXN0KCkgewogICAgICAgICByZXR1cm4gbUN1cnNvci5pc0FmdGVyTGFzdCgpOwogICAgIH0KQEAgLTE3MSw2ICsxMzYsMTAgQEAKICAgICAgICAgcmV0dXJuIG1DdXJzb3IuaXNMYXN0KCk7CiAgICAgfQogCisgICAgcHVibGljIGludCBnZXRUeXBlKGludCBjb2x1bW5JbmRleCkgeworICAgICAgICByZ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bnMgdG8gZmFpbC4KKyAgICAgICAgICAgIC8vIGJlZm9yZSB0aGF0LCBnZXQgdGhlIGF0dGFjaGVkIGRhdGFiYXNlIGxpc3QgZmlyc3QuCisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGF0dGFjaGVkRGJzID0gZGJPYmouZ2V0QXR0YWNoZWREYnMoKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFNRTGl0ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgLyogaWdub3JlICovCisgICAgICAgICAgICB9CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGRiT2JqLmNsb3NlKCk7CisgICAgICAgICAgICB9IGNhdGNoIChTUUxpdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIC8qIGlnbm9yZSAqLworICAgICAgICAgICAgfQorICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgLy8gRGVsZXRlIGFsbCBmaWxlcyBvZiB0aGlzIGNvcnJ1cHQgZGF0YWJhc2UgYW5kL29yIGF0dGFjaGVkIGRhdGFiYXNlcworICAgICAgICAgICAgaWYgKGF0dGFjaGVkRGJzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBmb3IgKFBhaXI8U3RyaW5nLCBTdHJpbmc+IHAgOiBhdHRhY2hlZERicykgeworICAgICAgICAgICAgICAgICAgICBkZWxldGVEYXRhYmFzZUZpbGUocC5zZWNvbmQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gYXR0YWNoZWREYnMgPSBudWxsIGlzIHBvc3NpYmxlIHdoZW4gdGhlIGRhdGFiYXNlIGlzIHNvIGNvcnJ1cHQgdGhhdCBldmVuCisgICAgICAgICAgICAgICAgLy8gIlBSQUdNQSBkYXRhYmFzZV9saXN0OyIgYWxzbyBmYWlscy4gZGVsZXRlIHRoZSBtYWluIGRhdGFiYXNlIGZpbGUKKyAgICAgIC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gZmluYWwgQXJyYXlMaXN0PFBvb2xPYmo+IG1Qb29sID0gbmV3IEFycmF5TGlzdDxQb29sT2JqPihtTWF4UG9vbFNpemUpOworCisgICAgLyoqIHRoZSBtYWluIGRhdGFiYXNlIGNvbm5lY3Rpb24gdG8gd2hpY2ggdGhpcyBjb25uZWN0aW9uIHBvb2wgaXMgYXR0YWNoZWQgKi8KKyAgICBwcml2YXRlIGZpbmFsIFNRTGl0ZURhdGFiYXNlIG1QYXJlbnREYk9iajsKKworICAgIC8qIHBhY2thZ2UgKi8gRGF0YWJhc2VDb25uZWN0aW9uUG9vbChTUUxpdGVEYXRhYmFzZSBkYikgeworICAgICAgICB0aGlzLm1QYXJlbnREYk9iaiA9IGRiOworICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuREVCVUcpKSB7CisgICAgICAgICAgICBMb2cuZChUQUcsICJNYXggUG9vbCBTaXplOiAiICsgbU1heFBvb2xTaXplKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIGNsb3NlIGFsbCBkYXRhYmFzZSBjb25uZWN0aW9ucyBpbiB0aGUgcG9vbCAtIGV2ZW4gaWYgdGhleSBhcmUgaW4gdXNlIQorICAgICAqLworICAgIC8qIHBhY2thZ2UgKi8gdm9pZCBjbG9zZSgpIHsKKyAgICAgICAgc3luY2hyb25pemVkKG1QYXJlbnREYk9iaikgeworICAgICAgICAgICAgZm9yIChpbnQgaSA9IG1Qb29sLnNpemUoKSAtIDE7IGkgPj0gMDsgaS0tKSB7CisgICAgICAgICAgICAgICAgbVBvb2wuZ2V0KGkpLm1EYi5jbG9zZSgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbVBvb2wuY2xlYXIoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIGdldCBhIGZyZWUgY29ubmVjdGlvbiBmcm9tIHRoZSBwb29sCisgICAgICoKKyAgICAgKiBAcGFyYW0gc3FsIGlmIG5vdCBudWxsLCB0cnkgdG8gZmluZCBhIGNvbm5lY3Rpb24gaW50aGUgcG9vbCB3aGljaCBhbHJlYWR5IGhhcyBjYWNoZWQKKyAgICAgKiB0aGUgY29tcGlsZWQgc3RhdGVtZW50IGZvciB0aGlzIHNxbC4KKyAgICAgKiBAcmV0dXJuIHRoZSBEYXRhYmFzZSBjb25uZWN0aW9uIHRoYXQgdGhlIGNhbGxlciBjYW4gdXNlCisgICAgICovCisgICAgLyogcGFja2FnZSAqLyBTUUxpdGVEYXRhYmFzZSBnZXQoU3RyaW5nIHNxbCkgeworICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuREVCVUcpKSB7CisgICAgICAgICAgICBkb0Fzc2VydHMoKTsKKyAgICAgICAgfQorCisgICAgICAgIFNRTGl0ZURhdGFiYXNlIGRiID0gbnVsbDsKKyAgICAgICAgUG9vbE9iaiBwb29sT2JqID0gbnVsbDsKKyAgICAgICAgc3luY2hyb25pemVkKG1QYXJlbnREYk9iaikgeworICAgICAgICAgICAgaWYgKGdldEZyZWVQb29sU2l6ZSgpID09IDApIHsKKyAgICAgICAgICAgICAgICBpZiAobU1heFBvb2xTaXplID09IG1Qb29sLnNpemUoKSkgeworICAgICAgICAgICAgICAgICAgICAvLyBtYXhlZCBvdXQuIGNhbid0IG9wZW4gYW55IG1vcmUgY29ubmVjdGlvbnMuCisgICAgICAgICAgICAgICAgICAgIC8vIGxldCB0aGUgY2FsbGVyIHdhaXQgb24gb25lIG9mIHRoZSBwb29sZWQgY29ubmVjdGlvbnMKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1NYXhQb29sU2l6ZSA9PSAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBwb29sT2JqID0gbVBvb2wuZ2V0KDApOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gZ2V0IGEgcmFuZG9tIG51bWJlciBiZXR3ZWVuIDAgYW5kIChtTWF4UG9vbFNpemUtMSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvb2xPYmogPSBtUG9vbC5nZXQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBSYW5kb20oU3lzdGVtQ2xvY2suZWxhcHNlZFJlYWx0aW1lKCkpLm5leHRJbnQobU1heFBvb2xTaXplLTEpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBkYiA9IHBvb2xPYmoubURiOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIC8vIGNyZWF0ZSBhIG5ldyBjb25uZWN0aW9uIGFuZCBhZGQgaXQgdG8gdGhlIHBvb2wsIHNpbmNlIHdlIGhhdmVuJ3QgcmVhY2hlZAorICAgICAgICAgICAgICAgICAgICAvLyBtYXggcG9vbCBzaXplIGFsbG93ZWQKKyAgICAgICAgICAgICAgICAgICAgaW50IHBvb2xTaXplID0gZ2V0UG9vbFNpemUoKTsKKyAgICAgICAgICAgICAgICAgICAgZGIgPSBtUGFyZW50RGJPYmouY3JlYXRlUG9vbENvbm5lY3Rpb24oKHNob3J0KShwb29sU2l6ZSArIDEpKTsKKyAgICAgICAgICAgICAgICAgICAgcG9vbE9iaiA9IG5ldyBQb29sT2JqKGRiKTsKKyAgICAgICAgICAgICAgICAgICAgbVBvb2wuYWRkKHBvb2xTaXplLCBwb29sT2JqKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIC8vIHRoZXJlIGFyZSBmcmVlIGNvbm5lY3Rpb25zIGF2YWlsYWJsZS4gcGljayBvbmUKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gbVBvb2wuc2l6ZSgpIC0gMTsgaSA+PSAwOyBpLS0pIHsKKyAgICAgICAgICAgICAgICAgICAgcG9vbE9iaiA9IG1Qb29sLmdldChpKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFwb29sT2JqLmlzRnJlZSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvLyBpdCBpcyBmcmVlIC0gYnV0IGRvZXMgaXRzIGRhdGFiYXNlIG9iamVjdCBhbHJlYWR5IGhhdmUgdGhlIGdpdmVuIHNxbCBpbiBpdHMKKyAgICAgICAgICAgICAgICAgICAgLy8gc3RhdGVtZW50LWNhY2hlPworICAgICAgICAgICAgICAgICAgICBkYiA9IHBvb2xPYmoubURiOworICAgICAgICAgICAgICAgICAgICBpZiAoc3FsID09IG51bGwgfHwgZGIuaXNTcWxJblN0YXRlbWVudENhY2hlKHNxbCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZvdW5kIGEgZnJlZSBjb25uZWN0aW9uIHdlIGNhbiB1c2UKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8vIGhhdmVuJ3QgZm91bmQgYSBkYXRhYmFzZSBvYmplY3Qgd2hpY2ggaGFzIHRoZSBnaXZlbiBzcWwgaW4gaXRzCisgICAgICAgICAgICAgICAgICAgIC8vIHN0YXRlbWVudC1jYWNoZQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYXNzZXJ0IHBvb2xPYmogIT0gbnVsbDsKKyAgICAgICAgICAgIGFzc2VydCBwb29sT2JqLm1EYiA9PSBkYjsKKworICAgICAgICAgICAgcG9vbE9iai5hY3F1aXJlKCk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuREVCVUcpKSB7CisgICAgICAgICAgICBMb2cuZChUQUcsICJFTkQgZ2V0LWNvbm5lY3Rpb246ICIgKyB0b1N0cmluZygpICsgcG9vbE9iai50b1N0cmluZygpKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZGI7CisgICAgICAgIC8vIFRPRE8gaWYgYSB0aHJlYWQgYWNxdWlyZXMgYSBjb25uZWN0aW9uIGFuZCBkaWVzIHdpdGhvdXQgcmVsZWFzaW5nIHRoZSBjb25uZWN0aW9uLCB0aGVuCisgICAgICAgIC8vIHRoZXJlIGNvdWxkIGJlIGEgY29ubmVjdGlvbiBsZWFrLgorICAgIH0KKworICAgIC8qKgorICAgICAqIHJlbGVhc2UgdGhlIGdpdmVuIGRhdGFiYXNlIGNvbm5lY3Rpb24gYmFjayB0byB0aGUgcG9vbC4KKyAgICAgKiBAcGFyYW0gZGIgdGhlIGNvbm5lY3Rpb24gdG8gYmUgcmVsZWFzZWQKKyAgICAgKi8KKyAgICAvKiBwYWNrYWdlICovIHZvaWQgcmVsZWFzZShTUUxpdGVEYXRhYmFzZSBkYikgeworICAgICAgICBQb29sT2JqIHBvb2xPYmo7CisgICAgICAgIHN5bmNocm9uaXplZChtUGFyZW50RGJPYmopIHsKKyAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5ERUJVRykpIHsKKyAgICAgICAgICAgICAgICBhc3NlcnQgZGIubUNvbm5lY3Rpb25OdW0gPiAwOworICAgICAgICAgICAgICAgIGRvQXNzZXJ0cygpOworICAgICAgICAgICAgICAgIGFzc2VydCBtUG9vbC5nZXQoZGIubUNvbm5lY3Rpb25OdW0gLSAxKS5tRGIgPT0gZGI7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHBvb2xPYmogPSBtUG9vbC5nZXQoZGIubUNvbm5lY3Rpb25OdW0gLSAxKTsKKworICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLkRFQlVHKSkgeworICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIkJFR0lOIHJlbGVhc2UtY29ubjogIiArIHRvU3RyaW5nKCkgKyBwb29sT2JqLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAocG9vbE9iai5pc0ZyZWUoKSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIlJlbGVhc2luZyBvYmplY3QgYWxyZWFkeSBmcmVlZDogIiArCisgICAgICAgICAgICAgICAgICAgICAgICBkYi5tQ29ubmVjdGlvbk51bSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHBvb2xPYmoucmVsZWFzZSgpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLkRFQlVHKSkgeworICAgICAgICAgICAgTG9nLmQoVEFHLCAiRU5EIHJlbGVhc2UtY29ubjogIiArIHRvU3RyaW5nKCkgKyBwb29sT2JqLnRvU3RyaW5nKCkpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyBhIGxpc3Qgb2YgYWxsIGRhdGFiYXNlIGNvbm5lY3Rpb25zIGluIHRoZSBwb29sIChib3RoIGZyZWUgYW5kIGJ1c3kgY29ubmVjdGlvbnMpLgorICAgICAqIFRoaXMgbWV0aG9kIGlzIHVzZWQgd2hlbiAiYWRiIGJ1Z3JlcG9ydCIgaXMgZG9uZS4KKyAgICAgKi8KKyAgICAvKiBwYWNrYWdlICovIEFycmF5TGlzdDxTUUxpdGVEYXRhYmFzZT4gZ2V0Q29ubmVjdGlvbkxpc3QoKSB7CisgICAgICAgIEFycmF5TGlzdDxTUUxpdGVEYXRhYmFzZT4gbGlzdCA9IG5ldyBBcnJheUxpc3Q8U1FMaXRlRGF0YWJhc2U+KCk7CisgICAgICAgIHN5bmNocm9uaXplZChtUGFyZW50RGJPYmopIHsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSBtUG9vbC5zaXplKCkgLSAxOyBpID49IDA7IGktLSkgeworICAgICAgICAgICAgICAgIGxpc3QuYWRkKG1Qb29sLmdldChpKS5tRGIpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBsaXN0OworICAgIH0KKworICAgIC8qIHBhY2thZ2UgKi8gaW50IGdldFBvb2xTaXplKCkgeworICAgICAgICBzeW5jaHJvbml6ZWQobVBhcmVudERiT2JqKSB7CisgICAgICAgICAgICByZXR1cm4gbVBvb2wuc2l6ZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBpbnQgZ2V0RnJlZVBvb2xTaXplKCkgeworICAgICAgICBpbnQgY291bnQgPSAwOworICAgICAgICBmb3IgKGludCBpID0gbVBvb2wuc2l6ZSgpIC0gMTsgaSA+PSAwOyBpLS0pIHsKKyAgICAgICAgICAgIGlmIChtUG9vbC5nZXQoaSkuaXNGcmVlKCkpIHsKKyAgICAgICAgICAgICAgICBjb3VudCsrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBjb3VudCsrOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CisgICAgICAgIHJldHVybiAiZGI6ICIgKyBtUGFyZW50RGJPYmouZ2V0UGF0aCgpICsKKyAgICAgICAgICAgICAgICAiLCB0aHJlYWRpZCA9ICIgKyBUaHJlYWQuY3VycmVudFRocmVhZCgpLmdldElkKCkgKworICAgICAgICAgICAgICAgICIsIHRvdGFsc2l6ZSA9ICIgKyBtUG9vbC5zaXplKCkgKyAiLCAjZnJlZSA9ICIgKyBnZXRGcmVlUG9vbFNpemUoKSArCisgICAgICAgICAgICAgICAgIiwgbWF4cG9vbHNpemUgPSAiICsgbU1heFBvb2xTaXplOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBkb0Fzc2VydHMoKSB7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbVBvb2wuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgIG1Qb29sLmdldChpKS52ZXJpZnkoKTsKKyAgICAgICAgICAgIGFzc2VydCBtUG9vbC5nZXQoaSkubURiLm1Db25uZWN0aW9uTnVtID09IChpICsgMSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKiBwYWNrYWdlICovIHZvaWQgc2V0TWF4UG9vbFNpemUoaW50IHNpemUpIHsKKyAgICAgICAgc3luY2hyb25pemVkKG1QYXJlbnREYk9iaikgeworICAgICAgICAgICAgbU1heFBvb2xTaXplID0gc2l6ZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qIHBhY2thZ2UgKi8gaW50IGdldE1heFBvb2xTaXplKCkgeworICAgICAgICBzeW5jaHJvbml6ZWQobVBhcmVudERiT2JqKSB7CisgICAgICAgICAgICByZXR1cm4gbU1heFBvb2xTaXplOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogcmVwcmVzZW50cyBvYmplY3RzIGluIHRoZSBjb25uZWN0aW9uIHBvb2wuCisgICAgICovCisgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgUG9vbE9iaiB7CisKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBTUUxpdGVEYXRhYmFzZSBtRGI7CisgICAgICAgIHByaXZhdGUgYm9vbGVhbiBtRnJlZUJ1c3lGbGFnID0gRlJFRTsKKyAgICAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgYm9vbGVhbiBGUkVFID0gdHJ1ZTsKKyAgICAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgYm9vbGVhbiBCVVNZID0gZmFsc2U7CisKKyAgICAgICAgLyoqIHRoZSBudW1iZXIgb2YgdGhyZWFkcyBob2xkaW5nIHRoaXMgY29ubmVjdGlvbiAqLworICAgICAgICAvLyBAR3VhcmRlZEJ5KCJ0aGlzIikKKyAgICAgICAgcHJpdmF0ZSBpbnQgbU51bUhvbGRlcnMgPSAwOworCisgICAgICAgIC8qKiBjb250YWlucyB0aGUgdGhyZWFkSWRzIG9mIHRoZSB0aHJlYWRzIGhvbGRpbmcgdGhpcyBjb25uZWN0aW9uLgorICAgICAgICAgKiB1c2VkIGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMgb25seS4KKyAgICAgICAgICovCisgICAgICAgIC8vIEBHdWFyZGVkQnkoInRoaXMiKQorICAgICAgICBwcml2YXRlIEhhc2hTZXQ8TG9uZz4gbUhvbGRlcklkcyA9IG5ldyBIYXNoU2V0PExvbmc+KCk7CisKKyAgICAgICAgcHVibGljIFBvb2xPYmooU1FMaXRlRGF0YWJhc2UgZGIpIHsKKyAgICAgICAgICAgIG1EYiA9IGRiOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgdm9pZCBhY3F1aXJlKCkgeworICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLkRFQlVHKSkgeworICAgICAgICAgICAgICAgIGFzc2VydCBpc0ZyZWUoKTsKKyAgICAgICAgICAgICAgICBsb25nIGlkID0gVGhyZWFkLmN1cnJlbnRUaHJlYWQoKS5nZXRJZCgpOworICAgICAgICAgICAgICAgIGFzc2VydCAhbUhvbGRlcklkcy5jb250YWlucyhpZCk7CisgICAgICAgICAgICAgICAgbUhvbGRlcklkcy5hZGQoaWQpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtTnVtSG9sZGVycysrOworICAgICAgICAgICAgbUZyZWVCdXN5RmxhZyA9IEJVU1k7CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIHN5bmNocm9uaXplZCB2b2lkIHJlbGVhc2UoKSB7CisgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuREVCVUcpKSB7CisgICAgICAgICAgICAgICAgbG9uZyBpZCA9IFRocmVhZC5jdXJyZW50VGhyZWFkKCkuZ2V0SWQoKTsKKyAgICAgICAgICAgICAgICBhc3NlcnQgbUhvbGRlcklkcy5zaXplKCkgPT0gbU51bUhvbGRlcnM7CisgICAgICAgICAgICAgICAgYXNzZXJ0IG1Ib2xkZXJJZHMuY29udGFpbnMoaWQpOworICAgICAgICAgICAgICAgIG1Ib2xkZXJJZHMucmVtb3ZlKGlkKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbU51bUhvbGRlcnMtLTsKKyAgICAgICAgICAgIGlmIChtTnVtSG9sZGVycyA9PSAwKSB7CisgICAgICAgICAgICAgICAgbUZyZWVCdXN5RmxhZyA9IEZSRUU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIHN5bmNocm9uaXplZCBib29sZWFuIGlzRnJlZSgpIHsKKyAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5ERUJVRykpIHsKKyAgICAgICAgICAgICAgICB2ZXJpZnkoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiAobUZyZWVCdXN5RmxhZyA9PSBGUkVFKTsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgc3luY2hyb25pemVkIHZvaWQgdmVyaWZ5KCkgeworICAgICAgICAgICAgaWYgKG1GcmVlQnVzeUZsYWcgPT0gRlJFRSkgeworICAgICAgICAgICAgICAgIGFzc2VydCBtTnVtSG9sZGVycyA9PSAwOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBhc3NlcnQgbU51bUhvbGRlcnMgPiAwOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CisgICAgICAgICAgICBTdHJpbmdCdWlsZGVyIGJ1ZmYgPSBuZXcgU3RyaW5nQnVpbGRlcigpOworICAgICAgICAgICAgYnVmZi5hcHBlbmQoIiwgY29ubiAjICIpOworICAgICAgICAgICAgYnVmZi5hcHBlbmQobURiLm1Db25uZWN0aW9uTnVtKTsKKyAgICAgICAgICAgIGJ1ZmYuYXBwZW5kKCIsIG1Db3VudEhvbGRlcnMgPSAiKTsKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCh0aGlzKSB7CisgICAgICAgICAgICAgICAgYnVmZi5hcHBlbmQobU51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2UgIiArIG1EYXRhYmFzZS5nZXRQYXRoKCkgKyAiIGFscmVhZHkgY2xvc2VkIik7Ci0gICAgICAgIH0KKyAgICAgICAgbURhdGFiYXNlLnZlcmlmeUxvY2tPd25lcigpOwogICAgICAgICAvLyBPbmx5IGNvbXBpbGUgaWYgd2UgZG9uJ3QgaGF2ZSBhIHZhbGlkIHN0YXRlbWVudCBhbHJlYWR5IG9yIHRoZSBjYWxsZXIgaGFzCiAgICAgICAgIC8vIGV4cGxpY2l0bHkgcmVxdWVzdGVkIGEgcmVjb21waWxlLgogICAgICAgICBpZiAoZm9yY2VDb21waWxhdGlvbikgewotICAgICAgICAgICAgbURhdGFiYXNlLmxvY2soKTsKLSAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgLy8gTm90ZSB0aGF0IHRoZSBuYXRpdmVfY29tcGlsZSgpIHRha2VzIGNhcmUgb2YgZGVzdHJveWluZyBhbnkgcHJldmlvdXNseQotICAgICAgICAgICAgICAgIC8vIGV4aXN0aW5nIHByb2dyYW1zIGJlZm9yZSBpdCBjb21waWxlcy4KLSAgICAgICAgICAgICAgICBuYXRpdmVfY29tcGlsZShzcWwpOwotICAgICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgICAgICBtRGF0YWJhc2UudW5sb2NrKCk7Ci0gICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBOb3RlIHRoYXQgdGhlIG5hdGl2ZV9jb21waWxlKCkgdGFrZXMgY2FyZSBvZiBkZXN0cm95aW5nIGFueSBwcmV2aW91c2x5CisgICAgICAgICAgICAvLyBleGlzdGluZyBwcm9ncmFtcyBiZWZvcmUgaXQgY29tcGlsZXMuCisgICAgICAgICAgICBuYXRpdmVfY29tcGlsZShzcWwpOwogICAgICAgICB9CiAgICAgfQogCkBAIC0xMDIsMTMgKzk1LDggQEAKICAgICAgICAgICAgIGlmIChTUUxpdGVEZWJ1Zy5ERUJVR19BQ1RJVkVfQ1VSU09SX0ZJTkFMSVpBVElPTikgewogICAgICAgICAgICAgICAgIExvZy52KFRBRywgImNsb3NlZCBhbmQgZGVhbGxvY2F0ZWQgRGJPYmogKGlkIyIgKyBuU3RhdGVtZW50ICsiKSIpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBtRGF0YWJhc2UubG9jaygpOwotICAgICAgICAgICAgICAgIG5hdGl2ZV9maW5hbGl6ZSgpOwotICAgICAgICAgICAgICAgIG5TdGF0ZW1lbnQgPSAwOwotICAgICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgICAgICBtRGF0YWJhc2UudW5sb2NrKCk7Ci0gICAgICAgICAgICB9CisgICAgICAgICAgICBtRGF0YWJhc2UuZmluYWxpemVTdGF0ZW1lbnRMYXRlcihuU3RhdGVtZW50KTsKKyAgICAgICAgICAgIG5TdGF0ZW1lbnQgPSAwOwogICAgICAgICB9CiAgICAgfQogCkBAIC0xMzQsNiArMTIyLDEwIEBACiAgICAgICAgIG1JblVzZSA9IGZhbHNlOwogICAgIH0KIAorICAgIC8qIHBhY2thZ2UgKi8gc3luY2hyb25pemVkIGJvb2xlYW4gaXNJblVzZSgpIHsKKyAgICAgICAgcmV0dXJuIG1JblVzZTsKKyAgICB9CisKICAgICAvKioKICAgICAgKiBNYWtlIHN1cmUgdGhhdCB0aGUgbmF0aXZlIHJlc291cmNlIGlzIGNsZWFuZWQgdXAuCiAgICAgICovCkBAIC0xNjIsNSArMTU0LDQgQEAKICAgICAgKiBAcGFyYW0gc3FsIFRoZSBTUUwgdG8gY29tcGlsZS4KICAgICAgKi8KICAgICBwcml2YXRlIGZpbmFsIG5hdGl2ZSB2b2lkIG5hdGl2ZV9jb21waWxlKFN0cmluZyBzcWwpOwotICAgIHByaXZhdGUgZmluYWwgbmF0aXZlIHZvaWQgbmF0aXZlX2ZpbmFsaXplKCk7CiB9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9kYXRhYmFzZS9zcW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24gZSkgewotICAgICAgICAgICAgICAgIHN1Y2Nlc3MgPSBmYWxzZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaW50IHBvcyA9IG1Qb3M7Ci0gICAgICAgICAgICByZXF1ZXJ5KCk7Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBFbnN1cmUgcHJvcGVyIGN1cnNvciBzdGF0ZS4gTm90ZSB0aGF0IG1DdXJyZW50Um93SUQgY2hhbmdlcwotICAgICAgICAgICAgICogaW4gdGhpcyBjYWxsLgotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBtb3ZlVG9Qb3NpdGlvbihwb3MpOwotICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgbURhdGFiYXNlLnVubG9jaygpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKHN1Y2Nlc3MpIHsKLSAgICAgICAgICAgIG9uQ2hhbmdlKHRydWUpOwotICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLSAgICB9Ci0KICAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgU3RyaW5nW10gZ2V0Q29sdW1uTmFtZXMoKSB7CiAgICAgICAgIHJldHVybiBtQ29sdW1uczsKICAgICB9CiAKLSAgICAvKioKLSAgICAgKiBAaGlkZQotICAgICAqIEBkZXByZWNhdGVkCi0gICAgICovCi0gICAgQE92ZXJyaWRlCi0gICAgcHVibGljIGJvb2xlYW4gc3VwcG9ydHNVcGRhdGVzKCkgewotICAgICAgICByZXR1cm4gc3VwZXIuc3VwcG9ydHNVcGRhdGVzKCkgJiYgIVRleHRVdGlscy5pc0VtcHR5KG1FZGl0VGFibGUpOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIEBoaWRlCi0gICAgICogQGRlcHJlY2F0ZWQKLSAgICAgKi8KLSAgICBAT3ZlcnJpZGUKLSAgICBwdWJsa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HJldmVudHMgdXMgZnJvbSBjaGFuZ2luZyB0aGUKLSAgICAgICAgICAgICAqIGRhdGFiYXNlIGJlaGluZCB0aGUgYmFjayBvZiBhbm90aGVyIHRocmVhZC4KLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgbURhdGFiYXNlLmJlZ2luVHJhbnNhY3Rpb24oKTsKLSAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgU3RyaW5nQnVpbGRlciBzcWwgPSBuZXcgU3RyaW5nQnVpbGRlcigxMjgpOwotCi0gICAgICAgICAgICAgICAgLy8gRm9yIGVhY2ggcm93IHRoYXQgaGFzIGJlZW4gdXBkYXRlZAotICAgICAgICAgICAgICAgIGZvciAoTWFwLkVudHJ5PExvbmcsIE1hcDxTdHJpbmcsIE9iamVjdD4+IHJvd0VudHJ5IDoKLSAgICAgICAgICAgICAgICAgICAgICAgIG1VcGRhdGVkUm93cy5lbnRyeVNldCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgIE1hcDxTdHJpbmcsIE9iamVjdD4gdmFsdWVzID0gcm93RW50cnkuZ2V0VmFsdWUoKTsKLSAgICAgICAgICAgICAgICAgICAgTG9uZyByb3dJZE9iaiA9IHJvd0VudHJ5LmdldEtleSgpOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChyb3dJZE9iaiA9PSBudWxsIHx8IHZhbHVlcyA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJudWxsIHJvd0lkIG9yIHZhbHVlcyBmb3VuZCEgcm93SWQgPSAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgcm93SWRPYmogKyAiLCB2YWx1ZXMgPSAiICsgdmFsdWVzKTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZXMuc2l6ZSgpID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgbG9uZyByb3dJZCA9IHJvd0lkT2JqLmxvbmdWYWx1ZSgpOwotCi0gICAgICAgICAgICAgICAgICAgIEl0ZXJhdG9yPE1hcC5FbnRyeTxTdHJpbmcsIE9iamVjdD4+IHZhbHVlc0l0ZXIgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlcy5lbnRyeVNldCgpLml0ZXJhdG9yKCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgc3FsLnNldExlbmd0aCgwKTsKLSAgICAgICAgICAgICAgICAgICAgc3FsLmFwcGVuZCgiVVBEQVRFICIgKyBtRWRpdFRhYmxlICsgIiBTRVQgIik7Ci0KLSAgICAgICAgICAgICAgICAgICAgLy8gRm9yIGVhY2ggY29sdW1uIHZhbHVlIHRoYXQgaGFzIGJlZW4gdXBkYXRlZAotICAgICAgICAgICAgICAgICAgICBPYmplY3RbXSBiaW5kaW5ncyA9IG5ldyBPYmplY3RbdmFsdWVzLnNpemUoKV07Ci0gICAgICAgICAgICAgICAgICAgIGludCBpID0gMDsKLSAgICAgICAgICAgICAgICAgICAgd2hpbGUgKHZhbHVlc0l0ZXIuaGFzTmV4dCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBNYXAuRW50cnk8U3RyaW5nLCBPYmplY3Q+IGVudHJ5ID0gdmFsdWVzSXRlci5uZXh0KCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzcWwuYXBwZW5kKGVudHJ5LmdldEtleSgpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNxbC5hcHBlbmQoIj0/Iik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBiaW5kaW5nc1tpXSA9IGVudHJ5LmdldFZhbHVlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWVzSXRlci5oYXNOZXh0KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcWwuYXBwZW5kKCIsICIpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgaSsrOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgc3FsLmFwcGVuZCgiIFdIRVJFICIgKyBtQ29sdW1uc1ttUm93SWRDb2x1bW5JbmRleF0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICArICc9JyArIHJvd0lkKTsKLSAgICAgICAgICAgICAgICAgICAgc3FsLmFwcGVuZCgnOycpOwotICAgICAgICAgICAgICAgICAgICBtRGF0YWJhc2UuZXhlY1NRTChzcWwudG9TdHJpbmcoKSwgYmluZGluZ3MpOwotICAgICAgICAgICAgICAgICAgICBtRGF0YWJhc2Uucm93VXBkYXRlZChtRWRpdFRhYmxlLCByb3dJZCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1EYXRhYmFzZS5zZXRUcmFuc2FjdGlvblN1Y2Nlc3NmdWwoKTsKLSAgICAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICAgICAgbURhdGFiYXNlLmVuZFRyYW5zYWN0aW9uKCk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1VcGRhdGVkUm93cy5jbGVhcigpOwotICAgICAgICB9Ci0KLSAgICAgICAgLy8gTGV0IGFueSBjaGFuZ2Ugb2JzZXJ2ZXJzIGtub3cgYWJvdXQgdGhlIHVwZGF0ZQotICAgICAgICBvbkNoYW5nZSh0cnVlKTsKLQotICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICB9Ci0KICAgICBwcml2YXRlIHZvaWQgZGVhY3RpdmF0ZUNvbW1vbigpIHsKICAgICAgICAgaWYgKENvbmZpZy5MT0dWKSBMb2cudihUQUcsICI8PDwgUmVsZWFzaW5nIGN1cnNvciAiICsgdGhpcyk7CiAgICAgICAgIG1DdXJzb3JTdGF0ZSA9IDA7CkBAIC01MDYsMTEgKzM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dGhlIGNhbGxlciBtdXN0IGJlIHRyeWluZyB0byBhZGQgYSBqdXN0LWNvbXBpbGVkIHN0bXQKKyAgICAgICAgICAgICAgICAvLyB0byBjYWNoZTsgaS5lLiwgY2FsbGVyIHNob3VsZCBhbHJlYWR5IGhhdmUgYWNxdWlyZWQgZGF0YWJhc2UgbG9jayBBTkQKKyAgICAgICAgICAgICAgICAvLyB0aGUgbG9jayBvbiBtQ29tcGlsZWRRdWVyaWVzLiBkbyBhcyBhc3NlcnQgb2YgdGhlc2UgdHdvIDIgZmFjdHMuCisgICAgICAgICAgICAgICAgdmVyaWZ5TG9ja093bmVyKCk7CisgICAgICAgICAgICAgICAgaWYgKHRoaXMuc2l6ZSgpIDw9IG1NYXhTcWxDYWNoZVNpemUpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gY2FjaGUgaXMgbm90IGZ1bGwuIG5vdGhpbmcgbmVlZHMgdG8gYmUgcmVtb3ZlZAorICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8vIGNhY2hlIGlzIGZ1bGwuIGVsZGVzdCB3aWxsIGJlIHJlbW92ZWQuCisgICAgICAgICAgICAgICAgU1FMaXRlQ29tcGlsZWRTcWwgZW50cnkgPSBlbGRlc3QuZ2V0VmFsdWUoKTsKKyAgICAgICAgICAgICAgICBpZiAoIWVudHJ5LmlzSW5Vc2UoKSkgeworICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIHtAbGluayBTUUxpdGVDb21waWxlZFNxbH0gaXMgbm90IGluIHVzZS4gcmVsZWFzZSBpdC4KKyAgICAgICAgICAgICAgICAgICAgZW50cnkucmVsZWFzZVNxbFN0YXRlbWVudCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvLyByZXR1cm4gdHJ1ZSwgc28gdGhhdCB0aGlzIGVudHJ5IGlzIHJlbW92ZWQgYXV0b21hdGljYWxseSBieSB0aGUgY2Fsb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YW5zYWN0aW9ucyB3aWxsIGJlIGNvbW1pdHRlZCBvciByb2xsZWQgYmFjay4gVGhlCisgICAgICogY2hhbmdlcyB3aWxsIGJlIHJvbGxlZCBiYWNrIGlmIGFueSB0cmFuc2FjdGlvbiBpcyBlbmRlZCB3aXRob3V0IGJlaW5nCisgICAgICogbWFya2VkIGFzIGNsZWFuIChieSBjYWxsaW5nIHNldFRyYW5zYWN0aW9uU3VjY2Vzc2Z1bCkuIE90aGVyd2lzZSB0aGV5CisgICAgICogd2lsbCBiZSBjb21taXR0ZWQuCisgICAgICogPHA+CisgICAgICogSGVyZSBpcyB0aGUgc3RhbmRhcmQgaWRpb20gZm9yIHRyYW5zYWN0aW9uczoKKyAgICAgKgorICAgICAqIDxwcmU+CisgICAgICogICBkYi5iZWdpblRyYW5zYWN0aW9uV2l0aExpc3RlbmVyTm9uRXhjbHVzaXZlKGxpc3RlbmVyKTsKKyAgICAgKiAgIHRyeSB7CisgICAgICogICAgIC4uLgorICAgICAqICAgICBkYi5zZXRUcmFuc2FjdGlvblN1Y2Nlc3NmdWwoKTsKKyAgICAgKiAgIH0gZmluYWxseSB7CisgICAgICogICAgIGRiLmVuZFRyYW5zYWN0aW9uKCk7CisgICAgICogICB9CisgICAgICogPC9wcmU+CisgICAgICoKKyAgICAgKiBAcGFyYW0gdHJhbnNhY3Rpb25MaXN0ZW5lciBsaXN0ZW5lciB0aGF0IHNob3VsZCBiZSBub3RpZmllZCB3aGVuIHRoZQorICAgICAqICAgICAgICAgICAgdHJhbnNhY3Rpb24gYmVnaW5zLCBjb21taXRzLCBvciBpcyByb2xsZWQgYmFjaywgZWl0aGVyCisgICAgICogICAgICAgICAgICBleHBsaWNpdGx5IG9yIGJ5IGEgY2FsbCB0byB7QGxpbmsgI3lpZWxkSWZDb250ZW5kZWRTYWZlbHl9LgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGJlZ2luVHJhbnNhY3Rpb25XaXRoTGlzdGVuZXJOb25FeGNsdXNpdmUoC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YXZlIHRvIHRha2UgY2FyZSBvZiBjaGVja3BvaW50LgorICAgICAgICAgICAgICAgIC8vIFRPRE86IHNob3VsZCBhcHBsaWNhdGlvbnMgYmUgZ2l2ZW4gdGhlIGZsZXhpYmlsaXR5IG9mIGNob29zaW5nIHdoZW4gdG8KKyAgICAgICAgICAgICAgICAvLyB0cmlnZ2VyIGNoZWNrcG9pbnQ/CisgICAgICAgICAgICAgICAgLy8gZm9yIG5vdywgZG8gY2hlY2twb2ludCBhZnRlciBldmVyeSBDT01NSVQgYmVjYXVzZSB0aGF0IGlzIHRoZSBmYXN0ZXN0CisgICAgICAgICAgICAgICAgLy8gd2F5IHRvIGd1YXJhbnRlZSB0aGF0IHJlYWRlcnMgd2lsbCBzZWUgbGF0ZXN0IGRhdGEuCisgICAgICAgICAgICAgICAgLy8gYnV0IHRoaXMgaXMgdGhlIHNsb3dlc3Qgd2F5IHRvIHJ1biBzcWxpdGUgd2l0aCBpbiB3cml0ZS1haGVhZCBsb2dnaW5nIG1vZGUuCisgICAgICAgICAgICAgICAgaWYgKHRoaXMubUNvbm5lY3Rpb25Qb29sICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgZXhlY1NRTCgiUFJBR01BIHdhbF9jaGVja3BvaW50OyIpOworICAgICAgICAgICAgICAgICAgICBpZiAoU1FMaXRlRGVidWcuREVCVUdfU1FMX1NUQVRFTUVOVFMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIlBSQUdNQSB3YWxfQ2hlY2twb2ludCBkb25lIik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgIGV4ZWNTUUwoIlJPTExCQUNLOyIpOwpAQCAtNjE0LDkgKzcyNiw3IEBACiAgICAgICogdHJhbnNhY3Rpb24gaXMgYWxyZWFkeSBtYXJrZWQgYXMgc3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gICAgICAgIHJldHVybiBuZXdQYWdlQ291bnQgKiBwYWdlU2l6ZTsKLSAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgIGlmIChwcm9nICE9IG51bGwpIHByb2cuY2xvc2UoKTsKLSAgICAgICAgICAgIHVubG9jaygpOwotICAgICAgICB9CisgICAgICAgIGxvbmcgbmV3UGFnZUNvdW50ID0gRGF0YWJhc2VVdGlscy5sb25nRm9yUXVlcnkodGhpcywgIlBSQUdNQSBtYXhfcGFnZV9jb3VudCA9ICIgKyBudW1QYWdlcywKKyAgICAgICAgICAgICAgICBudWxsKTsKKyAgICAgICAgcmV0dXJuIG5ld1BhZ2VDb3VudCAqIHBhZ2VTaXplOwogICAgIH0KIAogICAgIC8qKgpAQCAtMTAwMCwyMCArMTEzOCw3IEBACiAgICAgICogQHJldHVybiB0aGUgZGF0YWJhc2UgcGFnZSBzaXplLCBpbiBieXRlcwogICAgICAqLwogICAgIHB1YmxpYyBsb25nIGdldFBhZ2VTaXplKCkgewotICAgICAgICBTUUxpdGVTdGF0ZW1lbnQgcHJvZyA9IG51bGw7Ci0gICAgICAgIGxvY2soKTsKLSAgICAgICAgaWYgKCFpc09wZW4oKSkgewotICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiZGF0YWJhc2Ugbm90IG9wZW4iKTsKLSAgICAgICAgfQotICAgICAgICB0cnkgewotICAgICAgICAgICAgcHJvZyA9IG5ldyBTUUxpdGVTdGF0ZW1lbnQodGhpcywKLSAgICAgICAgICAgICAgICAgICAgIlBSQUdNQSBwYWdlX3NpemU7Iik7Ci0gICAgICAgICAgICBsb25nIHNpemUgPSBwcm9nLnNpbXBsZVF1ZXJ5Rm9yTG9uZygpOwotICAgICAgICAgICAgcmV0dXJuIHNpemU7Ci0gICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICBpZiAocHJvZyAhPSBudWxsKSBwcm9nLmNsb3NlKCk7Ci0gICAgICAgICA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ICAgU3RyaW5nIHByZWZpeFNxbCA9IHNxbC50cmltKCkuc3Vic3RyaW5nKDAsIDYpOworICAgICAgICBTUUxpdGVEYXRhYmFzZSBkYiA9IHRoaXM7CisgICAgICAgIC8vIGdldCBhIHBvb2xlZCBkYXRhYmFzZSBjb25uZWN0aW9uIGhhbmRsZSB0byB1c2UsIGlmIHRoaXMgaXMgYSBxdWVyeQorICAgICAgICBpZiAocHJlZml4U3FsLmVxdWFsc0lnbm9yZUNhc2UoIlNFTEVDVCIpKSB7CisgICAgICAgICAgICBkYiA9IGdldERiQ29ubmVjdGlvbihzcWwpOwogICAgICAgICB9CisgICAgICAgIGRiLmxvY2soKTsKICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIHJldHVybiBuZXcgU1FMaXRlU3RhdGVtZW50KHRoaXMsIHNxbCk7CisgICAgICAgICAgICByZXR1cm4gbmV3IFNRTGl0ZVN0YXRlbWVudChkYiwgc3FsKTsKICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgIHVubG9jaygpOworICAgICAgICAgICAgcmVsZWFzZURiQ29ubmVjdGlvbihkYik7CisgICAgICAgICAgICBkYi51bmxvY2soKTsKICAgICAgICAgfQogICAgIH0KIApAQCAtMTIyNiw5ICsxMzU2LDcgQEAKICAgICAgICAgICAgIGJvb2xlYW4gZGlzdGluY3QsIFN0cmluZyB0YWJsZSwgU3RyaW5nW10gY29sdW1ucywKICAgICAgICAgICAgIFN0cmluZyBzZWxlY3Rpb24sIFN0cmluZ1tdIHNlbGVjdGlvbkFyZ3MsIFN0cmluZyBncm91cEJ5LAogICAgICAgICAgICAgU3RyaW5nIGhhdmluZywgU3RyaW5nIG9yZGVyQnksIFN0cmluZyBsaW1pdCkgewotICAgICAgICBpZiAoIWlzT3BlbigpKSB7Ci0gICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJkYXRhYmFzZSBub3Qgb3BlbiIpOwotICAgICAgICB9CisgICAgIC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PSBuZXcgU1FMaXRlRGlyZWN0Q3Vyc29yRHJpdmVyKGRiLCBzcWwsIGVkaXRUYWJsZSk7CiAKICAgICAgICAgQ3Vyc29yIGN1cnNvciA9IG51bGw7CiAgICAgICAgIHRyeSB7CkBAIC0xMzc1LDYgKzE1MDIsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogIjxudWxsPiIpICArICIsIGNvdW50IGlzICIgKyBjb3VudCk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQorICAgICAgICAgICAgcmVsZWFzZURiQ29ubmVjdGlvbihkYik7CiAgICAgICAgIH0KICAgICAgICAgcmV0dXJuIGN1cnNvcjsKICAgICB9CkBAIC0xNTAxLDEwICsxNjI5LDggQEAKICAgICAgKi8KICAgICBwdWJsaWMgbG9uZyBpbnNlcnRXaXRoT25Db25mbGljdChTdHJpbmcgdGFibGUsIFN0cmluZyBudWxsQ29sdW1uSGFjaywKICAgICAgICAgICAgIENvbnRlbnRWYWx1ZXMgaW5pdGlhbFZhbHVlcywgaW50IGNvbmZsaWN0QWxnb3JpdGhtKSB7CisgICAgICAgIHZlcmlmeURiSXNPcGVuKCk7CiAgICAgICAgIEJsb2NrR3VhcmQuZ2V0VGhyZWFkUG9saWN5KCkub25Xcml0ZVRvRGlzaygpOwotICAgICAgICBpZiAoIWlzT3BlbigpKSB7Ci0gICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJkYXRhYmFzZSBub3Qgb3BlbiIpOwotICAgICAgICB9CiAKICAgICAgICAgLy8gTWVhc3VyZW1lbnRzIHNob3cgbW9zdCBzcWwgbGVuZ3RocyA8PSAxNTIKICAgICAgICAgU3RyaW5nQnVpbGRlciBzcWwgPSBuZXcgU3RyaW5nQnVpbGRlcigxNTIpOwpAQCAtMTU5MywxMSArMTcxOSw5IEBACiAgICAgICogICAgICAgICB3aGVyZUNsYXVzZS4KICAgICAgKi8KICAgICBwdWJsaWMg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x1ZXMsIFN0cmluZywgU3RyaW5nW10pfTwvbGk+CisgICAgICogICA8bGk+e0BsaW5rICN1cGRhdGVXaXRoT25Db25mbGljdChTdHJpbmcsIENvbnRlbnRWYWx1ZXMsIFN0cmluZywgU3RyaW5nW10sIGludCl9PC9saT4KKyAgICAgKiA8L3VsPgorICAgICAqIDxwPgorICAgICAqIEZvciBERUxFVEUgc3RhdGVtZW50cywgdXNlIGFueSBvZiB0aGUgZm9sbG93aW5nIGluc3RlYWQuCisgICAgICogPHVsPgorICAgICAqICAgPGxpPntAbGluayAjZGVsZXRlKFN0cmluZywgU3RyaW5nLCBTdHJpbmdbXSl9PC9saT4KKyAgICAgKiA8L3VsPgorICAgICAqIDxwPgorICAgICAqIEZvciBleGFtcGxlLCB0aGUgZm9sbG93aW5nIGFyZSBnb29kIGNhbmRpZGF0ZXMgZm9yIHVzaW5nIHRoaXMgbWV0aG9kOgorICAgICAqIDx1bD4KKyAgICAgKiAgIDxsaT5BTFRFUiBUQUJMRTwvbGk+CisgICAgICogICA8bGk+Q1JFQVRFIG9yIERST1AgdGFibGUgLyB0cmlnZ2VyIC8gdmlldyAvIGluZGV4IC8gdmlydHVhbCB0YWJsZTwvbGk+CisgICAgICogICA8bGk+UkVJTkRFWDwvbGk+CisgICAgICogICA8bGk+UkVMRUFTRTwvbGk+CisgICAgICogICA8bGk+U0FWRVBPSU5UPC9saT4KKyAgICAgKiAgIDxsaT5QUkFHTUEgdGhhdCByZXR1cm5zIG5vIGRhdGE8L2xpPgorICAgICAqIDwvdWw+CisgICAgICogPC9wPgogICAgICAqCi0gICAgICogQHBhcmFtIHNxbAorICAgICAqIEBwYXJhbSBzcWwgdGhlIFNRTCBzdGF0ZW1lbnQgdG8gYmUgZXhlY3V0ZWQuIE11bHRpcGxlIHN0YXRlbWVudHMgc2VwYXJhdGVkIGJ5IHNlbWljb2xvbnMgYXJlCisgICAgICogbm90IHN1cHBvcnRlZC4KICAgICAgKiBAcGFyYW0gYmluZEFyZ3M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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgICAqCkBAIC0xOTc3LDIyICsyMTQxLDE0IEBACiAgICAgICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgICAqLwogICAgIC8qKgotICAgICAqIGFkZHMgdGhlIGdpdmVuIHNxbCBhbmQgaXRzIGNvbXBpbGVkLXN0YXRlbWVudC1pZC1yZXR1cm5lZC1ieS1zcWxpdGUgdG8gdGhlCisgICAgICogQWRkcyB0aGUgZ2l2ZW4gU1FMIGFuZCBpdHMgY29tcGlsZWQtc3RhdGVtZW50LWlkLXJldHVybmVkLWJ5LXNxbGl0ZSB0byB0aGUKICAgICAgKiBjYWNoZSBvZiBjb21waWxlZFF1ZXJpZXMgYXR0YWNoZWQgdG8gJ3RoaXMnLgotICAgICAqCi0gICAgICogaWYgdGhlcmUgaXMgYWxyZWFkeSBhIHtAbGluayBTUUxpdGVDb21waWxlZFNxbH0gaW4gY29tcGlsZWRRdWVyaWVzIGZvciB0aGUgZ2l2ZW4gc3FsLAorICAgICAqIDxwPgorICAgICAqIElmIHRoZXJlIGlzIGFscmVhZHkgYSB7QGxpbmsgU1FMaXRlQ29tcGlsZWRTcWx9IGluIGNvbXBpbGVkUXVlcmllcyBmb3IgdGhlIGdpdmVuIFNRTCwKICAgICAgKiB0aGUgbmV3IHtAbGluayBTUUxpdGVDb21waWxlZFNxbH0gb2JqZWN0IGlzIE5PVCBpbnNlcnRlZCBpbnRvIHRoZSBjYWNoZSAoaS5lLix0aGUgY3VycmVudAogICAgICAqIG1hcHBpbmcgaXMgTk9UIHJlcGxhY2VkIHdpdGggdGhlIG5ldyBtYXBwaW5nKS4KICAgICAgKi8KICAgICAvKiBwYWNrYWdlICovIHZvaWQgYWRkVG9Db21waWxlZFF1ZXJpZXMoU3RyaW5nIHNxbCwgU1FMaXRlQ29tcGlsZWRTcWwgY29tcGlsZWRTdGF0ZW1lbnQpIHsKLSAgICAgICAgaWYgKG1NYXhTcWxDYWNoZVNpemUgPT0gMCkgewotICAgICAgICAgICAgLy8gZm9yIHRoaXMgZGF0YWJhc2UsIHRoZXJlIGlzIG5vIGNhY2hlIG9mIGNvbXBpbGVkIHNxbC4KLSAgICAgICAgICAgIGlmIChTUUxpdGVEZWJ1Zy5ERUJVR19TUUxfQ0FDSEUpIHsKLSAgICAgICAgICAgICAgICBMb2cudihUQUcsICJ8Tk9UIGFkZGluZ19zcWxfdG9fY2FjaGV8IiArIGdldFBhdGgoKSArICJ8IiArIHNxbCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLQogICAgICAgICBTUUxpdGVDb21waWxlZFNxbCBjb21waWxlZFNxbCA9IG51bGw7CiAgICAgICAgIHN5bmNocm9uaXplZChtQ29tcGlsZWRRdWVyaWVzKSB7CiAgICAgICAgICAgICAvLyBkb24ndCBpbnNlcnQgdGhlIG5ldyBtYXBwaW5nIGlmIGEgbWFwcGluZyBhbHJlYWR5IGV4aXN0cwpAQCAtMjAwMCwzNSArMjE1NiwzMCBAQAogICAgICAgICAgICAgaWYgKGNvbXBpbGVkU3FsICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAvLyBhZGQgdGhpcyA8c3FsLCBjb21waWxlZFN0YXRlbWVudD4gdG8gdGhlIGNhY2hlCisKICAgICAgICAgICAgIGlmIChtQ29tcGlsZWRRdWVyaWVzLnNpemUoKSA9PSBtTWF4U3FsQ2FjaGVTaXplKSB7CiAgICAgICAgICAgICAgICAgLyoKICAgICAgICAgICAgICAgICAgKiBjYWNoZSBzaXplIG9mIHtAbGluayAjbU1heFNxbENhY2hlU2l6ZX0gaXMgbm90IGVub3VnaCBmb3IgdGhpcyBhcHAuCi0gICAgICAgICAgICAgICAgICogbG9nIGEgd2FybmluZyBNQVhfV0FSTklOR1NfT05fQ0FDSEVTSVpFX0NPTkRJVElPTiB0aW1lcwotICAgICAgICAgICAgICAgICAqIGNoYW5jZXMgYXJlIGl0IGlzIE5PVCB1c2luZyA/IGZvciBiaW5kYXJncyAtIHNvIGNhY2hpbmcgaXMgdXNlbGVzcy4KLSAgICAgICAgICAgICAgICAgKiBUT0RPOiBlaXRoZXIgbGV0IHRoZSBjYWxsZXJzIHNldCBtYXggY2NoZXNpemUgZm9yIHRoZWlyIGFwcCwgb3IgaW50ZWxsaWdlbnRseQotICAgICAgICAgICAgICAgICAqIGZpZ3VyZSBvdXQgd2hhdCBzaG91bGQgYmUgY2FjaGVkIGZvciBhIGdpdmVuIGFwcC4KKyAgICAgICAgICAgICAgICAgKiBsb2cgYSB3YXJuaW5nLgorICAgICAgICAgICAgICAgICAqIGNoYW5jZXMgYXJlIGl0IGlzIE5PVCB1c2luZyA/IGZvciBiaW5kYXJncyAtIG9yIGNhY2hlc2l6ZSBpcyB0b28gc21hbGwuCiAgICAgICAgICAgICAgICAgICovCiAgICAgICAgICAgICAgICAgaWYgKCsrbUNhY2hlRnVsbFdhcm5pbmdzID09IE1BWF9XQVJOSU5HU19PTl9DQUNIRVNJWkVfQ09ORElUSU9OKSB7CiAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIlJlYWNoZWQgTUFYIHNpemUgZm9yIGNvbXBpbGVkLXNxbCBzdGF0ZW1lbnQgY2FjaGUgZm9yIGRhdGFiYXNlICIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldFBhdGgoKSArICI7IGkuZS4sIE5PIHNwYWNlIGZvciB0aGlzIHNxbCBzdGF0ZW1lbnQgaW4gY2FjaGU6ICIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNxbCArICIuIFBsZWFzZSBjaGFuZ2UgeW91ciBzcWwgc3RhdGVtZW50cyB0byB1c2UgJz8nIGZvciAiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiYmluZGFyZ3MsIGluc3RlYWQgb2YgdXNpbmcgYWN0dWFsIHZhbHVlcyIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldFBhdGgoKSArICIuIENvbnNpZGVyIGluY3JlYXNpbmcgY2FjaGVzaXplLiIpOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAvLyBkb24ndCBhZGQgdGhpcyBlbnRyeSB0byBjYWNoZQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAvLyBjYWNoZSBpcyBOT1QgZnVsbC4gYWRkIHRoaXMgdG8gY2FjaGUuCi0gICAgICAgICAgICAgICAgbUNvbXBpbGVkUXVlcmllcy5wdXQoc3FsLCBjb21waWxlZFN0YXRlbWVudCk7Ci0gICAgICAgICAgICAgICAgaWYgKFNRTGl0ZURlYnVnLkRFQlVHX1NRTF9DQUNIRSkgewotICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJ8YWRkaW5nX3NxbF90b19jYWNoZXwiICsgZ2V0UGF0aCgpICsgInwiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ29tcGlsZWRRdWVyaWVzLnNpemUoKSArICJ8IiArIHNxbCk7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSAKKyAgICAgICAgICAgIC8qIGFkZCB0aGUgZ2l2ZW4gU1FMaXRlQ29tcGlsZWRTcWwgY29tcGlsZWRTdGF0ZW1lbnQgdG8gY2FjaGUuCisgICAgICAgICAgICAgKiBubyBuZWVkIHRvIHdvcnJ5IGFib3V0IHRoZSBjYWNoZSBzaXplIC0gYmVjYXVzZSB7QGxpbmsgI21Db21waWxlZFF1ZXJpZXN9CisgICAgICAgICAgICAgKiBzZWxmLWxpbWl0cyBpdHMgc2l6ZSB0byB7QGxpbmsgI21NYXhTcWxDYWNoZVNpemV9LgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBtQ29tcGlsZWRRdWVyaWVzLnB1dChzcWwsI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ogICAgICAgICBTUUxpdGVDb21waWxlZFNxbCBjb21waWxlZFN0YXRlbWVudCA9IG51bGw7CiAgICAgICAgIGJvb2xlYW4gY2FjaGVIaXQ7CiAgICAgICAgIHN5bmNocm9uaXplZChtQ29tcGlsZWRRdWVyaWVzKSB7Ci0gICAgICAgICAgICBpZiAobU1heFNxbENhY2hlU2l6ZSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgLy8gZm9yIHRoaXMgZGF0YWJhc2UsIHRoZXJlIGlzIG5vIGNhY2hlIG9mIGNvbXBpbGVkIHNxbC4KLSAgICAgICAgICAgICAgICBpZiAoU1FMaXRlRGVidWcuREVCVUdfU1FMX0NBQ0hFKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgInxjYWNoZSBOT1QgZm91bmR8IiArIGdldFBhdGgoKSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwotICAgICAgICAgICAgfQogICAgICAgICAgICAgY2FjaGVIaXQgPSAoY29tcGlsZWRTdGF0ZW1lbnQgPSBtQ29tcGlsZWRRdWVyaWVzLmdldChzcWwpKSAhPSBudWxsOwogICAgICAgICB9CiAgICAgICAgIGlmIChjYWNoZUhpdCkgewpAQCAtMjA2NSw2MyArMjIwOSwyNCBAQAogICAgICAgICAgICAgTG9nLnYoVEFHLCAifGNhY2hlX3N0YXRzfCIgKwogICAgICAgICAgICAgICAgICAgICBnZXRQYXRoKCkgKyAifCIgKyBtQ29tcGlsZWRRdWVyaWVzLnNpemUoKSArCiAgICAgICAgICAgICAgICAgICAgICJ8IiArIG1OdW1DYWNoZUhpdHMgKyAifCIgKyBtTnVtQ2FjaGVNaXNzZXMgKwotICAgICAgICAgICAgICAgICAgICAifCIgKyBjYWNoZUhpdCArICJ8IiArIG1UaW1lT3BlbmVkICsgInwiICsgbVRpbWVDbG9zZWQgKyAifCIgKyBzcWwpOworICAgICAgICAgICAgICAgICAgICAifCIgKyBjYWNoZUhpdCArICJ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1FMX0NBQ0hFX1NJWkUgfHwgY2FjaGVTaXplIDwgMCkgewpAQCAtMjEzMywxMiArMjIzOCwyMTYgQEAKICAgICAgICAgbU1heFNxbENhY2hlU2l6ZSA9IGNhY2hlU2l6ZTsKICAgICB9CiAKKyAgICAvKiBwYWNrYWdlICovIGJvb2xlYW4gaXNTcWxJblN0YXRlbWVudENhY2hlKFN0cmluZyBzcWwpIHsKKyAgICAgICAgc3luY2hyb25pemVkIChtQ29tcGlsZWRRdWVyaWVzKSB7CisgICAgICAgICAgICByZXR1cm4gbUNvbXBpbGVkUXVlcmllcy5jb250YWluc0tleShzcWwpOworICAgICAgICB9CisgICAgfQorCisgICAgLyogcGFja2FnZSAqLyB2b2lkIGZpbmFsaXplU3RhdGVtZW50TGF0ZXIoaW50IGlkKSB7CisgICAgICAgIGlmICghaXNPcGVuKCkpIHsKKyAgICAgICAgICAgIC8vIGRhdGFiYXNlIGFscmVhZHkgY2xvc2VkLiB0aGlzIHN0YXRlbWVudCB3aWxsIGFscmVhZHkgaGF2ZSBiZWVuIGZpbmFsaXplZC4KKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBzeW5jaHJvbml6ZWQobUNsb3NlZFN0YXRlbWVudElkcykgeworICAgICAgICAgICAgaWYgKG1DbG9zZWRTdGF0ZW1lbnRJZHMuY29udGFpbnMoaWQpKSB7CisgICAgICAgICAgICAgICAgLy8gdGhpcyBzdGF0ZW1lbnQgaWQgaXMgYWxyZWFkeSBxdWV1ZWQgdXAgZm9yIGZpbmFsaXphdGlvbi4KKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtQ2xvc2VkU3RhdGVtZW50SWRzLmFkZChpZCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBwdWJsaWMgdmlzaWJpbGl0eSBvbmx5IGZvciB0ZXN0aW5nLiBvdGhlcndpc2UsIHBhY2thZ2UgdmlzaWJpbGl0eSBpcyBzdWZmaWNpZW50CisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBjbG9zZVBlbmRpbmdTdGF0ZW1lbnRzKCkgeworICAgICAgICBpZiAoIWlzT3BlbigpKSB7CisgICAgICAgICAgICAvLyBzaW5jZSB0aGlzIGRhdGFiYXNlIGlzIGFscmVhZHkgY2xvc2VkLCBubyBuZWVkIHRvIGZpbmFsaXplIGFueXRoaW5nLgorICAgICAgICAgICAgbUNsb3NlZFN0YXRlbWVudElkcy5jbGVhcigpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIHZlcmlmeUxvY2tPd25lcigpOworICAgICAgICAvKiB0byBtaW5pbWl6ZSBzeW5jaHJvbml6YXRpb24gb24gbUNsb3NlZFN0YXRlbWVudElkcywgbWFrZSBhIGNvcHkgb2YgdGhlIGxpc3QgKi8KKyAgICAgICAgQXJyYXlMaXN0PEludGVnZXI+IGxpc3QgPSBuZXcgQXJyYXlMaXN0PEludGVnZXI+KG1DbG9zZWRTdGF0ZW1lbnRJZHMuc2l6ZSgpKTsKKyAgICAgICAgc3luY2hyb25pemVkKG1DbG9zZWRTdGF0ZW1lbnRJZHMpIHsKKyAgICAgICAgICAgIGxpc3QuYWRkQWxsKG1DbG9zZWRTdGF0ZW1lbnRJZHMpOworICAgICAgICAgICAgbUNsb3NlZFN0YXRlbWVudElkcy5jbGVhcigpOworICAgICAgICB9CisgICAgICAgIC8vIGZpbmFsaXplIGFsbCB0aGUgc3RhdGVtZW50cyBmcm9tIHRoZSBjb3BpZWQgbGlzdAorICAgICAgICBpbnQgc2l6ZSA9IGxpc3Quc2l6ZSgpOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHNpemU7IGkrKykgeworICAgICAgICAgICAgbmF0aXZlX2ZpbmFsaXplKGxpc3QuZ2V0KGkpKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIGZvciB0ZXN0aW5nIG9ubHkKK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ub3QgZW5hYmxlZCIpOworICAgICAgICB9CisgICAgICAgIGludCBpID0gbUNvbm5lY3Rpb25Qb29sLmdldE1heFBvb2xTaXplKCk7CisgICAgICAgIGlmIChzaXplIDwgaSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgImNhbm5vdCBzZXQgbWF4IHBvb2wgc2l6ZSB0byBhIHZhbHVlIGxlc3MgdGhhbiB0aGUgY3VycmVudCBtYXggdmFsdWUoPSIgKworICAgICAgICAgICAgICAgICAgICBpICsgIikiKTsKKyAgICAgICAgfQorICAgICAgICBtQ29ubmVjdGlvblBvb2wuc2V0TWF4UG9vbFNpemUoc2l6ZSk7CisgICAgfQorCisgICAgLyogcGFja2FnZSAqLyBTUUxpdGVEYXRhYmFzZSBjcmVhdGVQb29sQ29ubmVjdGlvbihzaG9ydCBjb25uZWN0aW9uTnVtKSB7CisgICAgICAgIHJldHVybiBvcGVuRGF0YWJhc2UobVBhdGgsIG1GYWN0b3J5LCBtRmxhZ3MsIG1FcnJvckhhbmRsZXIsIGNvbm5lY3Rpb25OdW0pOworICAgIH0KKworICAgIHByaXZhdGUgYm9vbGVhbiBpc1Bvb2xlZENvbm5lY3Rpb24oKSB7CisgICAgICAgIHJldHVybiB0aGlzLm1Db25uZWN0aW9uTnVtID4gMDsKKyAgICB9CisKKyAgICBwcml2YXRlIFNRTGl0ZURhdGFiYXNlIGdldERiQ29ubmVjdGlvbihTdHJpbmcgc3FsKSB7CisgICAgICAgIHZlcmlmeURiSXNPcGVuKCk7CisKKyAgICAgICAgLy8gdXNlIHRoZSBjdXJyZW50IGNvbm5lY3Rpb24gaGFuZGxlIGlmCisgICAgICAgIC8vIDEuIHRoaXMgaXMgYSBwb29sZWQgY29ubmVjdGlvbiBoYW5kbGUKKyAgICAgICAgLy8gMi4gT1IsIGlmIHRoaXMgdGhyZWFkIGlzIGluIGEgdHJhbnNhY3Rpb24KKyAgICAgICAgLy8gMy4gT1IsIGlmIHRoZXJlIGlzIE5PIGNvbm5lY3Rpb24gaGFuZGxlIHBvb2wgc2V0dXAKKyAgICAgICAgU1FMaXRlRGF0YWJhc2UgZGIgPSBudWxsOworICAgICAgICBpZiAoaXNQb29sZWRDb25uZWN0aW9uKCkgfHwKKyAgICAgICAgICAgICAgICAoaW5UcmFuc2FjdGlvbigpICYmIG1Mb2NrLmlzSGVsZEJ5Q3VycmVudFRocmVhZCgpKSB8fAorICAgICAgICAgICAgICAgICh0aGlzLm1Db25uZWN0aW9uUG9vbCA9PSBudWxsKSkgeworICAgICAgICAgICAgZGIgPSB0aGlzOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gZ2V0IGEgY29ubmVjdGlvbiBoYW5kbGUgZnJvbSB0aGUgcG9vbAorICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLkRFQlVHKSkgeworICAgICAgICAgICAgICAgIGFzc2VydCBtQ29ubmVjdGlvblBvb2wgIT0gbnVsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGRiID0gbUNvbm5lY3Rpb25Qb29sLmdldChzcWwpOworICAgICAgICB9CisgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5ERUJVRykpIHsKKyAgICAgICAgICAgIExvZy5kKFRBRywgImdldERiQ29ubmVjdGlvbiB0aHJlYWRpZCA9ICIgKyBUaHJlYWQuY3VycmVudFRocmVhZCgpLmdldElkKCkgKworICAgICAgICAgICAgICAgICAgICAiLCByZXF1ZXN0IG9uICMgIiArIG1Db25uZWN0aW9uTnVtICsKKyAgICAgICAgICAgICAgICAgICAgIiwgYXNzaWduZWQgIyAiICsgZGIubUNvbm5lY3Rpb25OdW0gKyAiLCAiICsgZ2V0UGF0aCgpKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZGI7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHJlbGVhc2VEYkN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zI0NjEsMTM0IEBACiAgICAgICAgICAgICBpZiAoZGIgPT0gbnVsbCB8fCAhZGIuaXNPcGVuKCkpIHsKICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIC8vIGdldCBTUUxJVEVfREJTVEFUVVNfTE9PS0FTSURFX1VTRUQgZm9yIHRoZSBkYgotICAgICAgICAgICAgaW50IGxvb2thc2lkZVVzZWQgPSBkYi5uYXRpdmVfZ2V0RGJMb29rYXNpZGUoKTsKIAotICAgICAgICAgICAgLy8gZ2V0IHRoZSBsYXN0bm9kZSBvZiB0aGUgZGJuYW1lCi0gICAgICAgICAgICBTdHJpbmcgcGF0aCA9IGRiLmdldFBhdGgoKTsKLSAgICAgICAgICAgIGludCBpbmR4ID0gcGF0aC5sYXN0SW5kZXhPZigiLyIpOwotICAgICAgICAgICAgU3RyaW5nIGxhc3Rub2RlID0gcGF0aC5zdWJzdHJpbmcoKGluZHggIT0gLTEpID8gKytpbmR4IDogMCk7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIC8vIGdldCBTUUxJVEVfREJTVEFUVVNfTE9PS0FTSURFX1VTRUQgZm9yIHRoZSBkYgorICAgICAgICAgICAgICAgIGludCBsb29rYXNpZGVVc2VkID0gZGIubmF0aXZlX2dldERiTG9va2FzaWRlKCk7CiAKLSAgICAgICAgICAgIC8vIGdldCBsaXN0IG9mIGF0dGFjaGVkIGRicyBhbmQgZm9yIGVhY2ggZGIsIGdldCBpdHMgc2l6ZSBhbmQgcGFnZXNpemUKLSAgICAgICAgICAgIEFycmF5TGlzdDxQYWlyPFN0cmluZywgU3RyaW5nPj4gYXR0YWNoZWREYnMgPSBnZXRBdHRhY2hlZERicyhkYik7Ci0gICAgICAgICAgICBpZiAoYXR0YWNoZWREYnMgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBhdHRhY2hlZERicy5zaXplKCk7IGkrKykgewotICAgICAgICAgICAgICAgIFBhaXI8U3RyaW5nLCBTdHJpbmc+IHAgPSBhdHRhY2hlZERicy5nZXQoaSk7Ci0gICAgICAgICAgICAgICAgbG9uZyBwYWdlQ291bnQgPSBnZXRQcmFnbWFWYWwoZGIsIHAuZmlyc3QgKyAiLnBhZ2VfY291bnQ7Iik7CisgICAgICAgICAgICAgICAgLy8gZ2V0IHRoZSBsYXN0bm9kZSBvZiB0aGUgZGJuYW1lCisgICAgICAgICAgICAgICAgU3RyaW5nIHBhdGggPSBkYi5nZXRQYXRoKCk7CisgICAgICAgICAgICAgICAgaW50IGluZHggPSBwYXRoLmxhc3RJbmRleE9mKCIvIik7CisgICAgICAgICAgICAgICAgU3RyaW5nIGxhc3Rub2RlID0gcGF0aC5zdWJzdHJpbmcoKGluZHggIT0gLTEpID8gKytpbmR4IDogMCk7CiAKLSAgICAgICAgICAgICAgICAvLyBmaXJzdCBlbnRyeSBpbiB0aGUgYXR0YWNoZWQgZGIgbGlzdCBpcyBhbHdheXMgdGhlIG1haW4gZGF0YWJhc2UKLSAgICAgICAgICAgICAgICAvLyBkb24ndCB3b3JyeSBhYm91dCBwcmVmaXhpbmcgdGhlIGRibmFtZSB3aXRoICJtYWluIgotICAgICAgICAgICAgICAgIFN0cmluZyBkYk5hbWU7Ci0gICAgICAgICAgICAgICAgaWYgKGkgPT0gMCkgewotICAgICAgICAgICAgICAgICAgICBkYk5hbWUgPSBsYXN0bm9kZTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAvLyBsb29rYXNpZGUgaXMgb25seSByZWxldmFudCBmb3IgdGhlIG1haW4gZGIKLSAgICAgICAgICAgICAgICAgICAgbG9va2FzaWRlVXNlZCA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIGRiTmFtZSA9ICIgIChhdHRhY2hlZCkgIiArIHAuZmlyc3Q7Ci0gICAgICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBhdHRhY2hlZCBkYiBoYXMgYSBwYXRoLCBhdHRhY2ggdGhlIGxhc3Rub2RlIGZyb20gdGhlIHBhdGggdG8gYWJvdmUKLSAgICAgICAgICAgICAgICAgICAgaWYgKHAuc2Vjb25kLnRyaW0oKS5sZW5ndGgoKSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCBpZHggPSBwLnNlY29uZC5sYXN0SW5kZXhPZigiLyIpOwotICAgICAgICAgICAgICAgICAgICAgICAgZGJOYW1lICs9ICIgOiAiICsgcC5zZWNvbmQuc3Vic3RyaW5nKChpZHggIT0gLTEpID8gKytpZHggOiAwKTsKKyAgICAgICAgICAgICAgICAvLyBnZXQgbGlzdCBvZiBhdHRhY2hlZCBkYnMgYW5kIGZvciBlYWNoIGRiLCBnZXQgaXRzIHNpemUgYW5kIHBhZ2VzaXplCisgICAgICAgICAgICAgICAgQXJyYXlMaXN0PFBhaXI8U3RyaW5nLCBTdHJpbmc+PiBhdHRhY2hlZERicyA9IGRiLmdldEF0dGFjaGVkRGJzKCk7CisgICAgICAgICAgICAgICAgaWYgKGF0dGFjaGVkRGJzID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgYXR0YWNoZWREYnMuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgUGFpcjxTdHJpbmcsIFN0cmluZz4gcCA9IGF0dGFjaGVkRGJzLmdldChpKTsKKyAgICAgICAgICAgICAgICAgICAgbG9uZyBwYWdlQ291bnQgPSBEYXRhYmFzZVV0aWxzLmxvbmdGb3JRdWVyeShkYiwgIlBSQUdNQSAiICsgcC5maXJzdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIi5wYWdlX2NvdW50OyIsIG51bGwpOworCisgICAgICAgICAgICAgICAgICAgIC8vIGZpcnN0IGVudHJ5IGluIHRoZSBhdHRhY2hlZCBkYiBsaXN0IGlzIGFsd2F5cyB0aGUgbWFpbiBkYXRhYmFzZQorICAgICAgICAgICAgICAgICAgICAvLyBkb24ndCB3b3JyeSBhYm91dCBwcmVmaXhpbmcgdGhlIGRibmFtZSB3aXRoICJtYWluIgorICAgICAgICAgICAgICAgICAgICBTdHJpbmcgZGJOYW1lOworICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkYk5hbWUgPSBsYXN0bm9kZTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxvb2thc2lkZSBpcyBvbmx5IHJlbGV2YW50IGZvciB0aGUgbWFpbiBkYgorICAgICAgICAgICAgICAgICAgICAgICAgbG9va2FzaWRlVXNlZCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICBkYk5hbWUgPSAiICAoYXR0YWNoZWQpICIgKyBwLmZpcnN0OworICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWYgdGhlIGF0dGFjaGVkIGRiIGhhcyBhIHBhdGgsIGF0dGFjaCB0aGUgbGFzdG5vZGUgZnJvbSB0aGUgcGF0aCB0byBhYm92ZQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHAuc2Vjb25kLnRyaW0oKS5sZW5ndGgoKSA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaWR4ID0gcC5zZWNvbmQubGFzdEluZGV4T2YoIi8iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYk5hbWUgKz0gIiA6ICIgKyBwLnNlY29uZC5zdWJzdHJpbmcoKGlkeCAhPSAtMSkgPyArK2lkeCA6IDApOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChwYWdlQ291bnQgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkYlN0YXRzTGlzdC5hZGQobmV3IERiU3RhdHMoZGJOYW1lLCBwYWdlQ291bnQsIGRiLmdldFBhZ2VTaXplKCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvb2thc2lkZVVzZWQsIGRiLm1OdW1DYWNoZUhpdHMsIGRiLm1OdW1DYWNoZU1pc3NlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGIubUNvbXBpbGVkUXVlcmllcy5zaXplKCkpKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAocGFnZUNvdW50ID4gMCkgewotICAgICAgICAgICAgICAgICAgICBkYlN0YXRzTGlzdC5hZGQobmV3IERiU3RhdHMoZGJOYW1lLCBwYWdlQ291bnQsIGRiLmdldFBhZ2VTaXplKCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9va2FzaWRlVXNlZCkpOworICAgICAgICAgICAgICAgIC8vIGlmIHRoZXJlIGFyZSBwb29sZWQgY29ubmVjdGlvbnMsIHJldHVybiB0aGUgY2FjaGUgc3RhdHMgZm9yIHRoZW0gYWxzby4KKyAgICAgICAgICAgICAgICBpZiAoZGIubUNvbm5lY3Rpb25Qb29sICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChTUUxpdGVEYXRhYmFzZSBwRGIgOiBkYi5tQ29ubmVjdGlvblBvb2wuZ2V0Q29ubmVjdGlvbkxpc3QoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZGJTdGF0c0xpc3QuYWRkKG5ldyBEYlN0YXRzKCIocG9vbGVkICMgIiArIHBEYi5tQ29ubmVjdGlvbk51bSArICIpICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBsYXN0bm9kZSwgMCwgMCwgMCwgcERiLm1OdW1DYWNoZUhpdHMsIHBEYi5tTnVtQ2FjaGVNaXNzZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAg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YXNlSW50ZWdyaXR5T2soKSB7CisgICAgICAgIHZlcmlmeURiSXNPcGVuKCk7CisgICAgICAgIEFycmF5TGlzdDxQYWlyPFN0cmluZywgU3RyaW5nPj4gYXR0YWNoZWREYnMgPSBnZXRBdHRhY2hlZERicygpOworICAgICAgICBpZiAoYXR0YWNoZWREYnMgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiZGF0YWJhc2VsaXN0IGZvcjogIiArIGdldFBhdGgoKSArICIgY291bGRuJ3QgIiArCisgICAgICAgICAgICAgICAgICAgICJiZSByZXRyaWV2ZWQuIHByb2JhYmx5IGJlY2F1c2UgdGhlIGRhdGFiYXNlIGlzIGNsb3NlZCIpOworICAgICAgICB9CisgICAgICAgIGJvb2xlYW4gaXNEYXRhYmFzZUNvcnJ1cHQgPSBmYWxzZTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBhdHRhY2hlZERicy5zaXplKCk7IGkrKykgeworICAgICAgICAgICAgUGFpcjxTdHJpbmcsIFN0cmluZz4gcCA9IGF0dGFjaGVkRGJzLmdldChpKTsKKyAgICAgICAgICAgIFNRTGl0ZVN0YXRlbWVudCBwcm9nID0gbnVsbDsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgcHJvZyA9IGNvbXBpbGVTdGF0ZW1lbnQoIlBSQUdNQSAiICsgcC5maXJzdCArICIuaW50ZWdyaXR5X2NoZWNrKDEpOyIpOworICAgICAgICAgICAgICAgIFN0cmluZyByc2x0ID0gcHJvZy5zaW1wbGVRdWVyeUZvclN0cmluZygpOworICAgICAgICAgICAgICAgIGlmICghcnNsdC5lcXVhbHNJZ25vcmVDYXNlKCJvayIpKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIGludGVncml0eV9jaGVja2VyIGZhaWxlZCBvbiBtYWluIG9yIGF0dGFjaGVkIGRhdGFiYXNlcworICAgICAgICAgICAgICAgICAgICBpc0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3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiVmVyc2lvbiBtdXN0IGJlID49IDEsIHdhcyAiICsgdmVyc2lvbik7CisgICAgICAgIGlmIChlcnJvckhhbmRsZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiRGF0YWJhc2VFcnJvckhhbmRsZXIgcGFyYW0gdmFsdWUgY2FuJ3QgYmUgbnVsbC4iKTsKKyAgICAgICAgfQogCiAgICAgICAgIG1Db250ZXh0ID0gY29udGV4dDsKICAgICAgICAgbU5hbWUgPSBuYW1lOwogICAgICAgICBtRmFjdG9yeSA9IGZhY3Rvcnk7CiAgICAgICAgIG1OZXdWZXJzaW9uID0gdmVyc2lvbjsKKyAgICAgICAgbUVycm9ySGFuZGxlciA9IGVycm9ySGFuZGxlcjsKICAgICB9CiAKICAgICAvKioKQEAgLTEwMSwxMCArMTI5LDE0IEBACiAgICAgICAgICAgICBpZiAobU5hbWUgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgIGRiID0gU1FMaXRlRGF0YWJhc2UuY3JlYXRlKG51bGwpOwogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBkYiA9IG1Db250ZXh0Lm9wZW5PckNyZWF0ZURhdGFiYXNlKG1OYW1lLCAwLCBtRmFjdG9yeSk7CisgICAgICAgICAgICAgICAgZGIgPSBtQ29udGV4dC5vcGVuT3JDcmVhdGVEYXRhYmFzZShtTmFtZSwgMCwgbUZhY3RvcnksIG1FcnJvckhhbmRsZXIpOwogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBpbnQgdmVyc2lvbiA9IGRiLmdldFZlcnNpb24oKTsKKyAgICAgICAgICAgIGlmICh2ZXJzaW9uID4gbU5ld1ZlcnNpb24pIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJEYXRhYmFzZSAiICsgbU5hbWUgKworICAgICAgICAgICAgICAgICAgICAgICAgIiBjYW5ub3QgYmUgZG93bmdyYWRlZC4gaW5zdGVhZCwgcGxlYXNlIHVuaW5zdGFsbCBuZXcgdmVyc2lvbiBmaXJzdC4iKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmICh2ZXJzaW9uICE9IG1OZXdWZXJzaW9uKSB7CiAgICAgICAgICAgICAgICAgZGIuYmVnaW5UcmFuc2FjdGlvbigpOwogICAgICAgICAgICAgICAgIHRyeSB7CkBAIC0xNzUsNyArMjA3LDggQEAKICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgIG1Jc0luaXRpYWxpemluZyA9IHRydWU7CiAgICAgICAgICAgICBTdHJpbmcgcGF0aCA9IG1Db250ZXh0LmdldERhdGFiYXNlUGF0aChtTmFtZSkuZ2V0UGF0aCgpOwotICAgICAgICAgICAgZGIgPSBTUUxpdGVEYXRhYmFzZS5vcGVuRGF0YWJhc2UocGF0aCwgbUZhY3RvcnksIFNRTGl0ZURhdGFiYXNlLk9QRU5fUkVBRE9OTFkpOworICAgICAgICAgICAgZGIgPSBTUUxpdGVEYXRhYmFzZS5vcGVuRGF0YWJhc2UocGF0aCwgbUZhY3RvcnksIFNRTGl0ZURhdGFiYXNlLk9QRU5fUkVBRE9OTFksCisgICAgICAgICAgICAgICAgICAgIG1FcnJvckhhbmRsZXIpOwogICAgICAgICAgICAgaWYgKGRiLmdldFZlcnNpb24oKSAhPSBtTmV3VmVyc2lvbikgewogICAgICAgICAgICAgICAgIHRocm93IG5ldyBTUUxpdGVFeGNlcHRpb24oIkNhbid0IHVwZ3JhZGUgcmVhZC1vbmx5IGRhdGFiYXNlIGZyb20gdmVyc2lvbiAiICsKICAgICAgICAgICAgICAgICAgICAgICAgIGRiLmdldFZlcnNpb24oKSArICIgdG8gIiArIG1OZXdWZXJzaW9uICsgIjogIiArIHBhdGgpOwpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvZGF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aW5kRG91YmxlKGludCBpbmRleCwgZG91YmxlIHZhbHVlKSB7Ci0gICAgICAgIGlmICghbURhdGFiYXNlLmlzT3BlbigpKSB7Ci0gICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJkYXRhYmFzZSAiICsgbURhdGFiYXNlLmdldFBhdGgoKSArICIgYWxyZWFkeSBjbG9zZWQiKTsKLSAgICAgICAgfQorICAgICAgICBtRGF0YWJhc2UudmVyaWZ5RGJJc09wZW4oKTsKICAgICAgICAgYWNxdWlyZVJlZmVyZW5jZSgpOwogICAgICAgICB0cnkgewogICAgICAgICAgICAgbmF0aXZlX2JpbmRfZG91YmxlKGluZGV4LCB2YWx1ZSk7CkBAIC0yMzYsOSArMjMwLDcgQEAKICAgICAgICAgaWYgKHZhbHVlID09IG51bGwpIHsKICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oInRoZSBiaW5kIHZhbHVlIGF0IGluZGV4ICIgKyBpbmRleCArICIgaXMgbnVsbCIpOwogICAgICAgICB9Ci0gICAgICAgIGlmICghbURhdGFiYXNlLmlzT3BlbigpKSB7Ci0gICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJkYXRhYmFzZSAiICsgbURhdGFiYXNlLmdldFBhdGgoKSArICIgYWxyZWFkeSBjbG9zZWQiKTsKLSAgICAgICAgfQorICAgICAgICBtRGF0YWJhc2UudmVyaWZ5RGJJc09wZW4oKTsKICAgICAgICAgYWNxdWlyZVJlZmVyZW5jZSgpOwogICAgICAgICB0cnkgewogICAgICAgICAgICAgbmF0aXZlX2JpbmRfc3RyaW5nKGluZGV4LCB2YWx1ZSk7CkBAIC0yNTgsOSArMjUwLDcgQEAKICAgICAgICAgaWYgKHZhbHVlID09IG51bGwpIHsKICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oInRoZS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B0aGUgU1FMaXRlU3RhdGVtZW50LgogICovCkBAIC00OSwxNSArNDksMTQgQEAKICAgICAgKiAgICAgICAgIHNvbWUgcmVhc29uCiAgICAgICovCiAgICAgcHVibGljIHZvaWQgZXhlY3V0ZSgpIHsKKyAgICAgICAgbURhdGFiYXNlLnZlcmlmeURiSXNPcGVuKCk7CiAgICAgICAgIEJsb2NrR3VhcmQuZ2V0VGhyZWFkUG9saWN5KCkub25Xcml0ZVRvRGlzaygpOwotICAgICAgICBpZiAoIW1EYXRhYmFzZS5pc09wZW4oKSkgewotICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiZGF0YWJhc2UgIiArIG1EYXRhYmFzZS5nZXRQYXRoKCkgKyAiIGFscmVhZHkgY2xvc2VkIik7Ci0gICAgICAgIH0KICAgICAgICAgbG9uZyB0aW1lU3RhcnQgPSBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKTsKICAgICAgICAgbURhdGFiYXNlLmxvY2soKTsKIAogICAgICAgICBhY3F1aXJlUmVmZXJlbmNlKCk7CiAgICAgICAgIHRyeSB7CisgICAgICAgICAgICBtRGF0YWJhc2UuY2xvc2VQZW5kaW5nU3RhdGVtZW50cygpOwogICAgICAgICAgICAgbmF0aXZlX2V4ZWN1dGUoKTsKICAgICAgICAgICAgIG1EYXRhYmFzZS5sb2dUaW1lU3RhdChtU3FsLCB0aW1lU3RhcnQpOwogICAgICAgICB9IGZpbmFsbHkgewpAQCAtNzYsMTUgKzc1LDE0IEBACiAgICAgICogICAgICAgICBzb21lIHJlYXNvbgogICAgICAqLwogICAgIHB1YmxpYyBsb25nIGV4ZWN1dGVJbnNlcnQoKSB7CisgICAgICAgIG1EYXRhYmFzZS52ZXJpZnlEYklzT3BlbigpOwogICAgICAgICBCbG9ja0d1YXJkLmdldFRocmVhZFBvbGljeSgpLm9uV3JpdGVUb0Rpc2soKTsKLSAgICAgICAgaWYgKCFtRGF0YWJhc2UuaXNPc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hdGgoKSArICIgYWxyZWFkeSBjbG9zZWQiKTsKLSAgICAgICAgfQogICAgICAgICBsb25nIHRpbWVTdGFydCA9IFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpOwogICAgICAgICBtRGF0YWJhc2UubG9jaygpOwogCiAgICAgICAgIGFjcXVpcmVSZWZlcmVuY2UoKTsKICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG1EYXRhYmFzZS5jbG9zZVBlbmRpbmdTdGF0ZW1lbnRzKCk7CiAgICAgICAgICAgICBsb25nIHJldFZhbHVlID0gbmF0aXZlXzF4MV9sb25nKCk7CiAgICAgICAgICAgICBtRGF0YWJhc2UubG9nVGltZVN0YXQobVNxbCwgdGltZVN0YXJ0KTsKICAgICAgICAgICAgIHJldHVybiByZXRWYWx1ZTsKQEAgLTEzMCwxNSArMTI3LDE0IEBACiAgICAgICogQHRocm93cyBhbmRyb2lkLmRhdGFiYXNlLnNxbGl0ZS5TUUxpdGVEb25lRXhjZXB0aW9uIGlmIHRoZSBxdWVyeSByZXR1cm5zIHplcm8gcm93cwogICAgICAqLwogICAgIHB1YmxpYyBTdHJpbmcgc2ltcGxlUXVlcnlGb3JTdHJpbmcoKSB7CisgICAgICAgIG1EYXRhYmFzZS52ZXJpZnlEYklzT3BlbigpOwogICAgICAgICBCbG9ja0d1YXJkLmdldFRocmVhZFBvbGljeSgpLm9uUmVhZEZyb21EaXNrKCk7Ci0gICAgICAgIGlmICghbURhdGFiYXNlLmlzT3BlbigpKSB7Ci0gICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJkYXRhYmFzZSAiICsgbURhdGFiYXNlLmdldFBhdGgoKSArICIgYWxyZWFkeSBjbG9zZWQiKTsKLSAgICAgICAgfQogICAgICAgICBsb25nIHRpbWVTdGFydCA9IFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpOwogICAgICAgICBtRGF0YWJhc2UubG9jaygpOwogCiAgICAgICAgIGFjc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cml2YXRlRG5zUm91dGVTZXQoYm9vbGVhbiBlbmFibGVkKSB7CisgICAgICAgIG1Qcml2YXRlRG5zUm91dGVTZXQgPSBlbmFibGVkOworICAgIH0KKworICAgIHB1YmxpYyBOZXR3b3JrSW5mbyBnZXROZXR3b3JrSW5mbygpIHsKKyAgICAgICAgcmV0dXJuIG1OZXR3b3JrSW5mbzsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldERlZmF1bHRHYXRld2F5QWRkcigpIHsKKyAgICAgICAgcmV0dXJuIG1EZWZhdWx0R2F0ZXdheUFkZHI7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaXNEZWZhdWx0Um91dGVTZXQoKSB7CisgICAgICAgIHJldHVybiBtRGVmYXVsdFJvdXRlU2V0OworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGRlZmF1bHRSb3V0ZVNldChib29sZWFuIGVuYWJsZWQpIHsKKyAgICAgICAgbURlZmF1bHRSb3V0ZVNldCA9IGVuYWJsZWQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogVGhpcyBpcyBub3QgaW1wbGVtZW50ZWQuCisgICAgICovCisgICAgcHVibGljIHZvaWQgcmVsZWFzZVdha2VMb2NrKCkgeworICAgIH0KKworICAgIC8qKgogICAgICAqIEJlZ2luIG1vbml0b3JpbmcgbW9iaWxlIGRhdGEgY29ubmVjdGl2aXR5LgogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHN0YXJ0TW9uaXRvcmluZygpIHsKQEAgLTEwMywzOCArMTQ5LDM0IEBACiAgICAgICAgIGZpbHRlci5hZGRBY3Rpb24oVGVsZXBob255SW50ZW50cy5BQ1RJT05fU0VSVklDRV9TVEFURV9DSEFOR0VEKTsKIAogICAgICAgICBtU3RhdGVSZWNlaXZlciA9IG5ldyBNb2JpbGVEYXRhU3RhdGVSZWNlaXZlcigpOwotICAgICAgICBJbnRlbnQgaW50ZW50ID0gbUNvbnRleHQucmVnaXN0ZXJSZWNlaXZlcihtU3Rh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0hBTkdFRCkpIHsKLSAgICAgICAgICAgICAgICAgICAgUGhvbmUuRGF0YVN0YXRlIHN0YXRlID0gZ2V0TW9iaWxlRGF0YVN0YXRlKGludGVudCk7CisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBhcG5UeXBlID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKFBob25lLkRBVEFfQVBOX1RZUEVfS0VZKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoIVRleHRVdGlscy5lcXVhbHMoYXBuVHlwZSwgbUFwblR5cGUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgUGhvbmUuRGF0YVN0YXRlIHN0YXRlID0gRW51bS52YWx1ZU9mKFBob25lLkRhdGFTdGF0ZS5jbGFzcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlbnQuZ2V0U3RyaW5nRXh0cmEoUGhvbmUuU1RBVEVfS0VZKSk7CiAgICAgICAgICAgICAgICAgICAgIFN0cmluZyByZWFzb24gPSBpbnRlbnQuZ2V0U3RyaW5nRXh0cmEoUGhvbmUuU1RBVEVfQ0hBTkdFX1JFQVNPTl9LRVkpOwogICAgICAgICAgICAgICAgICAgICBTdHJpbmcgYXBuTmFtZSA9IGludGVudC5nZXRTdHJpbmdFeHRyYShQaG9uZS5EQVRBX0FQTl9LRVkpOwotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgYXBuVHlwZUxpc3QgPSBpbnRlbnQuZ2V0U3RyaW5nRXh0cmEoUGhvbmUuREFUQV9BUE5fVFlQRVNfS0VZKTsKLSAgICAgICAgICAgICAgICAgICAgbUFwbk5hbWUgPSBhcG5OYW1lOwogCiAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gdW5hdmFpbGFibGUgPSBpbnRlbnQuZ2V0Qm9vbGVhbkV4dHJhKFBob25lLk5FVFdPUktfVU5BVkFJTEFCTEVfS0VZLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlKTsKLQotICAgICAgICAgICAgICAgICAgICAvLyBzZXQgdGhpcyByZWdhcmRsZXNzIG9mIHRoZSBhcG5UeXBlTGlzdC4gIEl0J3MgYWxsIHRoZSBzYW1lIHJhZGlvL25ldHdvcmsKLSAgICAgICAgICAgICAgICAgICAgLy8gdW5kZXJuZWF0aAogICAgICAgICAgICAgICAgICAgICBtTmV0d29ya0luZm8uc2V0SXNBdmFpbGFibGUoIXVuYXZhaWxhYmxlKTsKIAotICAgICAgICAgICAgICAgICAgICBpZiAoaXNBcG5UeXBlSW5jbHVkZWQoYXBuVHlwZUxpc3QpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobUVuYWJsZWQgPT0gZmFsc2UpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiB3ZSdyZSBub3QgZW5hYmxlZCBidXQgdGhlIEFQTiBUeXBlIGlzIHN1cHBvcnRlZCBieSB0aGlzIGNvbm5lY3Rpb24KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB3ZSBzaG91bGQgcmVjb3JkIHRoZSBpbnRlcmZhY2UgbmFtZSBpZiBvbmUncyBwcm92aWRlZC4gIElmIHRoZSB1c2VyCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdHVybnMgb24gdGhpcyBuZXR3b3JrIHdlIHdpbGwgbmVlZCB0aGUgaW50ZXJmYWNlbmFtZSBidXQgd29uJ3QgZ2V0Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYSBmcmVzaCBjb25uZWN0ZWQgbWVzc2FnZSAtIFRPRE8gZml4IHRoaXMgd2hlbiB3ZSBnZXQgcGVyLUFQTgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5vdGlmaWNhdGlvbnMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RhdGUgPT0gUGhvbmUuRGF0YVN0YXRlLkNPTk5FQ1RFRCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsICJyZXBsYWNpbmcgb2xkIG1JbnRlcmZhY2VOYW1lICgiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSW50ZXJmYWNlTmFtZSArICIpIHdpdGggIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ZW50LmdldFN0cmluZ0V4dHJhKFBob25lLkRBVEFfSUZBQ0VfTkFNRV9LRVkpICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIGZvciAiICsgbUFwblR5cGUpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSW50ZXJmYWNlTmFtZSA9IGludGVudC5nZXRTdHJpbmdFeHRyYShQaG9uZS5EQVRBX0lGQUNFX05BTUVfS0VZKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgICAgICAgICB9Ci0KICAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCBtQXBuVHlwZSArICIgUmVjZWl2ZWQgc3RhdGU9ICIgKyBzdGF0ZSArICIsIG9sZD0gIiArCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU1vYmlsZURhdGFTdGF0ZSArICIsIHJlYXNvbj0gIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKHJlYXNvbiA9PSBudWxsID8gIih1bnNwZWNpZmllZCkiIDogcmVhc29uKSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIiwgYXBuVHlwZUxpc3Q9ICIgKyBhcG5UeXBlTGlzdCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHJlYXNvbiA9PSBudWxsID8gIih1bnNwZWNpZmllZCkiIDogcmVhc29uKSk7CiAKICAgICAgICAgICAgICAgICAgICAgaWYgKG1Nb2JpbGVEYXRhU3RhdGUgIT0gc3RhdGUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIG1Nb2JpbGVEYXRhU3RhdGUgPSBzdGF0ZTsKICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoc3RhdGUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIERJU0NPTk5FQ1RFRDoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaXNUZWFyZG93blJlcXVlc3RlZCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRW5hYmxlZCA9IGZhbHNlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VGVhcmRvd25SZXF1ZXN0ZWQoZmFsc2UpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKQEAgLTIxOCwxMSArMjM5LDE0IEBACiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGludGVudC5nZXRBY3Rpb24oKS4KICAgICAgICAgICAgICAgICAgICAgICAgIGVxdWFscyhUZWxlcGhvbnlJbnRlbnRzLkFDVElPTl9EQVRBX0NPTk5FQ1RJT05fRkFJTEVEKSkgewotICAgICAgICAgICAgICAgICAgICBtRW5hYmxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgYXBuVHlwZSA9IGludGVudC5nZXRTdHJpbmdFeHRyYShQaG9uZS5EQVRBX0FQTl9UWVBFX0tFWSk7CisgICAgICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmVxdWFscyhhcG5UeXBlLCBtQXBuVHlwZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBTdHJpbmcgcmVhc29uID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKFBob25lLkZBSUxVUkVfUkVBU09OX0tFWSk7CiAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBhcG5OYW1lID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKFBob25lLkRBVEFfQVBOX0tFWSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgIlJlY2VpdmVkICIgKyBpbnRlbnQuZ2V0QWN0aW9uKCkgKyAiIGJyb2FkY2FzdCIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlYXNvbiA9PSBudWxsID8gIiIgOiAiKCIgKyByZWFzb24gKyAiKSIpOworICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIG1BcG5UeXBlICsgIlJlY2VpdmVkICIgKyBpbnRlbnQuZ2V0QWN0aW9uKCkgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgYnJvYWRjYXN0IiArIHJlYXNvbiA9PSBudWxsID8gIiIgOiAiKCIgKyByZWFzb24gKyAiKSIpOwogICAgICAgICAgICAgICAgICAgICBzZXREZXRhaWxlZFN0YXRlKERldGFpbGVkU3RhdGUuRkFJTEVELCByZWFzb24sIGFwbk5hbWUpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBUZWxlcGhvbnlNYW5hZ2VyIHRtID0gVGVsZXBob255TWFuYWdlci5nZXREZWZhdWx0KCk7CkBAIC0zMjAsNzAgKzM0NCw4OCBAQAogICAgIC8qKgogICAgICAqIFRlYXIgZG93biBtb2JpbGUgZGF0YSBjb25uZWN0aXZpdHksIGkuZS4sIGRpc2FibGUgdGhlIGFiaWxpdHkgdG8gY3JlYXRlCiAgICAgICogbW9iaWxlIGRhdGEgY29ubmVjdGlvbnMuCisgICAgICogVE9ETyAtIG1ha2UgYXN5bmMgYW5kIHJldHVybiBub3RoaW5nPwogIC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hbiB3YXNDb25uZWN0aW5nID0gKG1OZXR3b3JrSW5mby5nZXRTdGF0ZSgpID09IE5ldHdvcmtJbmZvLlN0YXRlLkNPTk5FQ1RJTkcpOworICAgICAgICAgICAgU3RyaW5nIGxhc3RSZWFzb24gPSBtTmV0d29ya0luZm8uZ2V0UmVhc29uKCk7CisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogSWYgYSByZWFzb24gd2FzIHN1cHBsaWVkIHdoZW4gdGhlIENPTk5FQ1RJTkcgc3RhdGUgd2FzIGVudGVyZWQsIGFuZCBubworICAgICAgICAgICAgICogcmVhc29uIHdhcyBzdXBwbGllZCBmb3IgZW50ZXJpbmcgdGhlIENPTk5FQ1RFRCBzdGF0ZSwgdGhlbiByZXRhaW4gdGhlCisgICAgICAgICAgICAgKiByZWFzb24gdGhhdCB3YXMgc3VwcGxpZWQgd2hlbiBnb2luZyB0byBDT05ORUNUSU5HLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBpZiAod2FzQ29ubmVjdGluZyAmJiBzdGF0ZSA9PSBOZXR3b3JrSW5mby5EZXRhaWxlZFN0YXRlLkNPTk5FQ1RFRCAmJiByZWFzb24gPT0gbnVsbAorICAgICAgICAgICAgICAgICAgICAmJiBsYXN0UmVhc29uICE9IG51bGwpCisgICAgICAgICAgICAgICAgcmVhc29uID0gbGFzdFJlYXNvbjsKKyAgICAgICAgICAgIG1OZXR3b3JrSW5mby5zZXREZXRhaWxlZFN0YXRlKHN0YXRlLCByZWFzb24sIGV4dHJhSW5mbyk7CisgICAgICAgICAgICBNZXNzYWdlIG1zZyA9IG1UYXJnZXQub2J0YWluTWVzc2FnZShFVkVOVF9TVEFURV9DSEFOR0VELCBtTmV0d29ya0luZm8pOworICAgICAgICAgICAgbXNnLnNlbmRUb1RhcmdldCgpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHNldERldGFpbGVkU3RhdGVJbnRlcm5hbChOZXR3b3JrSW5mby5EZXRhaWxlZ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IGhhbmRsZWQuCi0gICAgICAgICAgICAgICAgbU1vYmlsZURhdGFTdGF0ZSA9IFBob25lLkRhdGFTdGF0ZS5DT05ORUNUSU5HOwotICAgICAgICAgICAgICAgIHNldERldGFpbGVkU3RhdGUoRGV0YWlsZWRTdGF0ZS5DT05ORUNUSU5HLCBQaG9uZS5SRUFTT05fQVBOX0NIQU5HRUQsIG51bGwpOwotICAgICAgICAgICAgICAgIC8vc2VuZCBvdXQgYSBjb25uZWN0ZWQgbWVzc2FnZQotICAgICAgICAgICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KFRlbGVwaG9ueUludGVudHMuCi0gICAgICAgICAgICAgICAgICAgICAgICBBQ1RJT05fQU5ZX0RBVEFfQ09OTkVDVElPTl9TVEFURV9DSEFOR0VEKTsKLSAgICAgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoUGhvbmUuU1RBVEVfS0VZLCBQaG9uZS5EYXRhU3RhdGUuQ09OTkVDVEVELnRvU3RyaW5nKCkpOwotICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShQaG9uZS5TVEFURV9DSEFOR0VfUkVBU09OX0tFWSwgUGhvbmUuUkVBU09OX0FQTl9DSEFOR0VEKTsKLSAgICAgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoUGhvbmUuREFUQV9BUE5fVFlQRVNfS0VZLCBtQXBuVHlwZVRvV2F0Y2hGb3IpOwotICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShQaG9uZS5EQVRBX0FQTl9LRVksIG1BcG5OYW1lKTsKLSAgICAgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoUGhvbmUuREFUQV9JRkFDRV9OQU1FX0tFWSwgbUludGVyZmFjZU5hbWUpOwotICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShQaG9uZS5ORVRXT1JLX1VOQVZBSUxBQkxFX0tFWSwgZmFsc2UpOwotICAgICAgICAgICAgICAgIGlmIChtU3RhdGVSZWNlaXZlciAhPSBudWxsKSBtU3RhdGVSZWNlaXZlci5vblJlY2VpdmUobUNvbnRleHQsIGludGVudCk7CisgICAgICAgICAgICAgICAgcmV0VmFsdWUgPSB0cnVlOwogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgY2FzZSBQaG9uZS5BUE5fUkVRVUVTVF9TVEFSVEVEOgotICAgICAgICAgICAgICAgIG1FbmFibGVkID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAvLyBubyBuZWVkIHRvIGRvIGFueXRoaW5nIC0gd2UncmUgYWxyZWFkeSBkdWUgc29tZSBzdGF0dXMgdXBkYXRlIGludGVudHMKKyAgICAgICAgICAgICAgICByZXRWYWx1ZSA9IHRydWU7CiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICBjYXNlIFBob25lLkFQTl9SRVFVRVNUX0ZBSUxFRDoKLSAgICAgICAgICAgICAgICBpZiAobVBob25lU2VydmljZSA9PSBudWxsICYmIG1BcG5UeXBlID09IFBob25lLkFQTl9UWVBFX0RFRkFVTFQpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gb24gc3RhcnR1cCB3ZSBtYXkgdHJ5IHRvIHRhbGsgdG8gdGhlIHBob25lIGJlZm9yZSBpdCdzIHJlYWR5Ci0gICAgICAgICAgICAgICAgICAgIC8vIHNpbmNlIHRoZSBwaG9uZSB3aWxsIGNvbWUgdXAgZW5hYmxlZCwgZ28gd2l0aCB0aGF0LgotICAgICAgICAgICAgICAgICAgICAvLyBUT0RPIC0gdGhpcyBhbHNvIGNvbWVzIHVwIG9uIHRlbGVwaG9ueSBjcmFzaDogaWYgd2UgdGhpbmsgbW9iaWxlIGRhdGEgaXMKLSAgICAgICAgICAgICAgICAgICAgLy8gb2ZmIGFuZCB0aGUgdGVsZXBob255IHN0dWZmIGNyYXNoZXMgYW5kIGhhcyB0byByZXN0YXJ0IGl0IHdpbGwgY29tZSB1cAotICAgICAgICAgICAgICAgICAgICAvLyBlbmFibGVkIChtYWtpbmcgYSBkYXRhIGNvbm5lY3Rpb24pLiAgV2Ugd2lsbCB0aGVuIGJlIG91dCBvZiBzeW5jLgotICAgICAgICAgICAgICAgICAgICAvLyBBIHBvc3NpYmxlIHNvbHV0aW9uIGlzIGEgYnJvYWRjYXN0IHdoZW4gdGVsZXBob255IHJlc3RhcnRzLgotICAgICAgICAgICAgICAgICAgICBtRW5hYmxlZCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgLy8gZWxzZSBmYWxsIHRocm91Z2gKICAgICAgICAgICAgIGNhc2UgUGhvbmUuQVBOX1RZUEVfTk9UX0FWQUlMQUJMRToKLSAgICAgICAgICAgICAgICAvLyBEZWZhdWx0IGlzIGFsd2F5cyBhdmFpbGFibGUsIGJ1dCBtYXkgYmUgb2ZmIGR1ZSB0bwotICAgICAgICAgICAgICAgIC8vIEFpcnBsYW5lTW9kZSBvciBFLUNhbGwgb3Igd2hhdGV2ZXIuLgotICAgICAgICAgICAgICAgIGlmIChtQXBuVHlwZSAhPSBQaG9uZS5BUE5fVFlQRV9ERUZBVUxUKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1FbmFibGVkID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJFcnJvciBpbiByZWNvbm5lY3QgLSB1bmV4cGVjdGVkIHJlc3BvbnNlLiIpOwotICAgICAgICAgICAgICAgIG1FbmFibGVkID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgIH0KLSAgICAgICAgcmV0dXJuIG1FbmFibGVkOworICAgICAgICByZXR1cm4gcmV0VmFsdWU7CiAgICAgfQogCiAgICAgLyoqCkBAIC00NTcsMjMgKzQ5OSw5IEBACiAgICAgfQogCiAgICAg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SB7Ci0gICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgIExvZy5kKFRBRywgImFkZFByaXZhdGVEbnNSb3V0ZXMgZm9yICIgKyB0aGlzICsKLSAgICAgICAgICAgICAgICAgICAgIigiICsgbUludGVyZmFjZU5hbWUgKyAiKSAtIG1Qcml2YXRlRG5zUm91dGVTZXQgPSAiK21Qcml2YXRlRG5zUm91dGVTZXQpOwotICAgICAgICB9Ci0gICAgICAgIGlmIChtSW50ZXJmYWNlTmFtZSAhPSBudWxsICYmICFtUHJpdmF0ZURuc1JvdXRlU2V0KSB7Ci0gICAgICAgICAgICBmb3IgKFN0cmluZyBhZGRyU3RyaW5nIDogZ2V0TmFtZVNlcnZlcnMoKSkgewotICAgICAgICAgICAgICAgIGludCBhZGRyID0gTmV0d29ya1V0aWxzLmxvb2t1cEhvc3QoYWRkclN0cmluZyk7Ci0gICAgICAgICAgICAgICAgaWYgKGFkZHIgIT0gLTEgJiYgYWRkciAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgIiAgYWRkaW5nICIrYWRkclN0cmluZysiICgiK2FkZHIrIikiKTsKLSAgICAgICAgICAgICAgICAgICAgTmV0d29ya1V0aWxzLmFkZEhvc3RSb3V0ZShtSW50ZXJmYWNlTmFtZSwgYWRkcik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgbVByaXZhdGVEbnNSb3V0ZVNldCA9IHRydWU7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBwdWJsaWMgdm9pZCByZW1vdmVQcml2YXRlRG5zUm91dGVzKCkgewotICAgICAgICAvLyBUT0RPIC0gd2Ugc2hvdWxkIGRvIHRoaXMgZXhwbGljaXRseSBidXQgdGhlIE5ldFV0aWxzIGFwaSBkb2VzbnQKLSAgICAgICAgLy8gc3VwcG9ydCB0aGlzIHlldCAtIG11c3QgcmVtb3ZlIGFsbC4gIE5vIHdvcnNlIHRoYW4gYmVmb3JlCi0gICAgICAgIGlmIChtSW50ZXJmYWNlTmFtZSAhPSBudWxsICYmIG1Qcml2YXRlRG5zUm91dGVTZXQpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJyZW1vdmVQcml2YXRlRG5zUm91dGVzIGZvciAiICsgbU5ldHdvcmtJbmZvLmdldFR5cGVOYW1lKCkgKwotICAgICAgICAgICAgICAgICAgICAgICAgIiAoIiArIG1JbnRlcmZhY2VOYW1lICsgIikiKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIE5ldHdvcmtVdGlscy5yZW1vdmVIb3N0Um91dGVzKG1JbnRlcmZhY2VOYW1lKTsKLSAgICAgICAgICAgIG1Qcml2YXRlRG5zUm91dGVTZXQgPSBmYWxzZTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHB1YmxpYyB2b2lkIGFkZERlZmF1bHRSb3V0ZSgpIHsKLSAgICAgICAgaWYgKChtSW50ZXJmYWNlTmFtZSAhPSBudWxsKSAmJiAobURlZmF1bHRHYXRld2F5QWRkciAhPSAwKSAmJgotICAgICAgICAgICAgICAgIG1EZWZhdWx0Um91dGVTZXQgPT0gZmFsc2UpIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJhZGREZWZhdWx0Um91dGUgZm9yICIgKyBtTmV0d29ya0luZm8uZ2V0VHlwZU5hbWUoKSArCi0gICAgICAgICAgICAgICAgICAgICAgICAiICgiICsgbUludGVyZmFjZU5hbWUgKyAiKSwgR2F0ZXdheUFkZHI9IiArIG1EZWZhdWx0R2F0ZXdheUFkZHIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgTmV0d29ya1V0aWxzLnNldERlZmF1bHRSb3V0ZShtSW50ZXJmYWNlTmFtZSwgbURlZmF1bHRHYXRld2F5QWRkcik7Ci0gICAgICAgICAgICBtRGVmYXVsdFJvdXRlU2V0ID0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50ZXJjZXB0b3IgdGhyb3dzIGFuIGV4Y2VwdGlvbiBpZiB0aGUgZXhlY3V0aW5nIHRocmVhZCBpcyBibG9ja2VkICovCiAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgSHR0cFJlcXVlc3RJbnRlcmNlcHRvciBzVGhyZWFkQ2hlY2tJbnRlcmNlcHRvciA9CkBAIC0zNTgsNyArMzY0LDcgQEAKICAgICAgICAgfQogICAgICAgICBpZiAobGV2ZWwgPCBMb2cuVkVSQk9TRSB8fCBsZXZlbCA+IExvZy5BU1NFUlQpIHsKICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkxldmVsIGlzIG91dCBvZiByYW5nZSBbIgotICAgICAgICAgICAgICAgICsgTG9nLlZFUkJPU0UgKyAiLi4iICsgTG9nLkFTU0VSVCArICJdIik7ICAgIAorICAgICAgICAgICAgICAgICsgTG9nLlZFUkJPU0UgKyAiLi4iICsgTG9nLkFTU0VSVCArICJdIik7CiAgICAgICAgIH0KIAogICAgICAgICBjdXJsQ29uZmlndXJhdGlvbiA9IG5ldyBMb2dnaW5nQ29uZmlndXJhdGlvbihuYW1lLCBsZXZlbCk7CkBAIC00MzEsMTIgKzQzNywxNyBAQAogICAgICAgICAgICAgICAgIGlmIChlbnRpdHkuZ2V0Q29udGVudExlbmd0aCgpIDwgMTAyNCkgewogICAgICAgICAgICAgICAgICAgICBCeXRlQXJyYXlPdXRwdXRTdHJlYW0gc3RyZWFtID0gbmV3IEJ5dGVBcnJheU91dHB1dFN0cmVhbSgpOwogICAgICAgICAgICAgICAgICAgICBlbnRpdHkud3JpdGVUbyhzdHJlYW0pOwotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgZW50aXR5U3RyaW5nID0gc3RyZWFtLnRvU3RyaW5nKCk7CiAKLSAgICAgICAgICAgICAgICAgICAgLy8gVE9ETzogQ2hlY2sgdGhlIGNvbnRlbnQgdHlwZSwgdG9vLgotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiIC0tZGF0YS1hc2NpaSBcIiIpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZChlbnRpdHlTdHJpbmcpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgiXCIiKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGlzQmluYXJ5Q29udGVudChyZXF1ZXN0KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGJhc2U2NCA9IEJhc2U2NC5lbmNvZGVUb1N0cmluZyhzdHJlYW0udG9CeXRlQXJyYXkoKSwgQmFzZTY0Lk5PX1dSQVApOworICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5pbnNlcnQoMCwgImVjaG8gJyIgKyBiYXNlNjQgKyAiJyB8IGJhc2U2NCAtZCA+IC90bXAvJCQuYmluOyAiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIgLS1kYXRhLWJpbmFyeSBAL3RtcC8kJC5iaW4iKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBlbnRpdHlTdHJpbmcgPSBzdHJlYW0udG9TdHJpbmcoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIgLS1kYXRhLWFzY2lpIFwiIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZChlbnRpdHlTdHJpbmcpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoIlwiIik7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiIFtUT08gTVVDSCBEQVRBIFRPIElOQ0xVREVdIik7CiAgICAgICAgICAgICAgICAgfQpAQCAtNDQ2LDYgKzQ1NywzMCBAQAogICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOwogICAgIH0KIAorICAgIHByaXZhdGUgc3RhdGljIGJvb2xlYW4gaXNCaW5hcnlDb250ZW50KEh0dHBVcmlSZXF1ZXN0IHJlcXVlc3QpIHsKKyAgICAgICAgSGVhZGVyW10gaGVhZGVyczsKKyAgICAgICAgaGVhZGVycyA9IHJlcXVlc3QuZ2V0SGVhZGVycyhIZWFkZXJzLkNPTlRFTlRfRU5DT0RJTkcpOworICAgICAgICBpZiAoaGVhZGVycyAhPSBudWxsKSB7CisgICAgICAgICAgICBmb3IgKEhlYWRlciBoZWFkZXIgOiBoZWFkZXJzKSB7CisgICAgICAgICAgICAgICAgaWYgKCJnemlwIi5lcXVhbHNJZ25vcmVDYXNlKGhlYWRlci5nZXRWYWx1ZSgpKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBoZWFkZXJzID0gcmVxdWVzdC5nZXRIZWFkZXJzKEhlYWRlcnMuQ09OVEVOVF9UWVBFKTsKKyAgICAgICAgaWYgKGhlYWRlcnMgIT0gbnVsbCkgeworICAgICAgICAgICAgZm9yIChIZWFkZXIgaGVhZGVyIDogaGVhZGVycykgeworICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIGNvbnRlbnRUeXBlIDogdGV4dENvbnRlbnRUeXBlcykgeworICAgICAgICAgICAgICAgICAgICBpZiAoaGVhZGVyLmdldFZhbHVlKCkuc3RhcnRzV2l0aChjb250ZW50VHlwZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisKICAgICAvKioKICAgICAgKiBSZXR1cm5zI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sdWVzIGdldFByaW1hcnlDb250ZW50VmFsdWUoZmluYWwgTGlzdDxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICBDb250ZW50VmFsdWVzIHByaW1hcnlDb250ZW50VmFsdWVzID0gbnVsbDsKLSAgICAgICAgQ29udGVudFZhbHVlcyBzdWJwcmltYXJ5Q29udGVudFZhbHVlcyA9IG51bGw7Ci0gICAgICAgIGZvciAoQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzIDogY29udGVudFZhbHVlc0xpc3QpIHsKLSAgICAgICAgICAgIGlmIChjb250ZW50VmFsdWVzID09IG51bGwpewotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgSW50ZWdlciBpc1N1cGVyUHJpbWFyeSA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNJbnRlZ2VyKFN0cnVjdHVyZWROYW1lLklTX1NVUEVSX1BSSU1BUlkpOwotICAgICAgICAgICAgaWYgKGlzU3VwZXJQcmltYXJ5ICE9IG51bGwgJiYgaXNTdXBlclByaW1hcnkgPiAwKSB7Ci0gICAgICAgICAgICAgICAgLy8gV2UgY2hvb3NlICJzdXBlciBwcmltYXJ5IiBDb250ZW50VmFsdWVzLgotICAgICAgICAgICAgICAgIHByaW1hcnlDb250ZW50VmFsdWVzID0gY29udGVudFZhbHVlczsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAocHJpbWFyeUNvbnRlbnRWYWx1ZXMgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIC8vIFdlIGNob29zZSB0aGUgZmlyc3QgInByaW1hcnkiIENvbnRlbnRWYWx1ZXMKLSAgICAgICAgICAgICAgICAvLyBpZiAic3VwZXIgcHJpbWFyeSIgQ29udGVudFZhbHVlcyBkb2VzIG5vdCBleGlzdC4KLSAgICAgICAgICAgICAgICBmaW5hbCBJbnRlZ2VyIGlzUHJpbWFyeSA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNJbnRlZ2VyKFN0cnVjdHVyZWROYW1lLklTX1BSSU1BUlkpOwotICAgICAgICAgICAgICAgIGlmIChpc1ByaW1hcnkgIT0gbnVsbCAmJiBpc1ByaW1hcnkgPiAwICYmCi0gICAgICAgICAgICAgICAgICAgICAgICBjb250YWluc05vbkVtcHR5TmFtZShjb250ZW50VmFsdWVzKSkgewotICAgICAgICAgICAgICAgICAgICBwcmltYXJ5Q29udGVudFZhbHVlcyA9IGNvbnRlbnRWYWx1ZXM7Ci0gICAgICAgICAgICAgICAgICAgIC8vIERvIG5vdCBicmVhaywgc2luY2UgdGhlcmUgbWF5IGJlIENvbnRlbnRWYWx1ZXMgd2l0aCAic3VwZXIgcHJpbWFyeSIKLSAgICAgICAgICAgICAgICAgICAgLy8gYWZ0ZXJ3b3JkLgotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc3VicHJpbWFyeUNvbnRlbnRWYWx1ZXMgPT0gbnVsbCAmJgotICAgICAgICAgICAgICAgICAgICAgICAgY29udGFpbnNOb25FbXB0eU5hbWUoY29udGVudFZhbHVlcykpIHsKLSAgICAgICAgICAgICAgICAgICAgc3VicHJpbWFyeUNvbnRlbnRWYWx1ZXMgPSBjb250ZW50VmFsdWVzOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChwcmltYXJ5Q29udGVudFZhbHVlcyA9PSBudWxsKSB7Ci0gICAgICAgICAgICBpZiAoc3VicHJpbWFyeUNvbnRlbnRWYWx1ZXMgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIC8vIFdlIGNob29zZSB0aGUgZmlyc3QgQ29udGVudFZhbHVlcyBpZiBhbnkgInByaW1hcnkiIENvbnRlbnRWYWx1ZXMgZG9lcyBub3QgZXhpc3QuCi0gICAgICAgICAgICAgICAgcHJpbWFyeUNvbnRlbnRWYWx1ZXMgPSBzdWJwcmltYXJ5Q29ud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Xh0VXRpbHMuaXNFbXB0eShnaXZlbk5hbWUpKSB7Ci0gICAgICAgICAgICBmaW5hbCBib29sZWFuIHJlYWxseUFwcGVuZENoYXJzZXRQYXJhbWV0ZXJUb05hbWUgPQotICAgICAgICAgICAgICAgICAgICBzaG91bGRBcHBlbmRDaGFyc2V0UGFyYW0oZmFtaWx5TmFtZSwgZ2l2ZW5OYW1lLCBtaWRkbGVOYW1lLCBwcmVmaXgsIHN1ZmZpeCk7Ci0gICAgICAgICAgICBmaW5hbCBib29sZWFuIHJlYWxseVVzZVF1b3RlZFByaW50YWJsZVRvTmFtZSA9Ci0gICAgICAgICAgICAgICAgICAgICghbVJlZnJhaW5zUVBUb05hbWVQcm9wZXJ0aWVzICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIShWQ2FyZFV0aWxzLmNvbnRhaW5zT25seU5vbkNyTGZQcmludGFibGVBc2NpaShmYW1pbHlOYW1lKSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVkNhcmRVdGlscy5jb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkoZ2l2ZW5OYW1lKSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVkNhcmRVdGlscy5jb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkobWlkZGxlTmFtZSkgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZDYXJkVXRpbHMuY29udGFpbnNPbmx5Tm9uQ3JMZlByaW50YWJsZUFzY2lpKHByZWZpeCkgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZDYXJkVXRpbHMuY29udGFpbnNPbmx5Tm9uQ3JMZlByaW50YWJsZUFzY2lpKHN1ZmZpeCkpKTsKLQotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGZvcm1hdHRlZE5hbWU7Ci0gICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KGRpc3BsYXlOYW1lKSkgewotICAgICAgICAgICAgICAgIGZvcm1hdHRlZE5hbWUgPSBkaXNwbGF5TmFtZTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgZm9ybWF0dGVkTmFtZSA9IFZDYXJkVXRpbHMuY29uc3RydWN0TmFtZUZyb21FbGVtZW50cygKLSAgICAgICAgICAgICAgICAgICAgICAgIFZDYXJkQ29uZmlnLmdldE5hbWVPcmRlclR5cGUobVZDYXJkVHlwZSksCi0gICAgICAgICAgICAgICAgICAgICAgICBmYW1pbHlOYW1lLCBtaWRkbGVOYW1lLCBnaXZlbk5hbWUsIHByZWZpeCwgc3VmZml4KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gcmVhbGx5QXBwZW5kQ2hhcnNldFBhcmFtZXRlclRvRk4gPQotICAgICAgICAgICAgICAgICAgICBzaG91bGRBcHBlbmRDaGFyc2V0UGFyYW0oZm9ybWF0dGVkTmFtZSk7Ci0gICAgICAgICAgICBmaW5hbCBib29sZWFuIHJlYWxseVVzZVF1b3RlZFByaW50YWJsZVRvRk4gPQotICAgICAgICAgICAgICAgICAgICAhbVJlZnJhaW5zUVBUb05hbWVQcm9wZXJ0aWVzICYmCi0gICAgICAgICAgICAgICAgICAgICFWQ2FyZFV0aWxzLmNvbnRhaW5zT25seU5vbkNyTGZQcmludGFibGVBc2NpaShmb3JtYXR0ZWROYW1lKTsKLQotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGVuY29kZWRGYW1pbHk7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgZW5jb2RlZEdpdmVuOwotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGVuY29kZWRNaWRkbGU7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgZW5jb2RlZFByZWZpeDsKLSAgICAgICAgICAgIGZpbmFsIFN0cmluZyBlbmNvZGVkU3VmZml4OwotICAgICAgICAgICAgaWYgKHJlYW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kKFZDQVJEX0lURU1fU0VQQVJBVE9SKTsKLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfSVRFTV9TRVBBUkFUT1IpOwotICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9JVEVNX1NFUEFSQVRPUik7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGlmIChyZWFsbHlBcHBlbmRDaGFyc2V0UGFyYW1ldGVyVG9OYW1lKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9QQVJBTV9TRVBBUkFUT1IpOwotICAgICAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQobVZDYXJkQ2hhcnNldFBhcmFtZXRlcik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChyZWFsbHlVc2VRdW90ZWRQcmludGFibGVUb05hbWUpIHsKLSAgICAgICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX1BBUkFNX1NFUEFSQVRPUik7Ci0gICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9QQVJBTV9FTkNPRElOR19RUCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9EQVRBX1NFUEFSQVRPUik7Ci0gICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKGVuY29kZWRGYW1pbHkpOwotICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9JVEVNX1NFUEFSQVRPUik7Ci0gICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKGVuY29kZWRHaXZlbik7Ci0gICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX0lURU1fU0VQQVJBVE9SKTsKLSAgICAgICAgICAgICAgICBtQnVpbGRl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oZW5jb2RlZEZvcm1hdHRlZG5hbWUpOwotICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX0VORF9PRl9MSU5FKTsKLSAgICAgICAgfSBlbHNlIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoZGlzcGxheU5hbWUpKSB7Ci0gICAgICAgICAgICBmaW5hbCBib29sZWFuIHJlYWxseVVzZVF1b3RlZFByaW50YWJsZVRvRGlzcGxheU5hbWUgPQotICAgICAgICAgICAgICAgICghbVJlZnJhaW5zUVBUb05hbWVQcm9wZXJ0aWVzICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAhVkNhcmRVdGlscy5jb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkoZGlzcGxheU5hbWUpKTsKLSAgICAgICAgICAgIGZpbmFsIFN0cmluZyBlbmNvZGVkRGlzcGxheU5hbWUgPQotICAgICAgICAgICAgICAgICAgICByZWFsbHlVc2VRdW90ZWRQcmludGFibGVUb0Rpc3BsYXlOYW1lID8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmNvZGVRdW90ZWRQcmludGFibGUoZGlzcGxheU5hbWUpIDoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNjYXBlQ2hhcmFjdGVycyhkaXNwbGF5TmFtZSk7Ci0KLSAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ2FyZENvbnN0YW50cy5QUk9QRVJUWV9OKTsKLSAgICAgICAgICAgIGlmIChzaG91bGRBcHBlbmRDaGFyc2V0UGFyYW0oZGlzcGxheU5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX1BBUkFNX1NFUEFSQVRPUik7Ci0gICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKG1WQ2FyZENoYXJzZXRQYXJhbWV0ZXIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKHJlYWxseVVzZVF1b3RlZFByaW50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RfSVRFTV9TRVBBUkFUT1IpOwotICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9FTkRfT0ZfTElORSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBUcnkgdG8gZW1pdCB0aGUgZmllbGQocykgcmVsYXRlZCB0byBwaG9uZXRpYyBuYW1lLgotICAgICAgICBpZiAobUlzVjMwKSB7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgc29ydFN0cmluZyA9IFZDYXJkVXRpbHMKLSAgICAgICAgICAgICAgICAgICAgLmNvbnN0cnVjdE5hbWVGcm9tRWxlbWVudHMobVZDYXJkVHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaG9uZXRpY0ZhbWlseU5hbWUsIHBob25ldGljTWlkZGxlTmFtZSwgcGhvbmV0aWNHaXZlbk5hbWUpOwotICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDYXJkQ29uc3RhbnRzLlBST1BFUlRZX1NPUlRfU1RSSU5HKTsKLSAgICAgICAgICAgIGlmIChzaG91bGRBcHBlbmRDaGFyc2V0UGFyYW0oc29ydFN0cmluZykpIHsKLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfUEFSQU1fU0VQQVJBVE9SKTsKLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQobVZDYXJkQ2hhcnNldFBhcmFtZXRlcik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfREFUQV9TRVBBUkFUT1IpOwotICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKGVzY2FwZUNoYXJhY3RlcnMoc29ydFN0cmluZykpOwotICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX0VORF9PRl9MSU5FKTsKLSAgICAgICAgfSBlbHNlIGlmIChtSXNKYX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9TT1VORCk7Ci0gICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfUEFSQU1fU0VQQVJBVE9SKTsKLSAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX1hfSVJNQ19OKTsKLQotICAgICAgICAgICAgYm9vbGVhbiByZWFsbHlVc2VRdW90ZWRQcmludGFibGUgPQotICAgICAgICAgICAgICAgICghbVJlZnJhaW5zUVBUb05hbWVQcm9wZXJ0aWVzCi0gICAgICAgICAgICAgICAgICAgICAgICAmJiAhKFZDYXJkVXRpbHMuY29udGFpbnNPbmx5Tm9uQ3JMZlByaW50YWJsZUFzY2lpKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaG9uZXRpY0ZhbWlseU5hbWUpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIFZDYXJkVXRpbHMuY29udGFpbnNPbmx5Tm9uQ3JMZlByaW50YWJsZUFzY2lpKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBob25ldGljTWlkZGxlTmFtZSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgVkNhcmRVdGlscy5jb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGhvbmV0aWNHaXZlbk5hbWUpKSk7Ci0KLSAgICAgICAgICAgIGZpbmFsIFN0cmluZyBlbmNvZGVkUGhvbmV0aWNGYW1pbHlOYW1lOwotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGVuY29kZWRQaG9uZXRpY01pZGRsZU5hbWU7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgZW5jb2RlZFBob25ldGljR2l2ZW5OYW1lOwotICAgICAgICAgICAgaWYgKHJlYWxseVVzZVF1b3RlZFByaW50YWJsZSkgewotICAgICAgICAgICAgICAgIGVuY29kZWRQaG9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V9TRVBBUkFUT1IpOwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGJvb2xlYW4gZmlyc3QgPSB0cnVlOwotICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoZW5jb2RlZFBob25ldGljRmFtaWx5TmFtZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKGVuY29kZWRQaG9uZXRpY0ZhbWlseU5hbWUpOwotICAgICAgICAgICAgICAgICAgICBmaXJzdCA9IGZhbHNlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KGVuY29kZWRQaG9uZXRpY01pZGRsZU5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChmaXJzdCkgewotICAgICAgICAgICAgICAgICAgICAgICAgZmlyc3QgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZCgnICcpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChlbmNvZGVkUGhvbmV0aWNNaWRkbGVOYW1lKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShlbmNvZGVkUGhvbmV0aWNHaXZlbk5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICghZmlyc3QpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZCgnICcpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChlbmNvZGVkUGhvbmV0aWNHaXZlbk5hbWUpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9JVEVNX1NFUEFSQVRPUik7Ci0gICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfSVRFTV9TRVBBUkFUT1IpOwotICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX0lURU1fU0VQQVJBVE9SKTsKLSAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9JVEVNX1NFUEFSQVRPUik7Ci0gICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfRU5EX09GX0xJTkUpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKG1Vc2VzRGVmYWN0UHJvcGVydHkpIHsKLSAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkocGhvbmV0aWNHaXZlbk5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgYm9vbGVhbiByZWFsbHlVc2VRdW90ZWRQcmludGFibGUgPQotICAgICAgICAgICAgICAgICAgICAobVNob3VsZFVzZVF1b3RlZFByaW50YWJsZSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICFWQ2FyZFV0aWxzLmNvbnRhaW5zT25seU5vbkNyTGZQcmludGFibGVBc2NpaShwaG9uZXRpY0dpdmVuTmFtZSkpOwotICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBlbmNvZGVkUGhvbmV0aWNHaXZlbk5hbWU7Ci0gICAgICAgICAgICAgICAgaWYgKHJlYWxseVVzZVF1b3RlZFByaW50YWJsZSkgewotICAgICAgICAgICAgICAgICAgICBlbmNvZGVkUGhvbmV0aWNHaXZlbk5hbWUgPSBlbmNvZGVRdW90ZWRQcmludGFibGUocGhvbmV0aWNHaXZlbk5hbWUpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGVuY29kZWRQaG9uZXRpY0dpdmVuTmFtZSA9IGVzY2FwZUNoYXJhY3RlcnMocGhvbmV0aWNHaXZlbk5hbWUpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNhcmRDb25zdGFudHMuUFJPUEVSVFlfWF9QSE9ORVRJQ19GSVJTVF9OQU1FKTsKLSAgICAgICAgICAgICAgICBpZiAoc2hvdWxkQXBwZW5kQ2hhcnNldFBhcmFtKHBob25ldGljR2l2ZW5OYW1lKSkgewotICAgICAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfUEFSQU1fU0VQQVJBVE9SKTsKLSAgICAgICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKG1WQ2FyZENoYXJzZXRQYXJhbWV0ZXIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAocmVhbGx5VXNlUXVvdGVkUHJpbnRhYmxlKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9QQVJBTV9TRVBBUkFUT1IpOwotICAgICAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfUEFSQU1fRU5DT0RJTkdfUVApOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfREFUQV9TRVBBUkFUT1IpOwotICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChlbmNvZGVkUGhvbmV0aWNHaXZlbk5hbWUpOwotICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9FTkRfT0ZfTElORSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHBob25ldGljTWlkZGxlTmFtZSkpIHsKLSAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIHJlYWxseVVzZVF1b3RlZFByaW50YWJsZSA9Ci0gICAgICAgICAgICAgICAgICAgIChtU2hvdWxkVXNlUXVvdGVkUHJpbnRhYmxlICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIVZDYXJkVXRpbHMuY29udGFpbnNPbmx5Tm9uQ3JMZlByaW50YWJsZUFzY2lpKHBob25ldGljTWlkZGxlTmFtZSkpOwotICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBlbmNvZGVkUGhvbmV0aWNNaWRkbGVOYW1lOwotICAgICAgICAgICAgICAgIGlmIChyZWFsbHlVc2VRdW90ZWRQcmludGFibGUpIHsKLSAgICAgICAgICAgICAgICAgICAgZW5jb2RlZFBob25ldGljTWlkZGxlTmFtZSA9IGVuY29kZVF1b3RlZFByaW50YWJsZShwaG9uZXRpY01pZGRsZU5hbWUpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGVuY29kZWRQaG9uZXRpY01pZGRsZU5hbWUgPSBlc2NhcGVDaGFyYWN0ZXJzKHBob25ldGljTWlkZGxlTmFtZSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ2FyZENvbnN0YW50cy5QUk9QRVJUWV9YX1BIT05FVElDX01JRERMRV9OQU1FKTsKLSAgICAgICAgICAgICAgICBpZiAoc2hvdWxkQXBwZW5kQ2hhcnNldFBhcmFtKHBob25ldGljTWlkZGxlTmFtZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX1BBUkFNX1NFUEFSQVRPUik7Ci0gICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChtVkNhcmRDaGFyc2V0UGFyYW1ldGVyKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKHJlYWxseVVzZVF1b3RlZFByaW50YWJsZSkgewotICAgICAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfUEFSQU1fU0VQQVJBVE9SKTsKLSAgICAgICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX1BBUkFNX0VOQ09ESU5HX1FQKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX0RBVEFfU0VQQVJBVE9SKTsKLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoZW5jb2RlZFBob25ldGljTWlkZGxlTmFtZSk7Ci0gICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX0VORF9PRl9MSU5FKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkocGhvbmV0aWNGYW1pbHlOYW1lKSkgewotICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gcmVhbGx5VXNlUXVvdGVkUHJpbnRhYmxlID0KLSAgICAgICAgICAgICAgICAgICAgKG1TaG91bGRVc2VRdW90ZWRQcmludGFibGUgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAhVkNhcmRVdGlscy5jb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkocGhvbmV0aWNGYW1pbHlOYW1lKSk7Ci0gICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIGVuY29kZWRQaG9uZXRpY0ZhbWlseU5hbWU7Ci0gICAgICAgICAgICAgICAgaWYgKHJlYWxseVVzZVF1b3RlZFByaW50YWJsZSkgewotICAgICAgICAgICAgICAgICAgICBlbmNvZGVkUGhvbmV0aWNGYW1pbHlOYW1lID0gZW5jb2RlUXVvdGVkUHJpbnRhYmxlKHBob25ldGljRmFtaWx5TmFtZSk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgZW5jb2RlZFBob25ldGljRmFtaWx5TmFtZSA9IGVzY2FwZUNoYXJhY3RlcnMocGhvbmV0aWNGYW1pbHlOYW1lKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgb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HVzZUFuZHJvaWRQcm9wZXJ0eSA9IGZhbHNlOwotICAgICAgICB9IGVsc2UgaWYgKG1Vc2VzQW5kcm9pZFByb3BlcnR5KSB7Ci0gICAgICAgICAgICB1c2VBbmRyb2lkUHJvcGVydHkgPSB0cnVlOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgLy8gVGhlcmUncyBubyB3YXkgdG8gYWRkIHRoaXMgZmllbGQuCi0gICAgICAgICAgICByZXR1cm4gdGhpczsKLSAgICAgICAgfQotICAgICAgICBpZiAoY29udGVudFZhbHVlc0xpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgZm9yIChDb250ZW50VmFsdWVzIGNvbnRlbnRWYWx1ZXMgOiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBuaWNrbmFtZSA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNTdHJpbmcoTmlja25hbWUuTkFNRSk7Ci0gICAgICAgICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KG5pY2tuYW1lKSkgewotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKHVzZUFuZHJvaWRQcm9wZXJ0eSkgewotICAgICAgICAgICAgICAgICAgICBhcHBlbmRBbmRyb2lkU3BlY2lmaWNQcm9wZXJ0eShOaWNrbmFtZS5DT05URU5UX0lURU1fVFlQRSwgY29udGVudFZhbHVlcyk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgYXBwZW5kTGluZVdpdGhDaGFyc2V0QW5kUVBEZXRlY3Rpb24oVkNhcmRDb25zdGFudHMuUFJPUEVSVFlfTklDS05BTUUsIG5pY2tuYW1lKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHRoaXM7Ci0gICAgfQotCi0gICAgcHVibGljIFZDYXJkQnVpbGRlciBhcHBlbmRQaG9uZXMoZmluYWwgTGlzdDxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICBib29sZWFuIHBob25lTGluZUV4aXN0cyA9IGZhbHNlOwotICAgICAgICBpZiAoY29udGVudFZhbHVlc0xpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgU2V0PFN0cmluZz4gcGhvbmVTZXQgPSBuZXcgSGFzaFNldDxTdHJpbmc+KCk7Ci0gICAgICAgICAgICBmb3IgKENvbnRlbnRWYWx1ZXMgY29udGVudFZhbHVlcyA6IGNvbnRlbnRWYWx1ZXNMaXN0KSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgSW50ZWdlciB0eXBlQXNPYmplY3QgPSBjb250ZW50VmFsdWVzLmdldEFzSW50ZWdlcihQaG9uZS5UWVBFKTsKLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgbGFiZWwgPSBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKFBob25lLkxBQkVMKTsKLSAgICAgICAgICAgICAgICBmaW5hbCBJbnRlZ2VyIGlzUHJpbWFyeUFzSW50ZWdlciA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNJbnRlZ2VyKFBob25lLklTX1BSSU1BUlkpOwotICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gaXNQcmltYXJ5ID0gKGlzUHJpbWFyeUFzSW50ZWdlciAhPSBudWxsID8KLSAgICAgICAgICAgICAgICAgICAgICAgIChpc1ByaW1hcnlBc0ludGVnZXIgPiAwKSA6IGZhbHNlKTsKLSAgICAgICAgICAgICAgICBTdHJpbmcgcGhvbmVOdW1iZXIgPSBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKFBob25lLk5VTUJFUik7Ci0gICAgICAgICAgICAgICAgaWYgKHBob25lTnVtYmVyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgcGhvbmVOdW1iZXIgPSBwaG9uZU51bWJlci50cmltKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eShwaG9uZU51bWJlcikpIHsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLy8gUEFHRVIgbnVtYmVyIG5lZWRzIHVuZm9ybWF0dGVkICJwaG9uZSBudW1iZXIiLgotICAgICAgICAgICAgICAgIGZpbmFsIGludCB0eXBlID0gKHR5cGVBc09iamVjdCAhPSBudWxsID8gdHlwZUFzT2JqZWN0IDogREVGQVVMVF9QSE9ORV9UWVBFKTsKLSAgICAgICAgICAgICAgICBpZiAodHlwZSA9PSBQaG9uZS5UWVBFX1BBR0VSIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICBWQ2FyZENvbmZpZy5yZWZyYWluUGhvbmVOdW1iZXJGb3JtYXR0aW5nKG1WQ2FyZFR5cGUpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHBob25lTGluZUV4aXN0cyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIGlmICghcGhvbmVTZXQuY29udGFpbnMocGhvbmVOdW1iZXIpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwaG9uZVNldC5hZGQocGhvbmVOdW1iZXIpOwotICAgICAgICAgICAgICAgICAgICAgICAgYXBwZW5kVGVsTGluZSh0eXBlLCBsYWJlbCwgcGhvbmVOdW1iZXIsIGlzUHJpbWFyeSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBmaW5hbCBMaXN0PFN0cmluZz4gcGhvbmVOdW1iZXJMaXN0ID0gc3BsaXRBbmRUcmltUGhvbmVOdW1iZXJzKHBob25lTnVtYmVyKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHBob25lTnVtYmVyTGlzdC5pc0VtcHR5KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHBob25lTGluZUV4aXN0cyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIGFjdHVhbFBob25lTnVtYmVyIDogcGhvbmVOdW1iZXJMaXN0KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXBob25lU2V0LmNvbnRhaW5zKGFjdHVhbFBob25lTnVtYmVyKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBmb3JtYXQgPSBWQ2FyZFV0aWxzLmdldFBob25lTnVtYmVyRm9ybWF0KG1WQ2FyZFR5cGUpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBmb3JtYXR0ZWRQaG9uZU51bWJlciA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQaG9uZU51bWJlclV0aWxzLmZvcm1hdE51bWJlcihhY3R1YWxQaG9uZU51bWJlciwgZm9ybWF0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaG9uZVNldC5hZGQoYWN0dWFsUGhvbmVOdW1iZXIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcGVuZFRlbExpbmUodHlwZSwgbGFiZWwsIGZvcm1hdHRlZFBob25lTnVtYmVyLCBpc1ByaW1hcnkpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9ICAvLyBmb3IgKFN0cmluZyBhY3R1YWxQaG9uZU51bWJlciA6IHBob25lTnVtYmVyTGlzdCkgewotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmICghcGhvbmVMaW5lRXhpc3RzICYmIG1Jc0RvQ29NbykgewotICAgICAgICAgICAgYXBwZW5kVGVsTGluZShQaG9uZS5UWVBFX0hPT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sZGVyLmxlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgICAgIHBob25lTGlzdC5hZGQoYnVpbGRlci50b1N0cmluZygpKTsKLSAgICAgICAgICAgICAgICBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBpZiAoYnVpbGRlci5sZW5ndGgoKSA+IDApIHsKLSAgICAgICAgICAgIHBob25lTGlzdC5hZGQoYnVpbGRlci50b1N0cmluZygpKTsKLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiBwaG9uZUxpc3Q7Ci0gICAgfQotCi0gICAgcHVibGljIFZDYXJkQnVpbGRlciBhcHBlbmRFbWFpbHMoZmluYWwgTGlzdDxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICBib29sZWFuIGVtYWlsQWRkcmVzc0V4aXN0cyA9IGZhbHNlOwotICAgICAgICBpZiAoY29udGVudFZhbHVlc0xpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgZmluYWwgU2V0PFN0cmluZz4gYWRkcmVzc1NldCA9IG5ldyBIYXNoU2V0PFN0cmluZz4oKTsKLSAgICAgICAgICAgIGZvciAoQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzIDogY29udGVudFZhbHVlc0xpc3QpIHsKLSAgICAgICAgICAgICAgICBTdHJpbmcgZW1haWxBZGRyZXNzID0gY29udGVudFZhbHVlcy5nZXRBc1N0cmluZyhFbWFpbC5EQVRBKTsKLSAgICAgICAgICAgICAgICBpZiAoZW1haWxBZGRyZXNzICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgZW1haWxBZGRyZXNzID0gZW1haWxBZGRyZXNzLnRyaW0oKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KGVtYWlsQWRkcmVzcykpIHsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIEludGVnZXIgdHlwZUFzT2JqZWN0ID0gY29udGVudFZhbHVlcy5nZXRBc0ludGVnZXIoRW1haWwuVFlQRSk7Ci0gICAgICAgICAgICAgICAgZmluYWwgaW50IHR5cGUgPSAodHlwZUFzT2JqZWN0ICE9IG51bGwgPwotICAgICAgICAgICAgICAgICAgICAgICAgdHlwZUFzT2JqZWN0IDogREVGQVVMVF9FTUFJTF9UWVBFKTsKLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgbGFiZWwgPSBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKEVtYWlsLkxBQkVMKTsKLSAgICAgICAgICAgICAgICBJbnRlZ2VyIGlzUHJpbWFyeUFzSW50ZWdlciA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNJbnRlZ2VyKEVtYWlsLklTX1BSSU1BUlkpOwotICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gaXNQcmltYXJ5ID0gKGlzUHJpbWFyeUFzSW50ZWdlciAhPSBudWxsID8KLSAgICAgICAgICAgICAgICAgICAgICAgIChpc1ByaW1hcnlBc0ludGVnZXIgPiAwKSA6IGZhbHNlKTsKLSAgICAgICAgICAgICAgICBlbWFpbEFkZHJlc3NFeGlzdHMgPSB0cnVlOwotICAgICAgICAgICAgICAgIGlmICghYWRkcmVzc1NldC5jb250YWlucyhlbWFpbEFkZHJlc3MpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGFkZHJlc3NTZXQuYWRkKGVtYWlsQWRkcmVzcyk7Ci0gICAgICAgICAgICAgICAgICAgIGFwcGVuZEVtYWlsTGluZSh0eXBlLCBsYWJlbCwgZW1haWxBZGRyZXNzLCBpc1ByaW1hcnkpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmICghZW1haWxBZGRyZXNzRXhpc3RzICYmIG1Jc0RvQ29NbykgewotICAgICAgICAgICAgYXBwZW5kRW1haWxMaW5lKEVtYWlsLlRZUEVfSE9NRSwgIiIsICIiLCBmYWxzZSk7Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gdGhpczsKLSAgICB9Ci0KLSAgICBwdWJsaWMgVkNhcmRCdWlsZGVyIGFwcGVuZFBvc3RhbHMoZmluYWwgTGlzdDxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICBpZiAoY29udGVudFZhbHVlc0xpc3QgPT0gbnVsbCB8fCBjb250ZW50VmFsdWVzTGlzdC5pc0VtcHR5KCkpIHsKLSAgICAgICAgICAgIGlmIChtSXNEb0NvTW8pIHsKLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNhcmRDb25zdGFudHMuUFJPUEVSVFlfQURSKTsKLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfUEFSQU1fU0VQQVJBVE9SKTsKLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9IT01FKTsKLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfREFUQV9TRVBBUkFUT1IpOwotICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9FTkRfT0ZfTElORSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAobUlzRG9Db01vKSB7Ci0gICAgICAgICAgICAgICAgYXBwZW5kUG9zdGFsc0ZvckRvQ29Nbyhjb250ZW50VmFsdWVzTGlzdCk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGFwcGVuZFBvc3RhbHNGb3JHZW5lcmljKGNvbnRlbnRWYWx1ZXNMaXN0KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiB0aGlzOwotICAgIH0KLQot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oZmluYWwgQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzIDogY29udGVudFZhbHVlc0xpc3QpIHsKLSAgICAgICAgICAgIGlmIChjb250ZW50VmFsdWVzID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGZpbmFsIEludGVnZXIgdHlwZUFzSW50ZWdlciA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNJbnRlZ2VyKFN0cnVjdHVyZWRQb3N0YWwuVFlQRSk7Ci0gICAgICAgICAgICBmaW5hbCBJbnRlZ2VyIHByaW9yaXR5QXNJbnRlZ2VyID0gc1Bvc3RhbFR5cGVQcmlvcml0eU1hcC5nZXQodHlwZUFzSW50ZWdlcik7Ci0gICAgICAgICAgICBmaW5hbCBpbnQgcHJpb3JpdHkgPQotICAgICAgICAgICAgICAgICAgICAocHJpb3JpdHlBc0ludGVnZXIgIT0gbnVsbCA/IHByaW9yaXR5QXNJbnRlZ2VyIDogSW50ZWdlci5NQVhfVkFMVUUpOwotICAgICAgICAgICAgaWYgKHByaW9yaXR5IDwgY3VycmVudFByaW9yaXR5KSB7Ci0gICAgICAgICAgICAgICAgY3VycmVudFByaW9yaXR5ID0gcHJpb3JpdHk7Ci0gICAgICAgICAgICAgICAgY3VycmVudFR5cGUgPSB0eXBlQXNJbnRlZ2VyOwotICAgICAgICAgICAgICAgIGN1cnJlbnRDb250ZW50VmFsdWVzID0gY29udGVudFZhbHVlczsKLSAgICAgICAgICAgICAgICBpZiAocHJpb3JpdHkgPT0gMCkgewotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoY3VycmVudENvbnRlbnRWYWx1ZXMgPT0gbnVsbCkgewotICAgICAgICAgICAgTG9nLncoTE9HX1RBRywgIlNob3VsZCBub3QgY29tZSBoZXJlLiBNdXN0IGhhdmUgYXQ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RlbnRWYWx1ZXMuZ2V0QXNTdHJpbmcoU3RydWN0dXJlZFBvc3RhbC5QT1NUQ09ERSk7Ci0gICAgICAgIGZpbmFsIFN0cmluZyByYXdDb3VudHJ5ID0gY29udGVudFZhbHVlcy5nZXRBc1N0cmluZyhTdHJ1Y3R1cmVkUG9zdGFsLkNPVU5UUlkpOwotICAgICAgICBmaW5hbCBTdHJpbmdbXSByYXdBZGRyZXNzQXJyYXkgPSBuZXcgU3RyaW5nW117Ci0gICAgICAgICAgICAgICAgcmF3UG9Cb3gsIHJhd05laWdoYm9yaG9vZCwgcmF3U3RyZWV0LCByYXdMb2NhbGl0eSwKLSAgICAgICAgICAgICAgICByYXdSZWdpb24sIHJhd1Bvc3RhbENvZGUsIHJhd0NvdW50cnl9OwotICAgICAgICBpZiAoIVZDYXJkVXRpbHMuYXJlQWxsRW1wdHkocmF3QWRkcmVzc0FycmF5KSkgewotICAgICAgICAgICAgZmluYWwgYm9vbGVhbiByZWFsbHlVc2VRdW90ZWRQcmludGFibGUgPQotICAgICAgICAgICAgICAgIChtU2hvdWxkVXNlUXVvdGVkUHJpbnRhYmxlICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAhVkNhcmRVdGlscy5jb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkocmF3QWRkcmVzc0FycmF5KSk7Ci0gICAgICAgICAgICBmaW5hbCBib29sZWFuIGFwcGVuZENoYXJzZXQgPQotICAgICAgICAgICAgICAgICFWQ2FyZFV0aWxzLmNvbnRhaW5zT25seVByaW50YWJsZUFzY2lpKHJhd0FkZHJlc3NBcnJheSk7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgZW5jb2RlZFBvQm94OwotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGVuY29kZWRTdHJlZXQ7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgZW5jb2RlZExvY2FsaXR5OwotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGVuY29kZWRSZWdpb247Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgZW5jb2RlZFBvc3RhbENvZGU7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgZW5jb2RlZENvdW50cnk7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgZW5jb2RlZE5laWdoYm9yaG9vZDsKLQotICAgICAgICAgICAgZmluYWwgU3RyaW5nIHJhd0xvY2FsaXR5MjsKLSAgICAgICAgICAgIC8vIFRoaXMgbG9va3MgaW5lZmZpY2llbnQgc2luY2Ugd2UgZW5jb2RlIHJhd0xvY2FsaXR5IGFuZCByYXdOZWlnaGJvcmhvb2QgdHdpY2UsCi0gICAgICAgICAgICAvLyBidXQgdGhpcyBpcyBpbnRlbnRpb25hbC4KLSAgICAgICAgICAgIC8vCi0gICAgICAgICAgICAvLyBRUCBlbmNvZGluZyBtYXkgYWRkIGxpbmUgZmVlZHMgd2hlbiBuZWVkZWQgYW5kIHRoZSByZXN1bHQgb2YKLSAgICAgICAgICAgIC8vIC0gZW5jb2RlUXVvdGVkUHJpbnRhYmxlKHJhd0xvY2FsaXR5ICsgIiAiICsgcmF3TmVpZ2hib3Job29kKQotICAgICAgICAgICAgLy8gbWF5IGJlIGRpZmZlcmVudCBmcm9tCi0gICAgICAgICAgICAvLyAtIGVuY29kZWRMb2NhbGl0eSArICIgIiArIGVuY29kZWROZWlnaGJvcmhvb2QuCi0gICAgICAgICAgICAvLwotICAgICAgICAgICAgLy8gV2UgdXNlIHNhZmVyIHdheS4KLSAgICAgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eShyYXdMb2NhbGl0eSkpIHsKLSAgICAgICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkocmF3TmVpZ2hib3Job29kKSkgewotICAgICAgICAgICAgICAgICAgICByYXdMb2NhbGl0eTIgPSAiIjsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICByYXdMb2NhbGl0eTIgPSByYXdOZWlnaGJvcmhvb2Q7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkocmF3TmVpZ2hib3Job29kKSkgewotICAgICAgICAgICAgICAgICAgICByYXdMb2NhbGl0eTIgPSByYXdMb2NhbGl0eTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICByYXdMb2NhbGl0eTIgPSByYXdMb2NhbGl0eSArICIgIiArIHJhd05laWdoYm9yaG9vZDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAocmVhbGx5VXNlUXVvdGVkUHJpbnRhYmxlKSB7Ci0gICAgICAgICAgICAgICAgZW5jb2RlZFBvQm94ID0gZW5jb2RlUXVvdGVkUHJpbnRhYmxlKHJhd1BvQm94KTsKLSAgICAgICAgICAgICAgICBlbmNvZGVkU3RyZWV0ID0gZW5jb2RlUXVvdGVkUHJpbnRhYmxlKHJhd1N0cmVldCk7Ci0gICAgICAgICAgICAgICAgZW5jb2RlZExvY2FsaXR5ID0gZW5jb2RlUXVvdGVkUHJpbnRhYmxlKHJhd0xvY2FsaXR5Mik7Ci0gICAgICAgICAgICAgICAgZW5jb2RlZFJlZ2lvbiA9IGVuY29kZVF1b3RlZFByaW50YWJsZShyYXdSZWdpb24pOwotICAgICAgICAgICAgICAgIGVuY29kZWRQb3N0YWxDb2RlID0gZW5jb2RlUXVvdGVkUHJpbnRhYmxlKHJhd1Bvc3RhbENvZGUpOwotICAgICAgICAgICAgICAgIGVuY29kZWRDb3VudHJ5ID0gZW5jb2RlUXVvdGVkUHJpbnRhYmxlKHJhd0NvdW50cnkpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBlbmNvZGVkUG9Cb3ggPSBlc2NhcGVDaGFyYWN0ZXJzKHJhd1BvQm94KTsKLSAgICAgICAgICAgICAgICBlbmN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7Ci0gICAgICAgICAgICAgICAgaWYgKHByb3RvY29sQXNPYmplY3QgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIHByb3BlcnR5TmFtZSA9IFZDYXJkVXRpbHMuZ2V0UHJvcGVydHlOYW1lRm9ySW0ocHJvdG9jb2xBc09iamVjdCk7Ci0gICAgICAgICAgICAgICAgaWYgKHByb3BlcnR5TmFtZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBTdHJpbmcgZGF0YSA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNTdHJpbmcoSW0uREFUQSk7Ci0gICAgICAgICAgICAgICAgaWYgKGRhdGEgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBkYXRhID0gZGF0YS50cmltKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eShkYXRhKSkgewotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIHR5cGVBc1N0cmluZzsKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIEludGVnZXIgdHlwZUFzSW50ZWdlciA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNJbnRlZ2VyKEltLlRZUEUpOwotICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHR5cGVBc0ludGVnZXIgIT0gbnVsbCA/IHR5cGVBc0ludGVnZXIgOiBJbS5UWVBFX09USEVSKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEltLlRZUEVfSE9NRTogewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVBc1N0cmluZyA9IFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfSE9NRTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgSW0uVFlQRV9XT1JLOiB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZUFzU3RyaW5nID0gVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9XT1JLOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBJbS5UWVBFX0NVU1RPTTogewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBsYWJlbCA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNTdHJpbmcoSW0uTEFCRUwpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVBc1N0cmluZyA9IChsYWJlbCAhPSBudWxsID8gIlgtIiArIGxhYmVsIDogbnVsbCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEltLlRZUEVfT1RIRVI6ICAvLyBJZ25vcmUKLSAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlQXNTdHJpbmcgPSBudWxsOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgZmluYWwgTGlzdDxTdHJpbmc+IHBhcmFtZXRlckxpc3QgPSBuZXcgQXJyYXlMaXN0PFN0cmluZz4oKTsKLSAgICA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yaW5nIHdlYnNpdGUgPSBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKFdlYnNpdGUuVVJMKTsKLSAgICAgICAgICAgICAgICBpZiAod2Vic2l0ZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIHdlYnNpdGUgPSB3ZWJzaXRlLnRyaW0oKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAvLyBOb3RlOiB2Q2FyZCAzLjAgZG9lcyBub3QgYWxsb3cgYW55IHBhcmFtZXRlciBhZGRpdGlvbiB0b3dhcmQgIlVSTCIKLSAgICAgICAgICAgICAgICAvLyAgICAgICBwcm9wZXJ0eSwgd2hpbGUgdGhlcmUncyBubyBkb2N1bWVudCBpbiB2Q2FyZCAyLjEuCi0gICAgICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eSh3ZWJzaXRlKSkgewotICAgICAgICAgICAgICAgICAgICBhcHBlbmRMaW5lV2l0aENoYXJzZXRBbmRRUERldGVjdGlvbihWQ2FyZENvbnN0YW50cy5QUk9QRVJUWV9VUkwsIHdlYnNpdGUpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gdGhpczsKLSAgICB9Ci0KLSAgICBwdWJsaWMgVkNhcmRCdWlsZGVyIGFwcGVuZE9yZ2FuaXphdGlvbnMoZmluYWwgTGlzdDxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICBpZiAoY29udGVudFZhbHVlc0xpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgZm9yIChDb250ZW50VmFsdWVzIGNvbnRlbnRWYWx1ZXMgOiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICAgICAgICAgIFN0cmluZyBjb21wYW55ID0gY29udGVudFZhbHVlcy5nZXRBc1N0cmluZyhPcmdhbml6YXRpb24uQ09NUEFOWSk7Ci0gICAgICAgICAgICAgICAgaWYgKGNvbXBhbnkgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBjb21wYW55ID0gY29tcGFueS50cmltKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIFN0cmluZyBkZXBhcnRtZW50ID0gY29udGVudFZhbHVlcy5nZXRBc1N0cmluZyhPcmdhbml6YXRpb24uREVQQVJUTUVOVCk7Ci0gICAgICAgICAgICAgICAgaWYgKGRlcGFydG1lbnQgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBkZXBhcnRtZW50ID0gZGVwYXJ0bWVudC50cmltKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIFN0cmluZyB0aXRsZSA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNTdHJpbmcoT3JnYW5pemF0aW9uLlRJVExFKTsKLSAgICAgICAgICAgICAgICBpZiAodGl0bGUgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnRyaW0oKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBTdHJpbmdCdWlsZGVyIG9yZ0J1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoY29tcGFueSkpIHsKLSAgICAgICAgICAgICAgICAgICAgb3JnQnVpbGRlci5hcHBlbmQoY29tcGFueSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoZGVwYXJ0bWVudCkpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG9yZ0J1aWxkZXIubGVuZ3RoKCkgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBvcmdCdWlsZGVyLmFwcGVuZCgnOycpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG9yZ0J1aWxkZXIuYXBwZW5kKGRlcGFydG1lbnQpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgb3JnbGluZSA9IG9yZ0J1aWxkZXIudG9TdHJpbmcoKTsKLSAgICAgICAgICAgICAgICBhcHBlbmRMaW5lKFZDYXJkQ29uc3RhbnRzLlBST1BFUlRZX09SRywgb3JnbGluZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICFWQ2FyZFV0aWxzLmNvbnRhaW5zT25seVByaW50YWJsZUFzY2lpKG9yZ2xpbmUpLAotICAgICAgICAgICAgICAgICAgICAgICAgKG1TaG91bGRVc2VRdW90ZWRQcmludGFibGUgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIVZDYXJkVXRpbHMuY29udGFpbnNPbmx5Tm9uQ3JMZlByaW50YWJsZUFzY2lpKG9yZ2xpbmUpKSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHRpdGxlKSkgewotICAgICAgICAgICAgICAgICAgICBhcHBlbmRMaW5lKFZDYXJkQ29uc3RhbnRzLlBST1BFUlRZX1RJVExFLCB0aXRsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAhVkNhcmRVdGlscy5jb250YWluc09ubHlQcmludGFibGVBc2NpaSh0aXRsZSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKG1TaG91bGRVc2VRdW90ZWRQcmludGFibGUgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICFWQ2FyZFV0aWxzLmNvbnRhaW5zT25seU5vbkNyTGZQcmludGFibGVBc2NpaSh0aXRsZSkpKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHRoaXM7Ci0gICAgfQotCi0gICAgcHVibGljIFZDYXJkQnVpbGRlciBhcHBlbmRQaG90b3MoZmluYWwgTGlzdDxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICBpZiAoY29udGVudFZhbHVlc0xpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgZm9yIChDb250ZW50VmFsdWVzIGNvbnRlbnRWYWx1ZXMgOiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICAgICAgICAgIGlmIChjb250ZW50VmFsdWVzID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJ5dGVbXSBkYXRhID0gY29udGVudFZhbHVlcy5nZXRBc0J5dGVBcnJheShQaG90by5QSE9UTyk7Ci0gICAgICAgICAgICAgICAgaWYgKGRhdGEgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIHBob3RvVHlwZSA9IFZDYXJkVXRpbHMuZ3Vlc3NJbWFnZVR5cGUoZGF0YSk7Ci0gICAgICAgICAgICAgICAgaWYgKHBob3RvVHlwZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJVbmtub3duIHBob3RvIHR5cGUuIElnbm9yZWQuIik7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgcGhvdG9TdHJpbmcgPSBuZXcgU3RyaW5nKEJhc2U2NC5lbmNvZGVCYXNlNjQoZGF0YSkpOwotICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkocGhvdG9TdHJpbmcpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGFwcGVuZFBob3RvTGluZShwaG90b1N0cmluZywgcGhvdG9UeXBlKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHRoaXM7Ci0gICAgfQotCi0gICAgcHVibGljIFZDYXJkQnVpbGRlciBhcHBlbmROb3RlcyhmaW5hbCBMaXN0PENvbnRlbnRWYWx1ZXM+IGNvbnRlbnRWYWx1ZXNMaXN0KSB7Ci0gICAgICAgIGlmIChjb250ZW50VmFsdWVzTGlzdCAhPSBudWxsKSB7Ci0gICAgICAgICAgICBpZiAobU9ubHlPbmVOb3RlRmllbGRJc0F2YWlsYWJsZSkgewotICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZ0J1aWxkZXIgbm90ZUJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICAgICAgICAgIGJvb2xlYW4gZmlyc3QgPSB0cnVlOwotICAgICAgICAgICAgICAgIGZvciAoZmluYWwgQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzIDogY29udGVudFZhbHVlc0xpc3QpIHsKLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nIG5vdGUgPSBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKE5vdGUuTk9URSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChub3RlID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5vdGUgPSAiIjsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAobm90ZS5sZW5ndGgoKSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaXJzdCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0ID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vdGVCdWlsZGVyLmFwcGVuZCgnXG4nKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIG5vdGVCdWlsZGVyLmFwcGVuZChub3RlKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgbm90ZVN0ciA9IG5vdGVCdWlsZGVyLnRvU3RyaW5nKCk7Ci0gICAgICAgICAgICAgICAgLy8gVGhpcyBtZWFucyB3ZSBzY2FuIG5vdGVTdHIgY29tcGxldGVseSB0d2ljZSwgd2hpY2ggaXMgcmVkdW5kYW50LgotICAgICAgICAgICAgICAgIC8vIEJ1dCBmb3Igbm93LCB3ZSBhc3N1bWUgdGhpcyBpcyBub3Qgc28gdGltZS1jb25zdW1pbmcuLgotICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gc2hvdWxkQXBwZW5kQ2hhcnNldEluZm8gPQotICAgICAgICAgICAgICAgICAgICAhVkNhcmRVdGlscy5jb250YWluc09ubHlQcmludGFibGVBc2NpaShub3RlU3RyKTsKLSAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIHJlYWxseVVzZVF1b3RlZFByaW50YWJsZSA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAobVNob3VsZFVzZVF1b3RlZFByaW50YWJsZSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICFWQ2FyZFV0aWxzLmNvbnRhaW5zT25seU5vbkNyTGZQcmludGFibGVBc2NpaShub3RlU3RyKSk7Ci0gICAgICAgICAgICAgICAgYXBwZW5kTGluZShWQ2FyZENvbnN0YW50cy5QUk9QRVJUWV9OT1RFLCBub3RlU3RyLAotICAgICAgICAgICAgICAgICAgICAgICAgc2hvdWxkQXBwZW5kQ2hhcnNldEluZm8sIHJlYWxseVVzZVF1b3RlZFByaW50YWJsZSk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGZvciAoQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzIDogY29udGVudFZhbHVlc0xpc3QpIHsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIG5vdGVTdHIgPSBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKE5vdGUuTk9URSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkobm90ZVN0cikpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gc2hvdWxkQXBwZW5kQ2hhcnNldEluZm8gPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhVkNhcmRVdGlscy5jb250YWluc09ubHlQcmludGFibGVBc2NpaShub3RlU3RyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gcmVhbGx5VXNlUXVvdGVkUHJpbnRhYmxlID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG1TaG91bGRVc2VRdW90ZWRQcmludGFibGUgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICFWQ2FyZFV0aWxzLmNvbnRhaW5zT25seU5vbkNyTGZQcmludGFibGVBc2NpaShub3RlU3RyKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBhcHBlbmRMaW5lKFZDYXJkQ29uc3RhbnRzLlBST1BFUlRZX05PVEUsIG5vdGVTdHIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNob3VsZEFwcGVuZENoYXJzZXRJbmZvLCByZWFsbHlVc2VRdW90ZWRQcmludGFibGUpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiB0aGlzOwotICAgIH0KLQotICAgIHB1YmxpYyBWQ2FyZEJ1aWxkZXIgYXBwZW5kRXZlbnRzKGZpbmFsIExpc3Q8Q29udGVudFZhbHVlcz4gY29udGVudFZhbHVlc0xpc3QpIHsKLSAgICAgICAgaWYgKGNvbnRlbnRWYWx1ZXNMaXN0ICE9IG51bGwpIHsKLSAgICAgICAgICAgIFN0cmluZyBwcmltYXJ5QmlydGhkYXkgPSBudWxsOwotICAgICAgICAgICAgU3RyaW5nIHNlY29uZGFyeUJpcnRoZGF5ID0gbnVsbDsKLSAgICAgICAgICAgIGZvciAoZmluYWwgQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzIDogY29udGVudFZhbHVlc0xpc3QpIHsKLSAgICAgICAgICAgICAgICBpZiAoY29udGVudFZhbHVlcyA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBmaW5hbCBJbnRlZ2VyIGV2ZW50VHlwZUFzSW50ZWdlciA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNJbnRlZ2VyKEV2ZW50LlRZUEUpOwotICAgICAgICAgICAgICAgIGZpbmFsIGludCBldmVudFR5cGU7Ci0gICAgICAgICAgICAgICAgaWYgKGV2ZW50VHlwZUFzSW50ZWdlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGV2ZW50VHlwZSA9IGV2ZW50VHlwZUFzSW50ZWdlcjsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBldmVudFR5cGUgPSBFdmVudC5UWVBFX09USEVSOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoZXZlbnRUeXBlID09IEV2ZW50LlRZUEVfQklSVEhEQVkpIHsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIGJpcnRoZGF5Q2FuZGlkYXRlID0gY29udGVudFZhbHVlcy5nZXRBc1N0cmluZyhFdmVudC5TVEFSVF9EQVRFKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGJpcnRoZGF5Q2FuZGlkYXRlID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIEludGVnZXIgaXNTdXBlclByaW1hcnlBc0ludGVnZXIgPQotICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFZhbHVlcy5nZXRBc0ludGVnZXIoRXZlbnQuSVNfU1VQRVJfUFJJTUFSWSk7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gaXNTdXBlclByaW1hcnkgPSAoaXNTdXBlclByaW1hcnlBc0ludGVnZXIgIT0gbnVsbCA/Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGlzU3VwZXJQcmltYXJ5QXNJbnRlZ2VyID4gMCkgOiBmYWxzZSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChpc1N1cGVyUHJpbWFyeSkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gInN1cGVyIHByaW1hcnkiIGJpcnRoZGF5IHNob3VsZCB0aGUgcHJlZmVyZWQgb25lLgotICAgICAgICAgICAgICAgICAgICAgICAgcHJpbWFyeUJpcnRoZGF5ID0gYmlydGhkYXlDYW5kaWRhdGU7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBmaW5hbCBJbnRlZ2VyIGlzUHJpbWFyeUFzSW50ZWdlciA9Ci0gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50VmFsdWVzLmdldEFzSW50ZWdlcihFdmVudC5JU19QUklNQVJZKTsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBpc1ByaW1hcnkgPSAoaXNQcmltYXJ5QXNJbnRlZ2VyICE9IG51bGwgPwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpc1ByaW1hcnlBc0ludGVnZXIgPiAwKSA6IGZhbHNlKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGlzUHJpbWFyeSkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2UgZG9uJ3QgYnJlYWsgaGVyZSBzaW5jZSAic3VwZXIgcHJpbWFyeSIgYmlydGhkYXkgbWF5IGV4aXN0IGxhdGVyLgotICAgICAgICAgICAgICAgICAgICAgICAgcHJpbWFyeUJpcnRoZGF5ID0gYmlydGhkYXlDYW5kaWRhdGU7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc2Vjb25kYXJ5QmlydGhkYXkgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gRmlyc3QgZW50cnkgaXMgc2V0IHRvIHRoZSAic2Vjb25kYXJ5IiBjYW5kaWRhdGUuCi0gICAgICAgICAgICAgICAgICAgICAgICBzZWNvbmRhcnlCaXJ0aGRheSA9IGJpcnRoZGF5Q2FuZGlkYXRlOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtVXNlc0FuZHJvaWRQcm9wZXJ0eSkgewotICAgICAgICAgICAgICAgICAgICAvLyBFdmVudCB0eXBlcyBvdGhlciB0aGFuIEJpcnRoZGF5IGlzIG5vdCBzdXBwb3J0ZWQgYnkgdkNhcmQuCi0gICAgICAgICAgICAgICAgICAgIGFwcGVuZEFuZHJvaWRTcGVjaWZpY1Byb3BlcnR5KEV2ZW50LkNPTlRFTlRfSVRFTV9UWVBFLCBjb250ZW50VmFsdWVzKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAocHJpbWFyeUJpcnRoZGF5ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBhcHBlbmRMaW5lV2l0aENoYXJzZXRBbmRRUERldGVjdGlvbihWQ2FyZENvbnN0YW50cy5QUk9QRVJUWV9CREFZLAotICAgICAgICAgICAgICAgICAgICAgICAgcHJpbWFyeUJpcnRoZGF5LnRyaW0oKSk7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKHNlY29uZGFyeUJpcnRoZGF5ICE9IG51bGwpewotICAgICAgICAgICAgICAgIGFwcGVuZExpbmVXaXRoQ2hhcnNldEFuZFFQRGV0ZWN0aW9uKFZDYXJkQ29uc3RhbnRzLlBST1BFUlRZX0JEQVksCi0gICAgICAgICAgICAgICAgICAgICAgICBzZWNvbmRhcnlCaXJ0aGRheS50cmltKCkpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiB0aGlzOwotICAgIH0KLQotICAgIHB1YmxpYyBWQ2FyZEJ1aWxkZXIgYXBwZW5kUmVsYXRpb24oZmluYWwgTGlzdDxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICBpZiAobVVzZXNBbmRyb2lkUHJvcGVydHkgJiYgY29udGVudFZhbHVlc0xpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgZm9yIChmaW5hbCBDb250ZW50VmFsdWVzIGNvbnRlbnRWYWx1ZXMgOiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICAgICAgICAgIGlmIChjb250ZW50VmFsdWVzID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGFwcGVuZEFuZHJvaWRTcGVjaWZpY1Byb3BlcnR5KFJlbGF0aW9uLkNPTlRFTlRfSVRFTV9UWVBFLCBjb250ZW50VmFsdWVzKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gdGhpczsKLSAgICB9Ci0KLSAgICBwdWJsaWMgdm9pZCBhcHBlbmRQb3N0YWxMaW5lKGZpbmFsIGludCB0eXBlLCBmaW5hbCBTdHJpbmcgbGFiZWwsCi0gICAgICAgICAgICBmaW5hbCBDb250ZW50VmFsdWVzIGNvbnRlbnRWYWx1ZXMsCi0gICAgICAgICAgICBmaW5hbCBib29sZWFuIGlzUHJpbWFyeSwgZmluYWwgYm9vbGVhbiBlbWl0TGluZUV2ZXJ5VGltZSkgewotICAgICAgICBmaW5hbCBib29sZWFuIHJlYWxseVVzZVF1b3RlZFByaW50YWJsZTsKLSAgICAgICAgZmluYWwgYm9vbGVhbiBhcH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7Ci0gICAgICAgIH0KLSAgICAgICAgc3dpdGNoICh0eXBlKSB7Ci0gICAgICAgICAgICBjYXNlIFN0cnVjdHVyZWRQb3N0YWwuVFlQRV9IT01FOiB7Ci0gICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9IT01FKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgU3RydWN0dXJlZFBvc3RhbC5UWVBFX1dPUks6IHsKLSAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZChWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX1dPUkspOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBTdHJ1Y3R1cmVkUG9zdGFsLlRZUEVfQ1VTVE9NOiB7Ci0gICAgICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShsYWJlbCkKLSAgICAgICAgICAgICAgICAgICAgICAgICYmIFZDYXJkVXRpbHMuY29udGFpbnNPbmx5QWxwaGFEaWdpdEh5cGhlbihsYWJlbCkpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gV2UncmUgbm90IHN1cmUgd2hldGhlciB0aGUgbGFiZWwgaXMgdmFsaWQgaW4gdGhlIHNwZWMKLSAgICAgICAgICAgICAgICAgICAgLy8gKCJJQU5BLXRva2VuIiBpbiB0aGUgdkNhcmQgMy4wIGlzIHVuY2xlYXIuLi4pCi0gICAgICAgICAgICAgICAgICAgIC8vIEp1c3QgIGZvciBzYWZldHksIHdlIGFkZCAiWC0iIGF0IHRoZSBiZWdnaW5pbmcgb2YgZWFjaCBsYWJlbC4KLSAgICAgICAgICAgICAgICAgICAgLy8gQWxzbyBjaGVja3MgdGhlIGxhYmVsIG9iZXlzIHdpdGggdkNhcmQgMy4wIHNwZWMuCi0gICAgICAgICAgICAgICAg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RleHRVdGlscy5pc0VtcHR5KGxhYmVsKQotICAgICAgICAgICAgICAgICAgICAgICAgJiYgVkNhcmRVdGlscy5jb250YWluc09ubHlBbHBoYURpZ2l0SHlwaGVuKGxhYmVsKSkgewotICAgICAgICAgICAgICAgICAgICB0eXBlQXNTdHJpbmcgPSAiWC0iICsgbGFiZWw7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgdHlwZUFzU3RyaW5nID0gbnVsbDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIEVtYWlsLlRZUEVfSE9NRTogewotICAgICAgICAgICAgICAgIHR5cGVBc1N0cmluZyA9IFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfSE9NRTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgRW1haWwuVFlQRV9XT1JLOiB7Ci0gICAgICAgICAgICAgICAgdHlwZUFzU3RyaW5nID0gVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9XT1JLOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBFbWFpbC5UWVBFX09USEVSOiB7Ci0gICAgICAgICAgICAgICAgdHlwZUFzU3RyaW5nID0gbnVsbDsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgRW1haWwuVFlQRV9NT0JJTEU6IHsKLSAgICAgICAgICAgICAgICB0eXBlQXNTdHJpbmcgPSBWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX0NFTEw7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBkZWZhdWx0OiB7Ci0gICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIl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SB7Ci0gICAgICAgICAgICB0eXBlID0gUGhvbmUuVFlQRV9PVEhFUjsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHR5cGUgPSB0eXBlQXNJbnRlZ2VyOwotICAgICAgICB9Ci0KLSAgICAgICAgQXJyYXlMaXN0PFN0cmluZz4gcGFyYW1ldGVyTGlzdCA9IG5ldyBBcnJheUxpc3Q8U3RyaW5nPigpOwotICAgICAgICBzd2l0Y2ggKHR5cGUpIHsKLSAgICAgICAgICAgIGNhc2UgUGhvbmUuVFlQRV9IT01FOiB7Ci0gICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGRBbGwoCi0gICAgICAgICAgICAgICAgICAgICAgICBBcnJheXMuYXNMaXN0KFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfSE9NRSkpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX1dPUks6IHsKLSAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZEFsbCgKLSAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5cy5hc0xpc3QoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9XT1JLKSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIFBob25lLlRZUEVfRkFYX0hPTUU6IHsKLSAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZEFsbCgKLSAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5cy5hc0xpc3QoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9IT01FLCBWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX0ZBWCkpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX0ZBWF9XT1JLOiB7Ci0gICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGRBbGwoCi0gICAgICAgICAgICAgICAgICAgICAgICBBcnJheXMuYXNMaXN0KFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfV09SSywgVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9GQVgpKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgUGhvbmUuVFlQRV9NT0JJTEU6IHsKLSAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZChWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX0NFTEwpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX1BBR0VSOiB7Ci0gICAgICAgICAgICAgICAgaWYgKG1Jc0RvQ29NbykgewotICAgICAgICAgICAgICAgICAgICAvLyBOb3Qgc3VyZSBhYm91dCB0aGUgcmVhc29uLCBidXQgcHJldmlvdXMgaW1wbGVtZW50YXRpb24gaGFkCi0gICAgICAgICAgICAgICAgICAgIC8vIHVzZWQgIlZPSUNFIiBpbnN0ZWFkIG9mICJQQUdFUiIKLSAgICAgICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9WT0lDRSk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9QQUdFUik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX09USEVSOiB7Ci0gICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9WT0lDRSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIFBob25lLlRZUEVfQ0FSOiB7Ci0gICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9DQVIpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX0NPTVBBTllfTUFJTjogewotICAgICAgICAgICAgICAgIC8vIFRoZXJlJ3Mgbm8gcmVsZXZhbnQgZmllbGQgaW4gdkNhcmQgKGF0IGxlYXN0IDIuMSkuCi0gICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9XT1JLKTsKLSAgICAgICAgICAgICAgICBpc1ByaW1hcnkgPSB0cnVlOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX0lTRE46IHsKLSAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZChWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX0lTRE4pOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX01BSU46IHsKLSAgICAgICAgICAgICAgICBpc1ByaW1hcnkgPSB0cnVlOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX09USEVSX0ZBWDogewotICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfRkFYKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgUGhvbmUuVFlQRV9URUxFWDogewotICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfVExYKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgUGhvbmUuVFlQRV9XT1JLX01PQklMRTogewotICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkQWxsKAotICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXlzLmFzTGlzdChWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX1dPUkssIFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfQ0VMTCkpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX1dPUktfUEFHRVI6IHsKLSAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZChWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX1dPUkspOwotICAgICAgICAgICAgICAgIC8vIFNlZSBhYm92ZS4KLSAgICAgICAgICAgICAgICBpZiAobUlzRG9Db01vKSB7Ci0gICAgICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfVk9JQ0UpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfUEFHRVIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgUGhvbmUuVFlQRV9NTVM6IHsKLSAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZChWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX01TRyk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIFBob25lLlRZUEVfQ1VTVE9NOiB7Ci0gICAgICAgICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KGxhYmVsKSkgewotICAgICAgICAgICAgICAgICAgICAvLyBKdXN0IGlnbm9yZSB0aGUgY3VzdG9tIHR5cGUuCi0gICAgICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfVk9JQ0UpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoVkNhcmRVdGlscy5pc01vYmlsZVBob25lTGFiZWwobGFiZWwpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfQ0VMTCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIHVwcGVyTGFiZWwgPSBsYWJlbC50b1VwcGVyQ2FzZSgpOwotICAgICAgICAgICAgICAgICAgICBpZiAoVkNhcmRVdGlscy5pc1ZhbGlkSW5WMjFCdXRVbmtub3duVG9Db250YWN0c1Bob3RlVHlwZSh1cHBlckxhYmVsKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGQodXBwZXJMYWJlbCk7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoVkNhcmRVdGlscy5jb250YWluc09ubHlBbHBoYURpZ2l0SHlwaGVuKGxhYmVsKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gTm90ZTogU3RyaWN0bHksIHZDYXJkIDIuMSBkb2VzIG5vdCBhbGxvdyAiWC0iIHBhcmFtZXRlciB3aXRob3V0Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAiVFlQRT0iIHN0cmluZy4KLSA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ICAgYm9vbGVhbiBmaXJzdCA9IHRydWU7Ci0gICAgICAgIGZvciAoU3RyaW5nIHJhd1ZhbHVlIDogcmF3VmFsdWVMaXN0KSB7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgZW5jb2RlZFZhbHVlOwotICAgICAgICAgICAgaWYgKG5lZWRRdW90ZWRQcmludGFibGUpIHsKLSAgICAgICAgICAgICAgICBlbmNvZGVkVmFsdWUgPSBlbmNvZGVRdW90ZWRQcmludGFibGUocmF3VmFsdWUpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAvLyBUT0RPOiBvbmUgbGluZSBtYXkgYmUgdG9vIGh1Z2UsIHdoaWNoIG1heSBiZSBpbnZhbGlkIGluIHZDYXJkIDMuMAotICAgICAgICAgICAgICAgIC8vICAgICAgICAod2hpY2ggc2F5cyAiV2hlbiBnZW5lcmF0aW5nIGEgY29udGVudCBsaW5lLCBsaW5lcyBsb25nZXIgdGhhbgotICAgICAgICAgICAgICAgIC8vICAgICAgICA3NSBjaGFyYWN0ZXJzIFNIT1VMRCBiZSBmb2xkZWQiKSwgdGhvdWdoIHNldmVyYWwKLSAgICAgICAgICAgICAgICAvLyAgICAgICAgKGV2ZW4gd2VsbC1rbm93bikgYXBwbGljYXRpb25zIGRvIG5vdCBjYXJlIHRoaXMuCi0gICAgICAgICAgICAgICAgZW5jb2RlZFZhbHVlID0gZXNjYXBlQ2hhcmFjdGVycyhyYXdWYWx1ZSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChmaXJzdCkgewotICAgICAgICAgICAgICAgIGZpcnN0ID0gZmFsc2U7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9JVEVNX1NFUEFSQVRPUik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoZW5jb2RlZFZhbHVlKTsKLSAgICAgICA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ICAgICAgICBjYXNlICc7JzogewotICAgICAgICAgICAgICAgICAgICB0bXBCdWlsZGVyLmFwcGVuZCgnXFwnKTsKLSAgICAgICAgICAgICAgICAgICAgdG1wQnVpbGRlci5hcHBlbmQoJzsnKTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGNhc2UgJ1xyJzogewotICAgICAgICAgICAgICAgICAgICBpZiAoaSArIDEgPCBsZW5ndGgpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgbmV4dENoYXIgPSB1bmVzY2FwZWQuY2hhckF0KGkpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5leHRDaGFyID09ICdcbicpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmFsbCB0aHJvdWdoCi0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBmYWxsIHRocm91Z2gKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBjYXNlICdcbic6IHsKLSAgICAgICAgICAgICAgICAgICAgLy8gSW4gdkNhcmQgMi4xLCB0aGVyZSdzIG5vIHNwZWNpZmljYXRpb24gYWJvdXQgdGhpcywgd2hpbGUKLSAgICAgICAgICAgICAgICAgICAgLy8gdkNhcmQgMy4wIGV4cGxpY2l0bHkgcmVxdWlyZXMgdGhpcyBzaG91bGQgYmUgZW5jb2RlZCB0byAiXG4iLgotICAgICAgICAgICAgICAgICAgICB0bXBCdWlsZGVyLmFwcGVuZCgiXFxuIik7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBjYXNlICdcXCc6IHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1Jc1YzMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgdG1wQnVpbGRlci5hcHBlbmQoIlxcXFwiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmFsbCB0aHJvdWdoCi0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgY2FzZSAnPCc6Ci0gICAgICAgICAgICAgICAgY2FzZSAnPic6IHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1Jc0RvQ29NbykgewotICAgICAgICAgICAgICAgICAgICAgICAgdG1wQnVpbGRlci5hcHBlbmQoJ1xcJyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0bXBCdWlsZGVyLmFwcGVuZChjaCk7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0bXBCdWlsZGVyLmFwcGVuZChjaCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGNhc2UgJywnOiB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtSXNWMzApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRtcEJ1aWxkZXIuYXBwZW5kKCJcXCwiKTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRtcEJ1aWxkZXIuYXBwZW5kKGNoKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZGVmYXVsdDogewotICAgICAgICAgICAgICAgICAgICB0bX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RyZWFtKG91dHB1dFN0cmVhbSkpOwotICogICAgIGlmICghY29tcG9zZXIuaW5pdCgpKSB7Ci0gKiAgICAgICAgIC8vIERvIHNvbWV0aGluZyBoYW5kbGluZyB0aGUgc2l0dWF0aW9uLgotICogICAgICAgICByZXR1cm47Ci0gKiAgICAgfQotICogICAgIHdoaWxlICghY29tcG9zZXIuaXNBZnRlckxhc3QoKSkgewotICogICAgICAgICBpZiAobUNhbmNlbGVkKSB7Ci0gKiAgICAgICAgICAgICAvLyBBc3N1bWUgYSB1c2VyIG1heSBjYW5jZWwgdGhpcyBvcGVyYXRpb24gZHVyaW5nIHRoZSBleHBvcnQuCi0gKiAgICAgICAgICAgICByZXR1cm47Ci0gKiAgICAgICAgIH0KLSAqICAgICAgICAgaWYgKCFjb21wb3Nlci5jcmVhdGVPbmVFbnRyeSgpKSB7Ci0gKiAgICAgICAgICAgICAvLyBEbyBzb21ldGhpbmcgaGFuZGxpbmcgdGhlIGVycm9yIHNpdHVhdGlvbi4KLSAqICAgICAgICAgICAgIHJldHVybjsKLSAqICAgICAgICAgfQotICogICAgIH0KLSAqIH0gZmluYWxseSB7Ci0gKiAgICAgaWYgKGNvbXBvc2VyICE9IG51bGwpIHsKLSAqICAgICAgICAgY29tcG9zZXIudGVybWluYXRlKCk7Ci0gKiAgICAgfQotICogfSA8L3ByZT4KLSAqLwotcHVibGljIGNsYXNzIFZDYXJkQ29tcG9zZXIgewotICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFN0cmluZyBMT0dfVEFHID0gIlZDYXJkQ29tcG9zZXIiOwotCi0gICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgREVGQVVMVF9QSE9ORV9UWVBFID0gUGhvbmUuVFlQRV9IT01FOwotICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IERFRkFVTFRfUE9TVEFMX1RZUEUgPSBTdHJ1Y3R1cmVkUG9zdGFsLlRZUEVfSE9NRTsKLSAgICBwdWJsaWMgc3RhdGljIGZpb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WFzb24gPSAiRW5jb2RpbmcgaXMgbm90IHN1cHBvcnRlZCAodXN1YWxseSB0aGlzIGRvZXMgbm90IGhhcHBlbiEpOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICArIG1DaGFyc2V0U3RyaW5nOwotICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG1Jc0RvQ29NbykgewotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIENyZWF0ZSBvbmUgZW1wdHkgZW50cnkuCi0gICAgICAgICAgICAgICAgICAgIG1Xcml0ZXIud3JpdGUoY3JlYXRlT25lRW50cnlJbnRlcm5hbCgiLTEiLCBudWxsKSk7Ci0gICAgICAgICAgICAgICAgfSBjYXRjaCAoVkNhcmRFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiVkNhcmRFeGNlcHRpb24gaGFzIGJlZW4gdGhyb3duIGR1cmluZyBvbiBJbml0KCk6ICIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUuZ2V0TWVzc2FnZSgpKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiSU9FeGNlcHRpb24gb2NjdXJyZWQgZHVyaW5nIGV4cG9ydE9uZUNvbnRhY3REYXRhOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGUuZ2V0TWVzc2FnZSgpKTsKLSAgICAgICAgICAgICAgICAgICAgbUVycm9yUmVhc29uID0gIklPRXhjZXB0aW9uIG9jY3VycmVkOiAiICsgZS5nZXRNZXNzYWdlKCk7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBib29sZWFuIG9uRW50cnlDcmVhdGVkKFN0cmluZyB2Y2FyZCkgewotICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBtV3JpdGVyLndyaXRlKHZjYXJkKTsKLSAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLAotICAgICAgICAgICAgICAgICAgICAgICAgIklPRXhjZXB0aW9uIG9jY3VycmVkIGR1cmluZyBleHBvcnRPbmVDb250YWN0RGF0YTogIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGUuZ2V0TWVzc2FnZSgpKTsKLSAgICAgICAgICAgICAgICBtRXJyb3JSZWFzb24gPSAiSU9FeGNlcHRpb24gb2NjdXJyZWQ6ICIgKyBlLmdldE1lc3NhZ2UoKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyB2b2lkIG9uVGVybWluYXRlKCkgewotICAgICAgICAgICAgbU9uVGVybWluYXRlSXNDYWxsZWQgPSB0cnVlOwotICAgICAgICAgICAgaWYgKG1Xcml0ZXIgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIEZsdXNoIGFuZCBzeW5jIHRoZSBkYXRhIHNvIHRoYXQgYSB1c2VyIGlzIGFibGUgdG8gcHVsbAotICAgICAgICAgICAgICAgICAgICAvLyB0aGUgU0RDYXJkIGp1c3QgYWZ0ZXIKLSAgICAgICAgICAgICAgICAgICAgLy8gdGhlIGV4cG9ydC4KLSAgICAgICAgICAgICAgICAgICAgbVdyaXRlci5mbHVzaCgpOwotICAgICAgICAgICAgICAgICAgICBpZiAobU91dHB1dFN0cmVhbSAhPSBudWxsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgbU91dHB1dFN0cmVhbSBpbnN0YW5jZW9mIEZpbGVPdXRwdXRTdHJlYW0pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKEZpbGVPdXRwdXRTdHJlYW0pIG1PdXRwdXRTdHJlYW0pLmdldEZEKCkuc3luYygpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJJT0V4Y2VwdGlvbiBkdXJpbmcgY2xvc2luZyB0aGUgb3V0cHV0IHN0cmVhbTogIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBlLmdldE1lc3NhZ2UoKSk7Ci0gICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1Xcml0ZXIuY2xvc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgIHB1YmxpYyB2b2lkIGZpbmFsaXplKCkgewotICAgICAgICAgICAgaWYgKCFtT25UZXJtaW5hdGVJc0NhbGxlZCkgewotICAgICAgICAgICAgICAgIG9uVGVybWluYXRlKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBwcml2YXRlIGZpbmFsIENvbnRleHQgbUNvbnRleHQ7Ci0gICAgc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R1cm4gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobUNhcmVIYW5kbGVyRXJyb3JzKSB7Ci0gICAgICAgICAgICBMaXN0PE9uZUVudHJ5SGFuZGxlcj4gZmluaXNoZWRMaXN0ID0gbmV3IEFycmF5TGlzdDxPbmVFbnRyeUhhbmRsZXI+KAotICAgICAgICAgICAgICAgICAgICBtSGFuZGxlckxpc3Quc2l6ZSgpKTsKLSAgICAgICAgICAgIGZvciAoT25lRW50cnlIYW5kbGVyIGhhbmRsZXIgOiBtSGFuZGxlckxpc3QpIHsKLSAgICAgICAgICAgICAgICBpZiAoIWhhbmRsZXIub25Jbml0KG1Db250ZXh0KSkgewotICAgICAgICAgICAgICAgICAgICBmb3IgKE9uZUVudHJ5SGFuZGxlciBmaW5pc2hlZCA6IGZpbmlzaGVkTGlzdCkgewotICAgICAgICAgICAgICAgICAgICAgICAgZmluaXNoZWQub25UZXJtaW5hdGUoKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgLy8gSnVzdCBpZ25vcmUgdGhlIGZhbHNlIHJldHVybmVkIGZyb20gb25Jbml0KCkuCi0gICAgICAgICAgICBmb3IgKE9uZUVudHJ5SGFuZGxlciBoYW5kbGVyIDogbUhhbmRsZXJMaXN0KSB7Ci0gICAgICAgICAgICAgICAgaGFuZGxlci5vbkluaXQobUNvbnRleHQpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgZmluYWwgU3RyaW5nW10gcHJvamVjdGlvbjsKLSAgICAgICAgaWYgKENvbnRhY3RzLkNPTlRFTlRfVVJJLmVxdWFscyhjb250ZW50VXJpKSB8fAotICAgICAgICAgICAgICAgIENPTlRBQ1RTX1RFU1RfQ09OVEVOVF9VUkkuZXF1YWxzKGNvbnRlbnRVcmkp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gICAgIH0KLQotICAgICAgICBtSWRDb2x1bW4gPSBtQ3Vyc29yLmdldENvbHVtbkluZGV4KENvbnRhY3RzLl9JRCk7Ci0KLSAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgfQotCi0gICAgcHVibGljIGJvb2xlYW4gY3JlYXRlT25lRW50cnkoKSB7Ci0gICAgICAgIHJldHVybiBjcmVhdGVPbmVFbnRyeShudWxsKTsKLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBAcGFyYW0gZ2V0RW50aXR5SXRlcmF0b3JNZXRob2QgRm9yIERlcGVuZGVuY3kgSW5qZWN0aW9uLgotICAgICAqIEBoaWRlIGp1c3QgZm9yIHRlc3RpbmcuCi0gICAgICovCi0gICAgcHVibGljIGJvb2xlYW4gY3JlYXRlT25lRW50cnkoTWV0aG9kIGdldEVudGl0eUl0ZXJhdG9yTWV0aG9kKSB7Ci0gICAgICAgIGlmIChtQ3Vyc29yID09IG51bGwgfHwgbUN1cnNvci5pc0FmdGVyTGFzdCgpKSB7Ci0gICAgICAgICAgICBtRXJyb3JSZWFzb24gPSBGQUlMVVJFX1JFQVNPTl9OT1RfSU5JVElBTElaRUQ7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLSAgICAgICAgU3RyaW5nIHZjYXJkOwotICAgICAgICB0cnkgewotICAgICAgICAgICAgaWYgKG1JZENvbHVtbiA+PSAwKSB7Ci0gICAgICAgICAgICAgICAgdmNhcmQgPSBjcmVhdGVPbmVFbnRyeUludGVybmFsKG1DdXJzb3IuZ2V0U3RyaW5nKG1JZENvbHVtbiksCi0gICAgICAgICAgICAgICAgICAgICAgICBnZXRFbnRpdHlJdGVyYXRvck1ldGhvZCk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJJbmNvcnJlY3QgbUlkQ29sdW1uOiAiICsgbUlkQ29sdW1uKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBjYXRjaCAoVkNhcmRFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIlZDYXJkRXhjZXB0aW9uIGhhcyBiZWVuIHRocm93bjogIiArIGUuZ2V0TWVzc2FnZSgpKTsKLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgfSBjYXRjaCAoT3V0T2ZNZW1vcnlFcnJvciBlcnJvcikgewotICAgICAgICAgICAgLy8gTWF5YmUgc29tZSBkYXRhIChlLmcuIHBob3RvKSBpcyB0b28gYmlnIHRvIGhhdmUgaW4gbWVtb3J5LiBCdXQgaXQKLSAgICAgICAgICAgIC8vIHNob3VsZCBiZSByYXJlLgotICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIk91dE9mTWVtb3J5RXJyb3Igb2NjdXJlZC4gSWdub3JlIHRoZSBlbnRyeS4iKTsKLSAgICAgICAgICAgIFN5c3RlbS5nYygpOwotICAgICAgICAgICAgLy8gVE9ETzogc2hvdWxkIHRlbGwgdXNlcnMgd2hhdCBoYXBwZW5lZD8KLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgbUN1cnNvci5tb3ZlVG9OZXh0KCk7Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBUaGlzIGZ1bmN0aW9uIGRvZXMgbm90IGNhcmUgdGhlIE91dE9mTWVtb3J5RXJyb3Igb24gdGhlIGhhbmRsZXIgc2lkZQotICAgICAgICAvLyA6LVAKLSAgICAgICAgaWYgKG1DYXJlSGFuZGxlckVycm9ycykgewotICAgICAgICAgICAgTGlzdDxPbmVFbnRyeUhhbmRsZXI+IGZpbmlzaGVkTGlzdCA9IG5ldyBBcnJheUxpc3Q8T25lRW50cnlIYW5kbGVyPigKLSAgICAgICAgICAgICAgICAgICAgbUhhbmRsZXJMaXN0LnNpemUoKSk7Ci0gICAgICAgICAgICBmb3IgKE9uZUVudHJ5SGFuZGxlciBoYW5kbGVyIDogbUhhbmRsZXJMaXN0KSB7Ci0gICAgICAgICAgICAgICAgaWYgKCFoYW5kbGVyLm9uRW50cnlDcmVhdGVkKHZjYXJkKSkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgZm9yIChPbmVFbnRyeUhhbmRsZXIgaGFuZGxlciA6IG1IYW5kbGVyTGlzdCkgewotICAgICAgICAgICAgICAgIGhhbmRsZXIub25FbnRyeUNyZWF0ZWQodmNhcmQpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgfQotCi0gICAgcHJpdmF0ZSBTdHJpbmcgY3JlYXRlT25lRW50cnlJbnRlcm5hbChmaW5hbCBTdHJpbmcgY29udGFjdElkLAotICAgICAgICAgICAgTWV0aG9kIGdldEVudGl0eUl0ZXJhdG9yTWV0aG9kKSB0aHJvd3MgVkNhcmRFeGNlcHRpb24gewotICAgICAgICBmaW5hbCBNYXA8U3RyaW5nLCBMaXN0PENvbnRlbnRWYWx1ZXM+PiBjb250ZW50VmFsdWVzTGlzdE1hcCA9Ci0gICAgICAgICAgICAgICAgbmV3IEhhc2hNYXA8U3RyaW5nLCBMaXN0PENvbnRlbnRWYWx1ZXM+PigpOwotICAgICAgICAvLyBUaGUgcmVzb2x2ZXIgbWF5IHJldHVybiB0aGUgZW50aXR5IGl0ZXJhdG9yIHdpdGggbm8gZGF0YS4gSXQgaXMgcG9zc2libGUuCi0gICAgICAgIC8vIGUuZy4gSWYgYWxsIHRoZSBkYXRhIGluIHRoZSBjb250YWN0IG9mIHRoZSBnaXZlbiBjb250YWN0IGlkIGFyZSBub3QgZXhwb3J0YWJsZSBvbmVzLAotICAgICAgICAvLyAgICAgIHRoZXkgYXJlIGhpZGRlbiBmcm9tIHRoZ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CAiSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uIGhhcyBiZWVuIHRocm93bjogIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5nZXRNZXNzYWdlKCkpOwotICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxBY2Nlc3NFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiSWxsZWdhbEFjY2Vzc0V4Y2VwdGlvbiBoYXMgYmVlbiB0aHJvd246ICIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUuZ2V0TWVzc2FnZSgpKTsKLSAgICAgICAgICAgICAgICB9IGNhdGNoIChJbnZvY2F0aW9uVGFyZ2V0RXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIkludm9jYXRpb25UYXJnZXRFeGNlcHRpb24gaGFzIGJlZW4gdGhyb3duOiAiKTsKLSAgICAgICAgICAgICAgICAgICAgU3RhY2tUcmFjZUVsZW1lbnRbXSBzdGFja1RyYWNlRWxlbWVudHMgPSBlLmdldENhdXNlKCkuZ2V0U3RhY2tUcmFjZSgpOwotICAgICAgICAgICAgICAgICAgICBmb3IgKFN0YWNrVHJhY2VFbGVtZW50IGVsZW1lbnQgOiBzdGFja1RyYWNlRWxlbWVudHMpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICIgICAgYXQgIiArIGVsZW1lbnQudG9TdHJpbmcoKSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFZDYXJkRXhjZXB0aW9uKCJJbnZvY2F0aW9uVGFyZ2V0RXhjZXB0aW9uIGhhcyBiZWVuIHRocm93bjogIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5nZXRDYXVzZSgpLmdldE1lc3NhZ2UoKSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBlbnRpdHlJdGVyYXRvciA9IFJhd0NvbnRhY3RzLm5ld0VudGl0eUl0ZXJhdG9yKG1Db250ZW50UmVzb2x2ZXIucXVlcnkoCi0gICAgICAgICAgICAgICAgICAgICAgICB1cmksIG51bGwsIHNlbGVjdGlvbiwgc2VsZWN0aW9uQXJncywgbnVsbCkpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoZW50aXR5SXRlcmF0b3IgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJFbnRpdHlJdGVyYXRvciBpcyBudWxsIik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuICIiOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoIWVudGl0eUl0ZXJhdG9yLmhhc05leHQoKSkgewotICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcsICJEYXRhIGRvZXMgbm90IGV4aXN0LiBjb250YWN0SWQ6ICIgKyBjb250YWN0SWQpOwotICAgICAgICAgICAgICAgIHJldHVybiAiIjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgd2hpbGUgKGVudGl0eUl0ZXJhdG9yLmhhc05leHQoKSkgewotICAgICAgICAgICAgICAgIEVudGl0eSBlbnRpdHkgPSBlbnRpdHlJdGVyYXRvci5uZXh0KCk7Ci0gICAgICAgICAgICAgICAgZm9yIChOYW1lZENvbnRlbnRWYWx1ZXMgbmFtZWRDb250ZW50VmFsdWVzIDogZW50aXR5LmdldFN1YlZhbHVlcygpKSB7Ci0gICAgICAgICAgICAgICAgICAgIENvbnRlbnRWYWx1ZXMgY29udGVudFZhbHVlcyA9IG5hbWVkQ29udGVudFZhbHVlcy52YWx1ZXM7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyBrZXkgPSBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKERhdGEuTUlNRVRZUEUpOwotICAgICAgICAgICAgICAgICAgICBpZiAoa2V5ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExpc3Q8Q29udGVudFZhbHVlcz4gY29udGVudFZhbHVlc0xpc3QgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50VmFsdWVzTGlzdE1hcC5nZXQoa2V5KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb250ZW50VmFsdWVzTGlzdCA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFZhbHVlc0xpc3QgPSBuZXcgQXJyYXlMaXN0PENvbnRlbnRWYWx1ZXM+KCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFZhbHVlc0xpc3RNYXAucHV0KGtleSwgY29udGVudFZhbHVlc0xpc3QpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFZhbHVlc0xpc3QuYWRkKGNvbnRlbnRWYWx1ZXMpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgaWYgKGVudGl0eUl0ZXJhdG9yICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBlbnRpdHlJdGVyYXRvci5jbG9zZSgpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgZmluYWwgVkNhcmRCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgVkNhcmRCdWlsZGVyKG1WQ2FyZFR5cGUpOwotICAgICAgICBidWlsZGVyLmFwcGVuZE5hbWVQcm9wZXJ0aWVzKGNvbnRlbnRWYWx1ZXNMaXN0TWFwLmdldChTdHJ1Y3R1cmVkTmFtZS5DT05URU5UX0lURU1fVFlQRSkpCi0gICAgICAgICAgICAgICAgLmFwcGVuZE5pY2tOYW1lcyhjb250ZW50VmFsdWVzTGlzdE1hcC5nZXQoTmlja25hbW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mFsdWVzTGlzdE1hcC5nZXQoSW0uQ09OVEVOVF9JVEVNX1RZUEUpKQotICAgICAgICAgICAgICAgIC5hcHBlbmRSZWxhdGlvbihjb250ZW50VmFsdWVzTGlzdE1hcC5nZXQoUmVsYXRpb24uQ09OVEVOVF9JVEVNX1RZUEUpKTsKLSAgICAgICAgcmV0dXJuIGJ1aWxkZXIudG9TdHJpbmcoKTsKLSAgICB9Ci0KLSAgICBwdWJsaWMgdm9pZCB0ZXJtaW5hdGUoKSB7Ci0gICAgICAgIGZvciAoT25lRW50cnlIYW5kbGVyIGhhbmRsZXIgOiBtSGFuZGxlckxpc3QpIHsKLSAgICAgICAgICAgIGhhbmRsZXIub25UZXJtaW5hdGUoKTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtQ3Vyc29yICE9IG51bGwpIHsKLSAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgbUN1cnNvci5jbG9zZSgpOwotICAgICAgICAgICAgfSBjYXRjaCAoU1FMaXRlRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiU1FMaXRlRXhjZXB0aW9uIG9uIEN1cnNvciNjbG9zZSgpOiAiICsgZS5nZXRNZXNzYWdlKCkpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbUN1cnNvciA9IG51bGw7Ci0gICAgICAgIH0KLQotICAgICAgICBtVGVybWluYXRlSXNDYWxsZWQgPSB0cnVlOwotICAgIH0KLQotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyB2b2lkIGZpbmFsaXplKCkgewotICAgICAgICBpZiAoIW1UZXJtaW5hdGVJc0NhbGxlZCkgewotICAgICAgICAgICAgdGVybWluYXRlKCk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBwdWJsaWMgaW50IGdldENvdW50KCkgewotICAgICAgICBpZiAobUN1cnNvciA9PSBudWxsKSB7Ci0gICAgICAgICAgICByZXR1cm4gMDsKLSAgICAgICAgfQot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bmcgZGF0YSwgU3RyaW5nIGxhYmVsLCBib29sZWFuIGlzUHJpbWFyeSkgewotICAgICAgICAgICAgdGhpcy50eXBlID0gdHlwZTsKLSAgICAgICAgICAgIHRoaXMuZGF0YSA9IGRhdGE7Ci0gICAgICAgICAgICB0aGlzLmxhYmVsID0gbGFiZWw7Ci0gICAgICAgICAgICB0aGlzLmlzUHJpbWFyeSA9IGlzUHJpbWFyeTsKLSAgICAgICAgfQotCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG9iaikgewotICAgICAgICAgICAgaWYgKCEob2JqIGluc3RhbmNlb2YgUGhvbmVEYXRhKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIFBob25lRGF0YSBwaG9uZURhdGEgPSAoUGhvbmVEYXRhKW9iajsKLSAgICAgICAgICAgIHJldHVybiAodHlwZSA9PSBwaG9uZURhdGEudHlwZSAmJiBkYXRhLmVxdWFscyhwaG9uZURhdGEuZGF0YSkgJiYKLSAgICAgICAgICAgICAgICAgICAgbGFiZWwuZXF1YWxzKHBob25lRGF0YS5sYWJlbCkgJiYgaXNQcmltYXJ5ID09IHBob25lRGF0YS5pc1ByaW1hcnkpOwotICAgICAgICB9Ci0KLSAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7Ci0gICAgICAgICAgICByZXR1cm4gU3RyaW5nLmZvcm1hdCgidHlwZTogJWQsIGRhdGE6ICVzLCBsYWJlbDogJXMsIGlzUHJpbWFyeTogJXMiLAotICAgICAgICAgICAgICAgICAgICB0eXBlLCBkYXRhLCBsYWJlbCwgaXNQcmltYXJ5KTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHN0YXRpYyBwdWJsaWMgY2xhc3MgRW1haWxEYXRhIHsKLSAgICAgICAgcHVibGljIGZpbmFsIGludCB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gdHlwZTsKLSAgICAgICAgcHVibGljIGZpbmFsIFN0cmluZyBsYWJlbDsKLSAgICAgICAgcHVibGljIGJvb2xlYW4gaXNQcmltYXJ5OwotCi0gICAgICAgIHB1YmxpYyBQb3N0YWxEYXRhKGZpbmFsIGludCB0eXBlLCBmaW5hbCBMaXN0PFN0cmluZz4gcHJvcFZhbHVlTGlzdCwKLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgbGFiZWwsIGJvb2xlYW4gaXNQcmltYXJ5KSB7Ci0gICAgICAgICAgICB0aGlzLnR5cGUgPSB0eXBlOwotICAgICAgICAgICAgZGF0YUFycmF5ID0gbmV3IFN0cmluZ1tBRERSX01BWF9EQVRBX1NJWkVdOwotCi0gICAgICAgICAgICBpbnQgc2l6ZSA9IHByb3BWYWx1ZUxpc3Quc2l6ZSgpOwotICAgICAgICAgICAgaWYgKHNpemUgPiBBRERSX01BWF9EQVRBX1NJWkUpIHsKLSAgICAgICAgICAgICAgICBzaXplID0gQUREUl9NQVhfREFUQV9TSVpFOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvLyBhZHItdmFsdWUgPSAwKjYodGV4dC12YWx1ZSAiOyIpIHRleHQtdmFsdWUKLSAgICAgICAgICAgIC8vICAgICAgICAgICA7IFBPIEJveCwgRXh0ZW5kZWQgQWRkcmVzcywgU3RyZWV0LCBMb2NhbGl0eSwgUmVnaW9uLCBQb3N0YWwKLSAgICAgICAgICAgIC8vICAgICAgICAgICA7IENvZGUsIENvdW50cnkgTmFtZQotICAgICAgICAgICAgLy8KLSAgICAgICAgICAgIC8vIFVzZSBJdGVyYXRvciBhc3N1bWluZyBMaXN0IG1heSBiZSBMaW5rZWRMaXN0LCB0aG91Z2ggYWN0dWFsbHkgaXQgaXMKLSAgICAgICAgICAgIC8vIGFsd2F5cyBBcnJheUxpc3QgaW4gdGhlIGN1cnJlbnQgaW1wbGVtZW50YXRpb24uCi0gICAgICAgICAgICBpbnQgaSA9IDA7Ci0gICAgICAgICAgICBmb3IgKFN0cmluZyBhZGRyZXNzRWxlbWVudCA6IHByb3BWYWx1ZUxpc3QpIHsKLSAgICAgICAgICAgICAgICBkYXRhQXJyYXlbaV0gPSBhZGRyZXNzRWxlbWVudDsKLSAgICAgICAgICAgICAgICBpZiAoKytpID49IHNpemUpIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgd2hpbGUgKGkgPCBBRERSX01BWF9EQVRBX1NJWkUpIHsKLSAgICAgICAgICAgICAgICBkYXRhQXJyYXlbaSsrXSA9IG51bGw7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHRoaXMucG9ib3ggPSBkYXRhQXJyYXlbMF07Ci0gICAgICAgICAgICB0aGlzLmV4dGVuZGVkQWRkcmVzcyA9IGRhdGFBcnJheVsxXTsKLSAgICAgICAgICAgIHRoaXMuc3RyZWV0ID0gZGF0YUFycmF5WzJdOwotICAgICAgICAgICAgdGhpcy5sb2NhbHR5ID0gZGF0YUFycmF5WzNdOwotICAgICAgICAgICAgdGhpcy5yZWdpb24gPSBkYXRhQXJyYXlbNF07Ci0gICAgICAgICAgICB0aGlzLnBvc3RhbENvZGUgPSBkYXRhQXJyYXlbNV07Ci0gICAgICAgICAgICB0aGlzLmNvdW50cnkgPSBkYXRhQXJyYXlbNl07Ci0gICAgICAgICAgICB0aGlzLmxhYmVsID0gbGFiZWw7Ci0gICAgICAgICAgICB0aGlzLmlzUHJpbWFyeSA9IGlzUHJpbWFyeTsKLSAgICAgICAgfQotCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG9iaikgewotICAgICAgICAgICAgaWYgKCEob2JqIGluc3RhbmNlb2YgUG9zdGFsRGF0YSkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgIC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ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWVtcHR5KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoJyAnKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZW1wdHkgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGFkZHJlc3NQYXJ0KTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBBRERSX01BWF9EQVRBX1NJWkU7IGkrKykgewotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgYWRkcmVzc1BhcnQgPSBkYXRhQXJyYXlbaV07Ci0gICAgICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoYWRkcmVzc1BhcnQpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWVtcHR5KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoJyAnKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZW1wdHkgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGFkZHJlc3NQYXJ0KTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmV0dXJuIGJ1aWxkZXIudG9TdHJpbmcoKS50cmltKCk7Ci0gICAgICAgIH0KLQotICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKLSAgICAgICAgICAgIHJldHVybiBTdHJpbmcuZm9ybWF0KCJ0eXBlOiAlZCwgbGFiZWw6ICVzLCBpc1ByaW1hcnk6ICVzIiwKLSAgICAgICAgICAgICAgICAgICAgdHlwZSwgbGFiZWwsIGlzUHJpbWFyeSk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBzdGF0aWMgcHVibGljIGNsYXNzIE9yZ2FuaXphdGlvbkRhdGEgewotICAgICAgICBwdWJsaWMgZmluYWwgaW50IHR5cGU7Ci0gICAgICAgIC8vIG5vbi1maW5hbCBpcyBJbnRlbnRpb25hbDogd2UgbWF5IGNoYW5nZSB0aGUgdmFsdWVzIHNpbmNlIHRoaXMgaW5mbyBpcyBzZXBhcmF0ZWQgaW50bwotICAgICAgICAvLyB0d28gcGFydHMgaW4gdkNhcmQ6ICJPUkciICsgIlRJVExFIi4KLSAgICAgICAgcHVibGljIFN0cmluZyBjb21wYW55TmFtZTsKLSAgICAgICAgcHVibGljIFN0cmluZyBkZXBhcnRtZW50TmFtZTsKLSAgICAgICAgcHVibGljIFN0cmluZyB0aXRsZU5hbWU7Ci0gICAgICAgIHB1YmxpYyBib29sZWFuIGlzUHJpbWFyeTsKLQotICAgICAgICBwdWJsaWMgT3JnYW5pemF0aW9uRGF0YShpbnQgdHlwZSwKLSAgICAgICAgICAgICAgICBTdHJpbmcgY29tcGFueU5hbWUsCi0gICAgICAgICAgICAgICAgU3RyaW5nIGRlcGFydG1lbnROYW1lLAotICAgICAgICAgICAgICAgIFN0cmluZyB0aXRsZU5hbWUsCi0gICAgICAgICAgICAgICAgYm9vbGVhbiBpc1ByaW1hcnkpIHsKLSAgICAgICAgICAgIHRoaXMudHlwZSA9IHR5cGU7Ci0gICAgICAgICAgICB0aGlzLmNvbXBhbnlOYW1lID0gY29tcGFueU5hbWU7Ci0gICAgICAgICAgICB0aGlzLmRlcGFydG1lbnROYW1lID0gZGVwYXJ0bWVudE5hbWU7Ci0gICAgICAgICAgICB0aGlzLnRpdGxlTmFtZSA9IHRpdGxlTmFtZTsKLSAgICAgICAgICAgIHRoaXMuaXNQcmltYXJ5ID0gaXNQcmltYXJ5OwotICAgICAgICB9Ci0KLSAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgIHB1YmxpYyBib29sZWFuIGVxdWFscyhPYmplY3Qgb2JqKSB7Ci0gICAgICAgICAgICBpZiAoIShvYmogaW5zdGFuY2VvZiBPcmdhbml6YXRpb25EYXRhKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIE9yZ2FuaXphdGlvbkRhdGEgb3JnYW5pemF0aW9uID0gKE9yZ2FuaXphdGlvbkRhdGEpb2JqOwotICAgICAgICAgICAgcmV0dXJuICh0eXBlID09IG9yZ2FuaXphdGlvbi50eXBlICYmCi0gICAgICAgICAgICAgICAgICAgIFRleHRVdGlscy5lcXVhbHMoY29tcGFueU5hbWUsIG9yZ2FuaXphdGlvbi5jb21wYW55TmFtZSkgJiYKLSAgICAgICAgICAgICAgICAgICAgVGV4dFV0aWxzLmVxdWFscyhkZXBhcnRtZW50TmFtZSwgb3JnYW5pemF0aW9uLmRlcGFydG1lbnROYW1lKSAmJgotICAgICAgICAgICAgICAgICAgICBUZXh0VXRpbHMuZXF1YWxzKHRpdGxlTmFtZSwgb3JnYW5pemF0aW9uLnRpdGxlTmFtZSkgJiYKLSAgICAgICAgICAgICAgICAgICAgaXNQcmltYXJ5ID09IG9yZ2FuaXphdGlvbi5pc1ByaW1hcnkpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIFN0cmluZyBnZXRGb3JtYXR0ZWRTdHJpbmcoKSB7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShjb21wYW55TmFtZSkpIHsKLSAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChjb21wYW55TmFtZSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoZGVwYXJ0bWVudE5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGJ1aWxkZXIubGVuZ3RoKCkgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIsICIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChkZXBhcnRtZW50TmFtZSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkodGl0bGVOYW1lKSkgewotICAgICAgICAgICAgICAgIGlmIChidWlsZGVyLmxlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiLCAiKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQodGl0bGVOYW1lKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmV0dXJuIGJ1aWxkZXIudG9TdHJpbmcoKTsKLSAgICAgICAgfQotCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgewotICAgICAgICAgICAgcmV0dXJuIFN0cmluZy5mb3JtYXQoCi0gICAgICAgICAgICAgICAgICAgICJ0eXBlOiAlZCwgY29tcGFueTogJXMsIGRlcGFydG1lbnQ6ICVzLCB0aXRsZTogJXMsIGlzUHJpbWFyeTogJXMiLAotICAgICAgICAgICAgICAgICAgICB0eXBlLCBjb21wYW55TmFtZSwgZGVwYXJ0bWVudE5hbWUsIHRpdGxlTmFtZSwgaXNQcmltYXJ5KTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHN0YXRpYyBwdWJsaWMgY2xhc3MgSW1EYXRhIHsKLSAgICAgICAgcHVibGljIGZpbmFsIGludCBwcm90b2NvbDsKLSAgICAgICAgcHVibGljIGZpbmFsIFN0cmluZyBjdXN0b21Qcm90b2NvbDsKLSAgICAgICAgcHVibGljIGZpbmFsIGludCB0eXBlOwotICAgICAgICBwdWJsaWMgZmluYWwgU3RyaW5nIGRhdGE7Ci0gICAgICAgIHB1YmxpYyBmaW5hbCBib29sZWFuIGlzUHJpbWFyeTsKLQotICAgICAgICBwdWJsaWMgSW1EYXRhKGZpbmFsIGludCBwcm90b2NvbCwgZmluYWwgU3RyaW5nIGN1c3RvbVByb3RvY29sLCBmaW5hbCBpbnQgdHlwZSwKLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgZGF0YSwgZmluYWwgYm9vbGVhbiBpc1ByaW1hcnkpIHsKLSAgICAgICAgICAgIHRoaXMucHJvdG9jb2wgPSBwcm90b2NvbDsKLSAgICAgICAgICAgIHRoaXMuY3VzdG9tUHJvdG9jb2wgPSBjdXN0b21Qcm90b2NvbDsKLSAgICAgICAgICAgIHRoaXMudHlwZSA9IHR5cGU7Ci0gICAgICAgICAgICB0aGlzLmRhdGEgPSBkYXRhOwotICAgICAgICAgICAgdGhpcy5pc1ByaW1hcnkgPSBpc1ByaW1hcnk7Ci0gICAgICAgIH0KLQotICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgcHVibGljIGJvb2xlYW4gZXF1YWxzKE9iamVjdCBvYmopIHsKLSAgICAgICAgICAgIGlmICghKG9iaiBpbnN0YW5jZW9mIEltRGF0YSkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBJbURhdGEgaW1EYXRhID0gKEltRGF0YSlvYmo7Ci0gICAgICAgICAgICByZXR1cm4gKHR5cGUgPT0gaW1EYXRhLnR5cGUgJiYgcHJvdG9jb2wgPT0gaW1EYXRhLnByb3RvY29sCi0gICAgIC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eXRlczsKLSAgICAgICAgcHVibGljIGZpbmFsIGJvb2xlYW4gaXNQcmltYXJ5OwotCi0gICAgICAgIHB1YmxpYyBQaG90b0RhdGEoaW50IHR5cGUsIFN0cmluZyBmb3JtYXROYW1lLCBieXRlW10gcGhvdG9CeXRlcywgYm9vbGVhbiBpc1ByaW1hcnkpIHsKLSAgICAgICAgICAgIHRoaXMudHlwZSA9IHR5cGU7Ci0gICAgICAgICAgICB0aGlzLmZvcm1hdE5hbWUgPSBmb3JtYXROYW1lOwotICAgICAgICAgICAgdGhpcy5waG90b0J5dGVzID0gcGhvdG9CeXRlczsKLSAgICAgICAgICAgIHRoaXMuaXNQcmltYXJ5ID0gaXNQcmltYXJ5OwotICAgICAgICB9Ci0KLSAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgIHB1YmxpYyBib29sZWFuIGVxdWFscyhPYmplY3Qgb2JqKSB7Ci0gICAgICAgICAgICBpZiAoIShvYmogaW5zdGFuY2VvZiBQaG90b0RhdGEpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgUGhvdG9EYXRhIHBob3RvRGF0YSA9IChQaG90b0RhdGEpb2JqOwotICAgICAgICAgICAgcmV0dXJuICh0eXBlID09IHBob3RvRGF0YS50eXBlICYmCi0gICAgICAgICAgICAgICAgICAgIChmb3JtYXROYW1lID09IG51bGwgPyAocGhvdG9EYXRhLmZvcm1hdE5hbWUgPT0gbnVsbCkgOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcm1hdE5hbWUuZXF1YWxzKHBob3RvRGF0YS5mb3JtYXROYW1lKSkgJiYKLSAgICAgICAgICAgICAgICAgICAgKEFycmF5cy5lcXVhbHMocGhvdG9CeXRlcywgcGhvdG9EYXRhLnBob3RvQnl0ZXMpKSAmJgotICAgICAgICAgICAgICAgICAgICAoaXNQcmltYXJ5ID09IHBob3RvRGF0YS5pc1ByaW1hcnkpKTsKLSAgICAgICAg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ICAgICBjYXNlIDA6IHsKLSAgICAgICAgICAgICAgICBjb21wYW55TmFtZSA9ICIiOwotICAgICAgICAgICAgICAgIGRlcGFydG1lbnROYW1lID0gbnVsbDsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgMTogewotICAgICAgICAgICAgICAgIGNvbXBhbnlOYW1lID0gb3JnTGlzdC5nZXQoMCk7Ci0gICAgICAgICAgICAgICAgZGVwYXJ0bWVudE5hbWUgPSBudWxsOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZGVmYXVsdDogeyAgLy8gTW9yZSB0aGFuIDEuCi0gICAgICAgICAgICAgICAgY29tcGFueU5hbWUgPSBvcmdMaXN0LmdldCgwKTsKLSAgICAgICAgICAgICAgICAvLyBXZSdyZSBub3Qgc3VyZSB3aGljaCBpcyB0aGUgY29ycmVjdCBzdHJpbmcgZm9yIGRlcGFydG1lbnQuCi0gICAgICAgICAgICAgICAgLy8gSW4gb3JkZXIgdG8ga2VlcCBhbGwgdGhlIGRhdGEsIGNvbmNhdGluYXRlIHRoZSByZXN0IG9mIGVsZW1lbnRzLgotICAgICAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7Ci0gICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDE7IGkgPCBzaXplOyBpKyspIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGkgPiAxKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgnICcpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKG9yZ0xpc3QuZ2V0KGkpKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZGVwYXJ0bWVudE5hbWUgPSBidWlsZGVyLnRvU3RyaW5nKC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fQotCi0gICAgICAgIGlmIChlbGVtcy5nZXQoMCkubGVuZ3RoKCkgPiAwKSB7Ci0gICAgICAgICAgICBib29sZWFuIG9ubHlGaXJzdEVsZW1Jc05vbkVtcHR5ID0gdHJ1ZTsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSAxOyBpIDwgc2l6ZTsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGVsZW1zLmdldChpKS5sZW5ndGgoKSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgb25seUZpcnN0RWxlbUlzTm9uRW1wdHkgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG9ubHlGaXJzdEVsZW1Jc05vbkVtcHR5KSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nW10gbmFtZXNBcnJheSA9IGVsZW1zLmdldCgwKS5zcGxpdCgiICIpOwotICAgICAgICAgICAgICAgIGZpbmFsIGludCBuYW1lQXJyYXlMZW5ndGggPSBuYW1lc0FycmF5Lmxlbmd0aDsKLSAgICAgICAgICAgICAgICBpZiAobmFtZUFycmF5TGVuZ3RoID09IDMpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gQXNzdW1lIHRoZSBzdHJpbmcgaXMgIkZhbWlseSBNaWRkbGUgR2l2ZW4iLgotICAgICAgICAgICAgICAgICAgICBtUGhvbmV0aWNGYW1pbHlOYW1lID0gbmFtZXNBcnJheVswXTsKLSAgICAgICAgICAgICAgICAgICAgbVBob25ldGljTWlkZGxlTmFtZSA9IG5hbWVzQXJyYXlbMV07Ci0gICAgICAgICAgICAgICAgICAgIG1QaG9uZXRpY0dpdmVuTmFtZSA9IG5hbWVzQXJyYXlbMl07Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChuYW1lQXJyYXlMZW5ndGggPT0gMikgewotICAgICAgICAgICAgICAgICAgICAvLyBBc3N1bWUgdGhlIHN0cmluZyBpcyAiRmFtaWx5IEdpdmVuIiBiYXNlZCBvbiB0aGUgSmFwYW5lc2UgbW9iaWxlCi0gICAgICAgICAgICAgICAgICAgIC8vIHBob25lcycgcHJlZmVyZW5jZS4KLSAgICAgICAgICAgICAgICAgICAgbVBob25ldGljRmFtaWx5TmFtZSA9IG5hbWVzQXJyYXlbMF07Ci0gICAgICAgICAgICAgICAgICAgIG1QaG9uZXRpY0dpdmVuTmFtZSA9IG5hbWVzQXJyYXlbMV07Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgbVBob25ldGljRnVsbE5hbWUgPSBlbGVtcy5nZXQoMCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHN3aXRjaCAoc2l6ZSkgewotICAgICAgICAgICAgLy8gZmFsbHRocm91Z2gKLSAgICAgICAgICAgIGNhc2UgMzogbVBob25ldGljTWlkZGxlTmFtZSA9IGVsZW1zLmdldCgyKTsKLSAgICAgICAgICAgIGNhc2UgMjogbVBob25ldGljR2l2ZW5OYW1lID0gZWxlbXMuZ2V0KDEpOwotICAgICAgICAgICAgZGVmYXVsdDogbVBob25ldGljRmFtaWx5TmFtZSA9IGVsZW1zLmdldCgwKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHB1YmxpYyB2b2lkIGFkZFByb3BlcnR5KGZpbmFsIFByb3BlcnR5IHByb3BlcnR5KSB7Ci0gICAgICAgIGZpbmFsIFN0cmluZyBwcm9wTmFtZSA9IHByb3BlcnR5Lm1Qcm9wZXJ0eU5hbWU7Ci0gICAgICAgIGZpbmFsIE1hcDxTdHJpbmcsIENvbGxlY3Rpb248U3RyaW5nPj4gcGFyYW1NYXAgPSBwcm9wZXJ0eS5tUGFyYW1ldGVyTWFwOwotICAgICAgICBmaW5hbCBMaXN0PFN0cmluZz4gcHJvcFZhbHVlTG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3aGljaCBpcyBjb3JyZWN0IGJlaGF2aW9yIGZyb20gdGhlIHZpZXcgb2YgdkNhcmQgMi4xLgotICAgICAgICAgICAgICAgIC8vIEJ1dCB3ZSB3YW50IGl0IHRvIGJlIHNlcGFyYXRlZCwgc28gZG8gdGhlIHNlcGFyYXRpb24gaGVyZS4KLSAgICAgICAgICAgICAgICBmaW5hbCBMaXN0PFN0cmluZz4gcGhvbmV0aWNOYW1lTGlzdCA9Ci0gICAgICAgICAgICAgICAgICAgICAgICBWQ2FyZFV0aWxzLmNvbnN0cnVjdExpc3RGcm9tVmFsdWUocHJvcFZhbHVlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWQ2FyZENvbmZpZy5pc1YzMChtVkNhcmRUeXBlKSk7Ci0gICAgICAgICAgICAgICAgaGFuZGxlUGhvbmV0aWNOYW1lRnJvbVNvdW5kKHBob25ldGljTmFtZUxpc3QpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAvLyBJZ25vcmUgdGhpcyBmaWVsZCBzaW5jZSBBbmRyb2lkIGNhbm5vdCB1bmRlcnN0YW5kIHdoYXQgaXQgaXMuCi0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSBpZiAocHJvcE5hbWUuZXF1YWxzKFZDYXJkQ29uc3RhbnRzLlBST1BFUlRZX0FEUikpIHsKLSAgICAgICAgICAgIGJvb2xlYW4gdmFsdWVzQXJlQWxsRW1wdHkgPSB0cnVlOwotICAgICAgICAgICAgZm9yIChTdHJpbmcgdmFsdWUgOiBwcm9wVmFsdWVMaXN0KSB7Ci0gICAgICAgICAgICAgICAgaWYgKHZhbHVlLmxlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgICAgICAgICB2YWx1ZXNBcmVBbGxFbXB0eSA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAodmFsdWVzQXJlQWxsRW1wdHkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGludCB0eXBlID0gLTE7Ci0gICAgICAgICAgICBTdHJpbmcgbGFiZWwgPSAiIjsKLSAgICAgICAgICAgIGJvb2xlYW4gaXNQcmltYXJ5ID0gZmFsc2U7Ci0gICAgICAgICAgICBDb2xsZWN0aW9uPFN0cmluZz4gdHlwZUNvbGxlY3Rpb24gPSBwYXJhbU1hcC5nZXQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRSk7Ci0gICAgICAgICAgICBpZiAodHlwZUNvbGxlY3Rpb24gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIHR5cGVTdHJpbmcgOiB0eXBlQ29sbGVjdGlvbikgewotICAgICAgICAgICAgICAgICAgICB0eXBlU3RyaW5nID0gdHlwZVN0cmluZy50b1VwcGVyQ2FzZSgpOwotICAgICAgICAgICAgICAgICAgICBpZiAodHlwZVN0cmluZy5lcXVhbHMoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9QUkVGKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgaXNQcmltYXJ5ID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlU3RyaW5nLmVxdWFscyhWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX0hPTUUpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0gU3RydWN0dXJlZFBvc3RhbC5UWVBFX0hPTUU7Ci0gICAgICAgICAgICAgICAgICAgICAgICBsYWJlbCA9ICIiOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVTdHJpbmcuZXF1YWxzKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfV09SSykgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlU3RyaW5nLmVxdWFsc0lnbm9yZUNhc2UoVkNhcmRDb25zdGFudHMuUEFSQU1fRVhUUkFfVFlQRV9DT01QQU5ZKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gIkNPTVBBTlkiIHNlZW1zIGVtaXR0ZWQgYnkgV2luZG93cyBNb2JpbGUsIHdoaWNoIGlzIG5vdAotICAgICAgICAgICAgICAgICAgICAgICAgLy8gc3BlY2lmaWNhbGx5IHN1cHBvcnRlZCBieSB2Q2FyZCAyLjEuIFdlIGFzc3VtZSB0aGlzIGlzIHNhbWUKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFzICJXT1JLIi4KLSAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSBTdHJ1Y3R1cmVkUG9zdGFsLlRZUEVfV09SSzsKLSAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsID0gIiI7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZVN0cmluZy5lcXVhbHMoVkNhcmRDb25zdGFudHMuUEFSQU1fQURSX1RZUEVfUEFSQ0VMKSB8fAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVTdHJpbmcuZXF1YWxzKFZDYXJkQ29uc3RhbnRzLlBBUkFNX0FEUl9UWVBFX0RPTSkgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlU3RyaW5nLmVxdWFscyhWQ2FyZENvbnN0YW50cy5QQVJBTV9BRFJfVFlQRV9JTlRMKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2UgZG8gbm90IGhhdmUgYW55IGFwcHJvcHJpYXRlIHdheSB0byBzdG9yZSB0aGlzIGluZm9ybWF0aW9uLgotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVTdHJpbmcuc3RhcnRzV2l0aCgiWC0iKSAmJiB0eXBlIDwgMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVTdHJpbmcgPSB0eXBlU3RyaW5nLnN1YnN0cmluZygyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHZDYXJkIDMuMCBhbGxvd3MgaWFuYS10b2tlbi4gQWxzbyBzb21lIHZDYXJkIDIuMSBleHBvcnRlcnMKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGVtaXQgbm9uLXN0YW5kYXJkIHR5cGVzLiBXZSBkbyBub3QgaGFuZGxlIHRoZWlyIHZhbHVlcyBub3cuCi0gICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0gU3RydWN0dXJlZFBvc3RhbC5UWVBFX0NVU1RPTTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsID0gdHlwZVN0cmluZzsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIC8vIFdlIHVzZSAiSE9NRSIgYXMgZGVmYXVsdAotICAgICAgICAgICAgaWYgKHR5cGUgPCAwKSB7Ci0gICAgICAgICAgICAgICAgdHlwZSA9IFN0cnVjdHVyZWRQb3N0YWwuVFlQRV9IT01FOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBhZGRQb3N0YWwodHlwZSwgcHJvcFZhbHVlTGlzdCwgbGFiZWwsIGlzUHJpbWFyeSk7Ci0gICAgICAgIH0gZWxzZSBpZiAocHJvcE5hbWUuZXF1YWxzKFZDYXJkQ29uc3RhbnRzLlBST1BFUlRZX0VNQUlMKSkgewotICAgICAgICAgICAgaW50IHR5cGUgPSAtMTsKLSAgICAgICAgICAgIFN0cmluZyBsYWJlbCA9IG51bGw7Ci0gICAgICAgICAgICBib29sZWFuIGlzUHJpbWFyeSA9IGZhbHNlOwotICAgICAgICAgICAgQ29sbGVjdGlvbjxTdHJpbmc+IHR5cGVDb2xsZWN0aW9uID0gcGFyYW1NYXAuZ2V0KFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEUpOwotICAgICAgICAgICAgaWYgKHR5cGVDb2xsZWN0aW9uICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBmb3IgKFN0cmluZyB0eXBlU3RyaW5nIDogdHlwZUNvbGxlY3Rpb24pIHsKLSAgICAgICAgICAgICAgICAgICAgdHlwZVN0cmluZyA9IHR5cGVTdHJpbmcudG9VcHBlckNhc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVTdHJpbmcuZXF1YWxzKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfUFJFRikpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlzUHJpbWFyeSA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZVN0cmluZy5lcXVhbHMoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9IT01FKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9IEVtYWlsLlRZUEVfSE9NRTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlU3RyaW5nLmVxdWFscyhWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX1dPUkspKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0gRW1haWwuVFlQRV9XT1JLOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVTdHJpbmcuZXF1YWxzKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfQ0VMTCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSBFbWFpbC5UWVBFX01PQklMRTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlU3RyaW5nLnN0YXJ0c1dpdGgoIlgtIikgJiYgdHlwZSA8IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlU3RyaW5nID0gdHlwZVN0cmluZy5zdWJzdHJpbmcoMik7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyB2Q2FyZCAzLjAgYWxsb3dzIGlhbmEtdG9rZW4uCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBtYXkgaGF2ZSBJTlRFUk5FVCAoc3BlY2lmaWVkIGluIHZDYXJkIHNwZWMpLAotICAgICAgICAgICAgICAgICAgICAgICAgLy8gU0NIT09MLCBldGMuCi0gICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0gRW1haWwuVFlQRV9DVVNUT007Ci0gICAgICAgICAgICAgICAgICAgICAgICBsYWJlbCA9IHR5cGVTdHJpbmc7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAodHlwZSA8IDApIHsKLSAgICAgICAgICAgICAgICB0eXBlID0gRW1haWwuVFlQRV9PVEhFUjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGFkZEVtYWlsKHR5cGUsIHByb3BWYWx1ZSwgbGFiZWwsIGlzUHJpbWFyeSk7Ci0gICAgICAgIH0gZWxzZSBpZiAocHJvcE5hbWUuZXF1YWxzKFZDYXJkQ29uc3RhbnRzLlBST1BFUlRZX09SRykpIHsKLSAgICAgICAgICAgIC8vIHZDYXJkIHNwZWNpZmljYXRpb24gZG9lcyBub3Qgc3BlY2lmeSBvdGhlciB0eXBlcy4KLSAgICAgICAgICAgIGZpbmFsIGludCB0eXBlID0gT3JnYW5pemF0aW9uLlRZUEVfV09SSzsKLSAgICAgICAgICAgIGJvb2xlYW4gaXNQcmltYXJ5ID0gZmFsc2U7Ci0gICAgICAgICAgICBDb2xsZWN0aW9uPFN0cmluZz4gdHlwZUNvbGxlY3Rpb24gPSBwYXJhbU1hcC5nZXQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRSk7Ci0gICAgICAgICAgICBpZiAodHlwZUNvbGxlY3Rpb24gIT0gbnVsbCkgewot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XBWYWx1ZS5jb250YWlucygiVVJMIikpIHsKLSAgICAgICAgICAgICAgICAvLyBDdXJyZW50bHkgd2UgZG8gbm90IGhhdmUgYXBwcm9wcmlhdGUgZXhhbXBsZSBmb3IgdGVzdGluZyB0aGlzIGNhc2UuCi0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGZpbmFsIENvbGxlY3Rpb248U3RyaW5nPiB0eXBlQ29sbGVjdGlvbiA9IHBhcmFtTWFwLmdldCgiVFlQRSIpOwotICAgICAgICAgICAgICAgIFN0cmluZyBmb3JtYXROYW1lID0gbnVsbDsKLSAgICAgICAgICAgICAgICBib29sZWFuIGlzUHJpbWFyeSA9IGZhbHNlOwotICAgICAgICAgICAgICAgIGlmICh0eXBlQ29sbGVjdGlvbiAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIHR5cGVWYWx1ZSA6IHR5cGVDb2xsZWN0aW9uKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9QUkVGLmVxdWFscyh0eXBlVmFsdWUpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNQcmltYXJ5ID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZm9ybWF0TmFtZSA9PSBudWxsKXsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JtYXROYW1lID0gdHlwZVZhbHVlOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGFkZFBob3RvQnl0ZXMoZm9ybWF0TmFtZSwgcHJvcEJ5dGVzLCBpc1ByaW1hcnkpOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgaWYgKHByb3BOYW1lLmVxdWFscyhWQ2FyZENvbnN0YW50cy5QUk9QRVJUWV9URUwpKSB7Ci0gICAgICAgICAgICBmaW5hbCBDb2xsZWN0aW9uPFN0cmluZz4gdHlwZUNvbGxlY3Rpb24gPSBwYXJhbU1hcC5nZXQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRSk7Ci0gICAgICAgICAgICBmaW5hbCBPYmplY3QgdHlwZU9iamVjdCA9Ci0gICAgICAgICAgICAgICAgVkNhcmRVdGlscy5nZXRQaG9uZVR5cGVGcm9tU3RyaW5ncyh0eXBlQ29sbGVjdGlvbiwgcHJvcFZhbHVlKTsKLSAgICAgICAgICAgIGZpbmFsIGludCB0eXBlOwotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGxhYmVsOwotICAgICAgICAgICAgaWYgKHR5cGVPYmplY3QgaW5zdGFuY2VvZiBJbnRlZ2VyKSB7Ci0gICAgICAgICAgICAgICAgdHlwZSA9IChJbnRlZ2VyKXR5cGVPYmplY3Q7Ci0gICAgICAgICAgICAgICAgbGFiZWwgPSBudWxsOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICB0eXBlID0gUGhvbmUuVFlQRV9DVVNUT007Ci0gICAgICAgICAgICAgICAgbGFiZWwgPSB0eXBlT2JqZWN0LnRvU3RyaW5nKCk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gaXNQcmltYXJ5OwotICAgICAgICAgICAgaWYgKHR5cGVDb2xsZWN0aW9uICE9IG51bGwgJiYgdHlwZUNvbGxlY3Rpb24uY29udGFpbnMoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9QUkVGKSkgewotICAgICAgICAgICAgICAgIGlzUHJpbWFyeSA9IHRydWU7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGlzUHJpbWFyeSA9IGZhbHNlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYWRkUGhvbmUodHlwZSwgcHJvcFZhbHVlLCBsYWJlbCwgaXNQcmltYXJ5KTsKL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QVJBTV9UWVBFKTsKLSAgICAgICAgICAgIGlmICh0eXBlQ29sbGVjdGlvbiAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgZm9yIChTdHJpbmcgdHlwZVN0cmluZyA6IHR5cGVDb2xsZWN0aW9uKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlU3RyaW5nLmVxdWFscyhWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX1BSRUYpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpc1ByaW1hcnkgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPCAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZVN0cmluZy5lcXVhbHNJZ25vcmVDYXNlKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfSE9NRSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0gSW0uVFlQRV9IT01FOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlU3RyaW5nLmVxdWFsc0lnbm9yZUNhc2UoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9XT1JLKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSBJbS5UWVBFX1dPUks7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAodHlwZSA8IDApIHsKLSAgICAgICAgICAgICAgICB0eXBlID0gUGhvbmUuVFlQRV9IT01FOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYWRkSW0ocHJvdG9jb2wsIG51bGwsIHR5cGUsIHByb3BWYWx1ZSwgaXNQcmltYXJ5KTsKLSAgICAgICAgfSBlbHNlIGlmIChwcm9wTmFtZS5lcXVhbHMoVkNhcmRDb25zdGFudHMuUFJPUEVSVF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pdGhWYWx1ZShSYXdDb250YWN0cy5BQ0NPVU5UX1RZUEUsIG1BY2NvdW50LnR5cGUpOwotCi0gICAgICAgICAgICAvLyBBc3N1bWUgdGhhdCBjYWxsZXIgc2lkZSBjcmVhdGVzIHRoaXMgZ3JvdXAgaWYgaXQgZG9lcyBub3QgZXhpc3QuCi0gICAgICAgICAgICBpZiAoQUNDT1VOVF9UWVBFX0dPT0dMRS5lcXVhbHMobUFjY291bnQudHlwZSkpIHsKLSAgICAgICAgICAgICAgICBmaW5hbCBDdXJzb3IgY3Vyc29yID0gcmVzb2x2ZXIucXVlcnkoR3JvdXBzLkNPTlRFTlRfVVJJLCBuZXcgU3RyaW5nW10gewotICAgICAgICAgICAgICAgICAgICAgICAgR3JvdXBzLlNPVVJDRV9JRCB9LAotICAgICAgICAgICAgICAgICAgICAgICAgR3JvdXBzLlRJVExFICsgIj0/IiwgbmV3IFN0cmluZ1tdIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIEdPT0dMRV9NWV9DT05UQUNUU19HUk9VUCB9LCBudWxsKTsKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICBpZiAoY3Vyc29yICE9IG51bGwgJiYgY3Vyc29yLm1vdmVUb0ZpcnN0KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG15R3JvdXBzSWQgPSBjdXJzb3IuZ2V0U3RyaW5nKDApOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnNvciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3IuY2xvc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKFJhd0NvbnRhY3RzLkFDQ09VTl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ICAgICAgICAgICAgICAgICAgJiYgVGV4dFV0aWxzLmlzRW1wdHkobVBob25ldGljRmFtaWx5TmFtZSkKLSAgICAgICAgICAgICAgICAgICAgJiYgVGV4dFV0aWxzLmlzRW1wdHkobVBob25ldGljTWlkZGxlTmFtZSkpKSB7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoU3RydWN0dXJlZE5hbWUuUEhPTkVUSUNfR0lWRU5fTkFNRSwgbVBob25ldGljR2l2ZW5OYW1lKTsKLSAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShTdHJ1Y3R1cmVkTmFtZS5QSE9ORVRJQ19GQU1JTFlfTkFNRSwgbVBob25ldGljRmFtaWx5TmFtZSk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoU3RydWN0dXJlZE5hbWUuUEhPTkVUSUNfTUlERExFX05BTUUsIG1QaG9uZXRpY01pZGRsZU5hbWUpOwotICAgICAgICAgICAgfSBlbHNlIGlmICghVGV4dFV0aWxzLmlzRW1wdHkobVBob25ldGljRnVsbE5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoU3RydWN0dXJlZE5hbWUuUEhPTkVUSUNfR0lWRU5fTkFNRSwgbVBob25ldGljRnVsbE5hbWUpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShTdHJ1Y3R1cmVkTmFtZS5ESVNQTEFZX05BTUUsIGdldERpc3BsYXlOYW1lKCkpOwotICAgICAgICAgICAgb3BlcmF0aW9uTGlzdC5hZGQoYnVpbGRlci5idWlsZCgpKTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtTmlja05hbWVMaXN0ICE9IG51bGwgJiYgbU5pY2tOYW1lTGlzdC5zaXplKCkgPiAwKSB7Ci0gICAgICAgICAgICBmb3IgKFN0cmluZyBuaWNrTmFtZSA6IG1OaWNrTmFtZUxpc3QpIHsKLSAgICAgICAgICAgICAgICBidWlsZGVyID0gQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uLm5ld0luc2VydChEYXRhLkNPTlRFTlRfVVJJKTsKLSAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZUJhY2tSZWZlcmVuY2UoTmlja25hbWUuUkFXX0NPTlRBQ1RfSUQsIDApOwotICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKERhdGEuTUlNRVRZUEUsIE5pY2tuYW1lLkNPTlRFTlRfSVRFTV9UWVBFKTsKLSAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShOaWNrbmFtZS5UWVBFLCBOaWNrbmFtZS5UWVBFX0RFRkFVTFQpOwotICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKE5pY2tuYW1lLk5BTUUsIG5pY2tOYW1lKTsKLSAgICAgICAgICAgICAgICBvcGVyYXRpb25MaXN0LmFkZChidWlsZGVyLmJ1aWxkKCkpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKG1QaG9uZUxpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgZm9yIChQaG9uZURhdGEgcGhvbmVEYXRhIDogbVBob25lTGlzdCkgewotICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBDb250ZW50UHJvdmlkZXJPcGVyYXRpb24ubmV3SW5zZXJ0KERhdGEuQ09OVEVOVF9VUkkpOwotICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlQmFja1JlZmVyZW5jZShQaG9uZS5SQVdfQ09OVEFDVF9JRCwgMCk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoRGF0YS5NSU1FVFlQRSwgUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpOwotCi0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoUGhvbmUuVFlQRSwgcGhvbmVEYXRhLnR5cGUpOwotICAgICAgICAgICAgICAgIGlmIChwaG9uZURhdGEudHlwZSA9PSBQaG9uZS5UWVBFX0NVU1RPTSkgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShQaG9uZS5MQUJFTCwgcGhvbmVEYXRhLmxhYmVsKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoUGhvbmUuTlVNQkVSLCBwaG9uZURhdGEuZGF0YSk7Ci0gICAgICAgICAgICAgICAgaWYgKHBob25lRGF0YS5pc1ByaW1hcnkpIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoUGhvbmUuSVNfUFJJTUFSWSwgMSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG9wZXJhdGlvbkxpc3QuYWRkKGJ1aWxkZXIuYnVpbGQoKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobU9yZ2FuaXphdGlvbkxpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgZm9yIChPcmdhbml6YXRpb25EYXRhIG9yZ2FuaXphdGlvbkRhdGEgOiBtT3JnYW5pemF0aW9uTGlzdCkgewotICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBDb250ZW50UHJvdmlkZXJPcGVyYXRpb24ubmV3SW5zZXJ0KERhdGEuQ09OVEVOVF9VUkkpOwotICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlQmFja1JlZmVyZW5jZShPcmdhbml6YXRpb24uUkFXX0NPTlRBQ1RfSUQsIDApOwotICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKERhdGEuTUlNRVRZUEUsIE9yZ2FuaXphdGlvbi5DT05URU5UX0lURU1fVFlQRSk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoT3JnYW5pemF0aW9uLlRZUEUsIG9yZ2FuaXphdGlvbkRhdGEudHlwZSk7Ci0gICAgICAgICAgICAgICAgaWYgKG9yZ2FuaXphdGlvbkRhdGEuY29tcGFueU5hbWUgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShPcmdhbml6YXRpb24uQ09NUEFOWSwgb3JnYW5pemF0aW9uRGF0YS5jb21wYW55TmFtZSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChvcmdhbml6YXRpb25EYXRhLmRlcGFydG1lbnROYW1lICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoT3JnYW5pemF0aW9uLkRFUEFSVE1FTlQsIG9yZ2FuaXphdGlvbkRhdGEuZGVwYXJ0bWVudE5hbWUpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAob3JnYW5pemF0aW9uRGF0YS50aXRsZU5hbWUgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShPcmdhbml6YXRpb24uVElUTEUsIG9yZ2FuaXphdGlvbkRhdGEudGl0bGVOYW1lKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKG9yZ2FuaXphdGlvbkRhdGEuaXNQcmltYXJ5KSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKE9yZ2FuaXphdGlvbi5JU19QUklNQVJZLCAxKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgb3BlcmF0aW9uTGlzdC5hZGQoYnVpbGRlci5idWlsZCgpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtRW1haWxMaXN0ICE9IG51bGwpIHsKLSAgICAgICAgICAgIGZvciAoRW1haWxEYXRhIGVtYWlsRGF0YSA6IG1FbWFpbExpc3QpIHsKLSAgICAgICAgICAgICAgICBidWlsZGVyID0gQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uLm5ld0luc2VydChEYXRhLkNPTlRFTlRfVVJJKTsKLSAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZUJhY2tSZWZlcmVuY2UoRW1haWwuUkFXX0NPTlRBQ1RfSUQsIDApOwotICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKERhdGEuTUlNRVRZUEUsIEVtYWlsLkNPTlRFTlRfSVRFTV9UWVBFKTsKLQotICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKEVtYWlsLlRZUEUsIGVtYWlsRGF0YS50eXBlKTsKLSAgICAgICAgICAgICAgICBpZiAoZW1haWxEYXRhLnR5cGUgPT0gRW1haWwuVFlQRV9DVVNUT00pIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoRW1haWwuTEFCRUwsIGVtYWlsRGF0YS5sYWJlbCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKEVtYWlsLkRBVEEsIGVtYWlsRGF0YS5kYXRhKTsKLSAgICAgICAgICAgICAgICBpZiAoZW1haWxEYXRhLmlzUHJpbWFyeSkgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShEYXRhLklTX1BSSU1BUlksIDEpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBvcGVyYXRpb25MaXN0LmFkZChidWlsZGVyLmJ1aWxkKCkpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKG1Qb3N0YWxMaXN0ICE9IG51bGwpIHsKLSAgICAgICAgICAgIGZvciAoUG9zdGFsRGF0YSBwb3N0YWxEYXRhIDogbVBvc3RhbExpc3QpIHsKLSAgICAgICAgICAgICAgICBidWlsZGVyID0gQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uLm5ld0luc2VydChEYXRhLkNPTlRFTlRfVVJJKTsKLSAgICAgICAgICAgICAgICBWQ2FyZFV0aWxzLmluc2VydFN0cnVjdHVyZWRQb3N0YWxEYXRhVXNpbmdDb250YWN0c1N0cnVjdCgKLSAgICAgICAgICAgICAgICAgICAgICAgIG1WQ2FyZFR5cGUsIGJ1aWxkZXIsIHBvc3RhbERhdGEpOwotICAgICAgICAgICAgICAgIG9wZXJhdGlvbkxpc3QuYWRkKGJ1aWxkZXIuYnVpbGQoKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobUltTGlzdCAhPSBudWxsKSB7Ci0gICAgICAgICAgICBmb3IgKEltRGF0YSBpbURhdGEgOiBtSW1MaXN0KSB7Ci0gICAgICAgICAgICAgICAgYnVpbGRlciA9IENvbnRlbnRQcm92aWRlck9wZXJhdGlvbi5uZXdJbnNlcnQoRGF0YS5DT05URU5UX1VSSSk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWVCYWNrUmVmZXJlbmNlKEltLlJBV19DT05UQUNUX0lELCAwKTsKLSAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShEYXRhLk1JTUVUWVBFLCBJbS5DT05URU5UX0lURU1fVFlQRSk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoSW0uVFlQRSwgaW1EYXRhLnR5cGUpOwotICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKEltLlBST1RPQ09MLCBpbURhdGEucHJvdG9jb2wpOwotICAgICAgICAgICAgICAgIGlmIChpbURhdGEucHJvdG9jb2wgPT0gSW0uUFJPVE9DT0xfQ1VTVE9NKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKEltLkNVU1RPTV9QUk9UT0NPTCwgaW1EYXRhLmN1c3RvbVByb3RvY29sKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKGltRGF0YS5pc1ByaW1hcnkpIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoRGF0YS5JU19QUklNQVJZLCAxKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobU5vdGVMaXN0ICE9IG51bGwpIHsKLSAgICAgICAgICAgIGZvciAoU3RyaW5nIG5vdGUgOiBtTm90ZUxpc3QpIHsKLSAgICAgICAgICAgICAgICBidWlsZGVyID0gQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uLm5ld0luc2VydChEYXRhLkNPTlRFTlRfVVJJKTsKLSAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZUJhY2tSZWZlcmVuY2UoTm90ZS5SQVdfQ09OVEFDVF9JRCwgMCk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoRGF0YS5NSU1FVFlQRSwgTm90ZS5DT05URU5UX0lURU1fVFlQRSk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoTm90ZS5OT1RFLCBub3RlKTsKLSAgICAgICAgICAgICAgICBvcGVyYXRpb25MaXN0LmFkZChidWlsZGVyLmJ1aWxkKCkpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKG1QaG90b0xpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgZm9yIChQaG90b0RhdGEgcGhvdG9EYXRhIDogbVBob3RvTGlzdCkgewotICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBDb250ZW50UHJvdmlkZXJPcGVyYXRpb24ubmV3SW5zZXJ0KERhdGEuQ09OVEVOVF9VUkkpOwotICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlQmFja1JlZmVyZW5jZShQaG90by5SQVdfQ09OVEFDVF9JRCwgMCk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoRGF0YS5NSU1FVFlQRSwgUGhvdG8uQ09OVEVOVF9JV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WF9EQVRBX0NPTFVNTlMKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoY3VzdG9tUHJvcGVydHlWYWx1ZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZSgiZGF0YSIgKyBpLCBjdXN0b21Qcm9wZXJ0eVZhbHVlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIGkrKzsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgb3BlcmF0aW9uTGlzdC5hZGQoYnVpbGRlci5idWlsZCgpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChteUdyb3Vwc0lkICE9IG51bGwpIHsKLSAgICAgICAgICAgIGJ1aWxkZXIgPSBDb250ZW50UHJvdmlkZXJPcGVyYXRpb24ubmV3SW5zZXJ0KERhdGEuQ09OVEVOVF9VUkkpOwotICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWVCYWNrUmVmZXJlbmNlKEdyb3VwTWVtYmVyc2hpcC5SQVdfQ09OVEFDVF9JRCwgMCk7Ci0gICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShEYXRhLk1JTUVUWVBFLCBHcm91cE1lbWJlcnNoaXAuQ09OVEVOVF9JVEVNX1RZUEUpOwotICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoR3JvdXBNZW1iZXJzaGlwLkdST1VQX1NPVVJDRV9JRCwgbXlHcm91cHNJZCk7Ci0gICAgICAgICAgICBvcGVyYXRpb25MaXN0LmFkZChidWlsZGVyLmJ1aWxkKCkpOwotICAgICAgICB9Ci0KLSAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIENvbnRlbnRQcm92aWRlclJlc3VsdFtdIHJlc3VsdHMgPSByZXNvbHZlci5hcHBseUJhdGNoKAotICAgICAgICAgICAgICAgICAgICAgICAgQ29udGFjdHNDb250cmFjdC5BVVRIT1JJVFksIG9wZXJhdGlvbkxpc3QpOwotICAgICAgICAgICAgLy8gdGhlIGZpcnN0IHJlc3VsdCBpcyBhbHdheXMgdGhlIHJhd19jb250YWN0LiByZXR1cm4gaXQncyB1cmkgc28KLSAgICAgICAgICAgIC8vIHRoYXQgaXQgY2FuIGJlIGZvdW5kIGxhdGVyLiBkbyBudWxsIGNoZWNraW5nIGZvciBiYWRseSBiZWhhdmluZwotICAgICAgICAgICAgLy8gQ29udGVudFJlc29sdmVycwotICAgICAgICAgICAgcmV0dXJuIChyZXN1bHRzID09IG51bGwgfHwgcmVzdWx0cy5sZW5ndGggPT0gMCB8fCByZXN1bHRzWzBdID09IG51bGwpCi0gICAgICAgICAgICAgICAgPyBudWxsCi0gICAgICAgICAgICAgICAgOiByZXN1bHRzWzBdLnVyaTsKLSAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgIExvZy5lKExPR19UQUcsIFN0cmluZy5mb3JtYXQoIiVzOiAlcyIsIGUudG9TdHJpbmcoKSwgZS5nZXRNZXNzYWdlKCkpKTsKLSAgICAgICAgICAgIHJldHVybiBudWxsOwotICAgICAgICB9IGNhdGNoIChPcGVyYXRpb25BcHBsaWNhdGlvbkV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICBMb2cuZShMT0dfVEFHLCBTdHJpbmcuZm9ybWF0KCIlczogJXMiLCBlLnRvU3RyaW5nKCksIGUuZ2V0TWVzc2FnZSgpKSk7Ci0gICAgICAgICAgICByZXR1cm4gbnVsbDsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHB1YmxpYyBzdGF0aWMgVkNhcmRFbnRyeSBidWlsZEZyb21SZXNvbHZlcihDb250ZW50UmVzb2x2ZXIgcmVzb2x2ZXIpIHsKLSAgICAgICAgcmV0dXJuIGJ1aWxkRnJvbVJlc29sdmVyKHJlc29sdmVyLCBDb250YWN0cy5DT05URU5UX1VSSSk7Ci0gICAgfQotCi0gICAgcHVibGljIHN0YXRpYyBWQ2FyZEVudHJ5IGJ1aWxkRnJvbVJlc29sdmVyKENvbnRlbnRSZXNvbHZlciByZXNvbHZlciwgVXJpIHVyaSkgewotCi0gICAgICAgIHJldHVybiBudWxsOwotICAgIH0KLQotICAgIHByaXZhdGUgYm9vbGVhbiBuYW1lRmllbGRzQXJlRW1wdHkoKSB7Ci0gICAgICAgIHJldHVybiAoVGV4dFV0aWxzLmlzRW1wdHkobUZhbWlseU5hbWUpCi0gICAgICAgICAgICAgICAgJiYgVGV4dFV0aWxzLmlzRW1wdHkobU1pZGRsZU5hbWUpCi0gICAgICAgICAgICAgICAgJiYgVGV4dFV0aWxzLmlzRW1wdHkobUdpdmVuTmFtZSkKLSAgICAgICAgICAgICAgICAmJiBUZXh0VXRpbHMuaXNFbXB0eShtUHJlZml4KQotICAgICAgICAgICAgICAgICYmIFRleHRVdGlscy5pc0VtcHR5KG1TdWZmaXgpCi0gICAgICAgICAgICAgICAgJiYgVGV4dFV0aWxzLmlzRW1wdHkobUZ1bGxOYW1lKQotICAgICAgICAgICAgICAgICYmIFRleHRVdGlscy5pc0VtcHR5KG1QaG9uZXRpY0ZhbWlseU5hbWUpCi0gICAgICAgICAgICAgICAgJiYgVGV4dFV0aWxzLmlzRW1wdHkobVBob25ldGljTWlkZGxlTmFtZSkKLSAgICAgICAgICAgICAgICAmJiBUZXh0VXRpbHMuaXNFbXB0eShtUGhvbmV0aWNHaXZlbk5hbWUpCi0gICAgICAgICAgICAgICAgJiYgVGV4dFV0aWxzLmlzRW1wdHkobVBob25ldGljRnVsbE5hbWUpKTsKLSAgICB9Ci0KLSAgICBwdWJsaWMgYm9vbGVhbiBpc0lnbm9yYWJsZSgpIHsKLSAgICAgICAgcmV0dXJuIGdldERpc3BsYXlOYW1lKCkubGVuZ3RoKCkgPT0gMDsKLSAgICB9Ci0KLSAgICBwcml2YXRlIFN0cmluZyBsaXN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V0UHJvcGVydHlCeXRlcyhCYXNlNjQuZGVjb2RlQmFzZTY0KHZhbHVlLmdldEJ5dGVzKCkpKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWU7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGVuY29kaW5nLmVxdWFscygiUVVPVEVELVBSSU5UQUJMRSIpKSB7Ci0gICAgICAgICAgICAgICAgLy8gIj0gIiAtPiAiICIsICI9XHQiIC0+ICJcdCIuCi0gICAgICAgICAgICAgICAgLy8gUHJldmlvdXMgY29kZSBoYWQgZG9uZSB0aGlzIHJlcGxhY2VtZW50LiBLZWVwIG9uIHRoZSBzYWZlIHNpZGUuCi0gICAgICAgICAgICAgICAgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgICAgICAgICBpbnQgbGVuZ3RoID0gdmFsdWUubGVuZ3RoKCk7Ci0gICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykgewotICAgICAgICAgICAgICAgICAgICBjaGFyIGNoID0gdmFsdWUuY2hhckF0KGkpOwotICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT0gJz0nICYmIGkgPCBsZW5ndGggLSAxKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjaGFyIG5leHRDaCA9IHZhbHVlLmNoYXJBdChpICsgMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV4dENoID09ICcgJyB8fCBuZXh0Q2ggPT0gJ1x0JykgewotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobmV4dENoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpKys7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoY2gpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBTdHJpbmcgcXVvdGVkUHJpbnRhYmxlID0gYnVpbGRlci50b1N0cmluZygpOwotICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIFN0cmluZ1tdIGxpbmVzOwotICAgICAgICAgICAgICAgIGlmIChtU3RyaWN0TGluZUJyZWFrUGFyc2luZykgewotICAgICAgICAgICAgICAgICAgICBsaW5lcyA9IHF1b3RlZFByaW50YWJsZS5zcGxpdCgiXHJcbiIpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSBxdW90ZWRQcmludGFibGUubGVuZ3RoKCk7Ci0gICAgICAgICAgICAgICAgICAgIEFycmF5TGlzdDxTdHJpbmc+IGxpc3QgPSBuZXcgQXJyYXlMaXN0PFN0cmluZz4oKTsKLSAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykgewotICAgICAgICAgICAgICAgICAgICAgICAgY2hhciBjaCA9IHF1b3RlZFByaW50YWJsZS5jaGFyQXQoaSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT0gJ1xuJykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QuYWRkKGJ1aWxkZXIudG9TdHJpbmcoKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09ICdccicpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0LmFkZChidWlsZGVyLnRvU3RyaW5nKCkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpIDwgbGVuZ3RoIC0gMSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyIG5leHRDaCA9IHF1b3RlZFByaW50YWJsZS5jaGFyQXQoaSArIDEpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV4dENoID09ICdcbicpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkrKzsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoY2gpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyBmaW5hbExpbmUgPSBidWlsZGVyLnRvU3RyaW5nKCk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChmaW5hbExpbmUubGVuZ3RoKCkgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBsaXN0LmFkZChmaW5hbExpbmUpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGxpbmVzID0gbGlzdC50b0FycmF5KG5ldyBTdHJpbmdbMF0pOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgICAgICAgICBmb3IgKFN0cmluZyBsaW5lIDogbGluZXMpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGxpbmUuZW5kc1dpdGgoIj0iKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgbGluZSA9IGxpbmUuc3Vic3RyaW5nKDAsIGxpbmUubGVuZ3RoKCkgLSAxKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChsaW5lKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnl0ZVtdIGJ5dGVzOwotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ5dGVzID0gYnVpbGRlci50b1N0cmluZygpLmdldEJ5dGVzKG1JbnB1dENoYXJzZXQpOwotICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFVuc3VwcG9ydGVkRW5jb2RpbmdFeGNlcHRpb24gZTEpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIkZhaWxlZCB0byBlbmNvZGU6IGNoYXJzZXQ9IiArIG1JbnB1dENoYXJzZXQpOwotICAgICAgICAgICAgICAgICAgICBieXRlcyA9IGJ1aWxkZXIudG9TdHJpbmcoKS5nZXRCeXRlcygpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICBieXRlcyA9IFF1b3RlZFByaW50YWJsZUNvZGVjLmRlY29kZVF1b3RlZFByaW50YWJsZShieXRlcyk7Ci0gICAgICAgICAgICAgICAgfSBjYXRjaCAoRGVjb2RlckV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJGYWlsZWQgdG8gZGVjb2RlIHF1b3RlZC1wcmludGFibGU6ICIgKyBlKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuICIiOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgU3RyaW5nKGJ5dGVzLCBjaGFyc2V0Rm9yRGVjb2RlZEJ5dGVzKTsKLSAgICAgICAgICAgICAgICB9IGNhdGNo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kgOiBWQ2FyZENvbmZpZy5QQVJTRV9UWVBFX1VOS05PV04pOwotICAgIH0KLQotICAgIHB1YmxpYyBWQ2FyZFBhcnNlcl9WMjEoaW50IHBhcnNlVHlwZSkgewotICAgICAgICBzdXBlcihwYXJzZVR5cGUpOwotICAgICAgICBpZiAocGFyc2VUeXBlID09IFZDYXJkQ29uZmlnLlBBUlNFX1RZUEVfRk9NQSkgewotICAgICAgICAgICAgbU5lc3RDb3VudCA9IDE7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBQYXJzZXMgdGhlIGZpbGUgYXQgdGhlIGdpdmVuIHBvc2l0aW9uLgotICAgICAqCi0gICAgICogdmNhcmRfZmlsZSA9IFt3c2xzXSB2Y2FyZCBbd3Nsc10KLSAgICAgKi8KLSAgICBwcm90ZWN0ZWQgdm9pZCBwYXJzZVZDYXJkRmlsZSgpIHRocm93cyBJT0V4Y2VwdGlvbiwgVkNhcmRFeGNlcHRpb24gewotICAgICAgICBib29sZWFuIGZpcnN0UmVhZGluZyA9IHRydWU7Ci0gICAgICAgIHdoaWxlICh0cnVlKSB7Ci0gICAgICAgICAgICBpZiAobUNhbmNlbGVkKSB7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoIXBhcnNlT25lVkNhcmQoZmlyc3RSZWFkaW5nKSkgewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZmlyc3RSZWFkaW5nID0gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobU5lc3RDb3VudCA+IDApIHsKLSAgICAgICAgICAgIGJvb2xlYW4gdXNlQ2FjaGUgPSB0cnVlOwotICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtTmVzdENvdW50OyBpKyspIHsKLSAgICAgICAgICAgICAgICByZWFkRW5kVkNhcmQodXNlQ2FjaGUsIHRydWUpOwotICAg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4gMCkgeyAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICByZXR1cm4gbGluZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qKgotICAgICAqIHZjYXJkID0gIkJFR0lOIiBbd3NdICI6IiBbd3NdICJWQ0FSRCIgW3dzXSAxKkNSTEYKLSAgICAgKiAgICAgICAgIGl0ZW1zICpDUkxGCi0gICAgICogICAgICAgICAiRU5EIiBbd3NdICI6IiBbd3NdICJWQ0FSRCIKLSAgICAgKi8KLSAgICBwcml2YXRlIGJvb2xlYW4gcGFyc2VPbmVWQ2FyZChib29sZWFuIGZpcnN0UmVhZGluZykgdGhyb3dzIElPRXhjZXB0aW9uLCBWQ2FyZEV4Y2VwdGlvbiB7Ci0gICAgICAgIGJvb2xlYW4gYWxsb3dHYXJiYWdlID0gZmFsc2U7Ci0gICAgICAgIGlmIChmaXJzdFJlYWRpbmcpIHsKLSAgICAgICAgICAgIGlmIChtTmVzdENvdW50ID4gMCkgewotICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbU5lc3RDb3VudDsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICghcmVhZEJlZ2luVkNhcmQoYWxsb3dHYXJiYWdlKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGFsbG93R2FyYmFnZSA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKCFyZWFkQmVnaW5WQ2FyZChhbGxvd0dhcmJhZ2UpKSB7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLSAgICAgICAgbG9uZyBzdGFydDsKLSAgICAgICAgaWYgKG1CdWlsZGVyICE9IG51bGwpIHsKLSAgICAgICAgICAgIHN0YXJ0ID0gU3l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ICAgICBkbyB7Ci0gICAgICAgICAgICB3aGlsZSAodHJ1ZSkgewotICAgICAgICAgICAgICAgIGxpbmUgPSBnZXRMaW5lKCk7Ci0gICAgICAgICAgICAgICAgaWYgKGxpbmUgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChsaW5lLnRyaW0oKS5sZW5ndGgoKSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgU3RyaW5nW10gc3RyQXJyYXkgPSBsaW5lLnNwbGl0KCI6IiwgMik7Ci0gICAgICAgICAgICBpbnQgbGVuZ3RoID0gc3RyQXJyYXkubGVuZ3RoOwotCi0gICAgICAgICAgICAvLyBUaG91Z2ggdkNhcmQgMi4xLzMuMCBzcGVjaWZpY2F0aW9uIGRvZXMgbm90IGFsbG93IGxvd2VyIGNhc2VzLAotICAgICAgICAgICAgLy8gdkNhcmQgZmlsZSBlbWl0dGVkIGJ5IHNvbWUgZXh0ZXJuYWwgdkNhcmQgZXhwb3RlciBoYXZlIHN1Y2ggaW52YWxpZCBTdHJpbmdzLgotICAgICAgICAgICAgLy8gU28gd2UgYWxsb3cgaXQuCi0gICAgICAgICAgICAvLyBlLmcuIEJFR0lOOnZDYXJkCi0gICAgICAgICAgICBpZiAobGVuZ3RoID09IDIgJiYKLSAgICAgICAgICAgICAgICAgICAgc3RyQXJyYXlbMF0udHJpbSgpLmVxdWFsc0lnbm9yZUNhc2UoIkJFR0lOIikgJiYKLSAgICAgICAgICAgICAgICAgICAgc3RyQXJyYXlbMV0udHJpbSgpLmVxdWFsc0lnbm9yZUNhc2UoIlZDQVJEIikpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoIWFsbG93R2FyYmFnZSkgewotICAgICAgICAgICAgICAgIGlmIChtTmVzdENvdW50ID4gMCkgewotICAgICAgICAgICAgICAgICAgICBtUHJldmlvdXNMaW5lID0gbGluZTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBWQ2FyZEV4Y2VwdGlvbigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRXhwZWN0ZWQgU3RyaW5nIFwiQkVHSU46VkNBUkRcIiBkaWQgbm90IGNvbWUgIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIihJbnN0ZWFkLCBcIiIgKyBsaW5lICsgIlwiIGNhbWUpIik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9IHdoaWxlKGFsbG93R2FyYmFnZSk7Ci0KLSAgICAgICAgdGhyb3cgbmV3IFZDYXJkRXhjZXB0aW9uKCJSZWFjaGVkIHdoZXJlIG11c3Qgbm90IGJlIHJlYWNoZWQuIik7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogVGhlIGFyZ3VtZW50cyB1c2VDYWNoZSBhbmQgYWxsb3dHYXJiYXNlIGFyZSB1c3VhbGx5IHRydWUgYW5kIGZhbHNlIGFjY29yZGluZ2x5IHdoZW4KLSAgICAgKiB0aGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCBvdXRzaWRlIHRoaXMgZnVuY3Rpb24gaXRzZWxmLiAKLSAgICAgKgotICAgICAqIEBwYXJhbSB1c2VDYWNoZSBXaGVuIHRydWUsIGxpbmUgaXMgb2J0YWluZWQgZnJvbSBtUHJldmlvdXNsaW5lLiBPdGhlcndpc2UsIGdldExpbmUoKQotICAgICAqIGlzIHVzZWQuCi0gICAgICogQHBhcmFtIGFsbG93R2FyYmFnZSBXaGVuIHRydWUsIGlnbm9yZSBub24gIkVORDpWQ0FSRCIgbGluZS4KLSAgICAgKiBAdGhyb3dzIElPRXhjZXB0aW9uCi0gICAgICogQHRocm93cyBWQ2FyZEV4Y2VwdGlvbgotICAgICAqLwotICAgIHByb3RlY3RlZCB2b2lkIHJlYWRFbmRWQ2FyZChib29sZWFuIHVzZUNhY2hlLCBib29sZWFuIGFsbG93R2FyYmFnZSkKLSAgICAgICAgICAgIHRocm93cyBJT0V4Y2VwdGlvbiwgVkNhcmRFeGNlcHRpb24gewotICAgICAgICBTdHJpbmcgbGluZTsKLSAgICAgICAgZG8gewotICAgICAgICAgICAgaWYgKHVzZUNhY2hlKSB7Ci0gICAgICAgICAgICAgICAgLy8gVGhvdWdoIHZDYXJkIHNwZWNpZmljYXRpb24gZG9lcyBub3QgYWxsb3cgbG93ZXIgY2FzZXMsCi0gICAgICAgICAgICAgICAgLy8gc29tZSBkYXRhIG1heSBoYXZlIHRoZW0sIHNvIHdlIGFsbG93IGl0LgotICAgICAgICAgICAgICAgIGxpbmUgPSBtUHJldmlvdXNMaW5lOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICB3aGlsZSAodHJ1ZSkgewotICAgICAgICAgICAgICAgICAgICBsaW5lID0gZ2V0TGluZSgpOwotICAgICAgICAgICAgICAgICAgICBpZiAobGluZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVkNhcmRFeGNlcHRpb24oIkV4cGVjdGVkIEVORDpWQ0FSRCB3YXMgbm90IGZvdW5kLiIpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGxpbmUudHJpbSgpLmxlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIFN0cmluZ1tdIHN0ckFycmF5ID0gbGluZS5zcGxpdCgiOiIsIDIpOwotICAgICAgICAgICAgaWYgKHN0ckFycmF5Lmxlbmd0aCA9PSAyIC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AgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0gZWxzZSBpZiAoaXNWYWxpZFByb3BlcnR5TmFtZShwcm9wZXJ0eU5hbWUpKSB7Ci0gICAgICAgICAgICBpZiAocHJvcGVydHlOYW1lLmVxdWFscygiQkVHSU4iKSkgewotICAgICAgICAgICAgICAgIGlmIChwcm9wZXJ0eVZhbHVlLmVxdWFscygiVkNBUkQiKSkgewotICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVkNhcmROZXN0ZWRFeGNlcHRpb24oIlRoaXMgdkNhcmQgaGFzIG5lc3RlZCB2Q2FyZCBkYXRhIGluIGl0LiIpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBWQ2FyZEV4Y2VwdGlvbigiVW5rbm93biBCRUdJTiB0eXBlOiAiICsgcHJvcGVydHlWYWx1ZSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIGlmIChwcm9wZXJ0eU5hbWUuZXF1YWxzKCJWRVJTSU9OIikgJiYKLSAgICAgICAgICAgICAgICAgICAgIXByb3BlcnR5VmFsdWUuZXF1YWxzKGdldFZlcnNpb25TdHJpbmcoKSkpIHsKLSAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVkNhcmRWZXJzaW9uRXhjZXB0aW9uKCJJbmNvbXBhdGlibGUgdmVyc2lvbjogIiArIAotICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydHlWYWx1ZSArICIgIT0gIiArIGdldFZlcnNpb25TdHJpbmcoKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBzdGFydCA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOwotICAgICAgICAgICAgaGFuZGxlUHJvcGVydHlWYWx1ZShwcm9wZXJ0eU5hbWUsIHByb3BlcnR5VmFsdWUpOwotICAgICAgICAgICAgbVRpbWVQYXJzZVByb3BlcnR5VmFsdWVzICs9I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Q2FyZEludmFsaWRDb21tZW50TGluZUV4Y2VwdGlvbigpOwotICAgICAgICB9Ci0KLSAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykgewotICAgICAgICAgICAgY2hhciBjaCA9IGxpbmUuY2hhckF0KGkpOyAKLSAgICAgICAgICAgIHN3aXRjaCAoc3RhdGUpIHsKLSAgICAgICAgICAgICAgICBjYXNlIFNUQVRFX0dST1VQX09SX1BST1BOQU1FOiB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PSAnOicpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBwcm9wZXJ0eU5hbWUgPSBsaW5lLnN1YnN0cmluZyhuYW1lSW5kZXgsIGkpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHByb3BlcnR5TmFtZS5lcXVhbHNJZ25vcmVDYXNlKCJFTkQiKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1QcmV2aW91c0xpbmUgPSBsaW5lOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1CdWlsZGVyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQnVpbGRlci5wcm9wZXJ0eU5hbWUocHJvcGVydHlOYW1lKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5TmFtZUFuZFZhbHVlWzBdID0gcHJvcGVydHlOYW1lOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPCBsZW5ndGggLSAxKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydHlOYW1lQW5kVmFsdWVbMV0gPSBsaW5lLnN1YnN0cmluZyhpICsgMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5TmFtZUFuZFZhbHVlWzFdID0gIiI7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHJvcGVydHlOYW1lQW5kVmFsdWU7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT0gJy4nKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgZ3JvdXBOYW1lID0gbGluZS5zdWJzdHJpbmcobmFtZUluZGV4LCBpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtQnVpbGRlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUJ1aWxkZXIucHJvcGVydHlHcm91cChncm91cE5hbWUpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgbmFtZUluZGV4ID0gaSArIDE7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT0gJzsnKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgcHJvcGVydHlOYW1lID0gbGluZS5zdWJzdHJpbmcobmFtZUluZGV4LCBpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwcm9wZXJ0eU5hbWUuZXF1YWxzSWdub3JlQ2FzZSgiRU5EIikpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUHJldmlvdXNMaW5lID0gbGluZTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtQnVpbGRlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUJ1aWxkZXIucHJvcGVydHlOYW1lKHByb3BlcnR5TmFtZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0eU5hbWVBbmRWYWx1ZVswXSA9IHByb3BlcnR5TmFtZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVJbmRleCA9IGkgKyAxOwotICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGUgPSBTVEFURV9QQVJBTVM7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGNhc2UgU1RBVEVfUEFSQU1TOiB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PSAnIicpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlID0gU1RBVEVfUEFSQU1TX0lOX0RRVU9URTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PSAnOycpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZVBhcmFtcyhsaW5lLnN1YnN0cmluZyhuYW1lSW5kZXgsIGkpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVJbmRleCA9IGkgKyAxOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09ICc6JykgewotICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlUGFyYW1zKGxpbmUuc3Vic3RyaW5nKG5hbWVJbmRleCwgaSkpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPCBsZW5ndGggLSAxKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydHlOYW1lQW5kVmFsdWVbMV0gPSBsaW5lLnN1YnN0cmluZyhpICsgMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5TmFtZUFuZFZhbHVlWzFdID0gIiI7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHJvcGVydHlOYW1lQW5kVmFsdWU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGNhc2UgU1RBVEVfUEFSQU1TX0lOX0RRVU9URTogewotICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT0gJyInKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IFNUQVRFX1BBUkFNUzsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIHRocm93IG5ldyBWQ2FyZEludmFsaWRMaW5lRXhjZXB0aW9uKCJJbnZhbGlkIGxpbmU6IFwiIiArIGxpbmUgKyAiXCIiKTsKLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBwYXJhbXMgICAgID0gIjsiIFt3c10gcGFyYW1saXN0Ci0gICAgICogcGFyYW1saXN0ICA9IHBhcmFtbGlzdCBbd3NdICI7IiBbd3NdIHBhcmFtCi0gICAgICogICAgICAgICAgICAvIHBhcmFtCi0gICAgICogcGFyYW0gICAgICA9ICJUWVBFIiBbd3NdICI9IiBbd3NdIHB0eXBldmFsCi0gICAgICogICAgICAgICAgICAvICJWQUxVRSIgW3dzXSAiPSIgW3dzXSBwdmFsdWV2YWwKLSAgICAgKiAgICAgICAgICAgIC8gIkVOQ09ESU5HIiBbd3NdICI9IiBbd3NdIHBlbmNvZGluZ3ZhbAotICAgICAqICAgICAgICAgICAgLyAiQ0hBUlNFVCIgW3dzXSAiPSIgW3dzXSBjaGFyc2V0dmFsCi0gICAgICogICAgICAgICAgICAvICJMQU5HVUFHRSIgW3dzXSAiPSIgW3dzXSBsYW5ndmFsCi0gICAgICogICAgICAgICAgICAvICJYLSIg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zdWNoIGNhc2VzLCB1c2UgdHJ5LWNhdGNoLgotICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgcmVzdWx0ID0gZ2V0QmFzZTY0KHByb3BlcnR5VmFsdWUpOwotICAgICAgICAgICAgICAgIGlmIChtQnVpbGRlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFycmF5TGlzdDxTdHJpbmc+IHYgPSBuZXcgQXJyYXlMaXN0PFN0cmluZz4oKTsKLSAgICAgICAgICAgICAgICAgICAgdi5hZGQocmVzdWx0KTsKLSAgICAgICAgICAgICAgICAgICAgbUJ1aWxkZXIucHJvcGVydHlWYWx1ZXModik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBjYXRjaCAoT3V0T2ZNZW1vcnlFcnJvciBlcnJvcikgewotICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJPdXRPZk1lbW9yeUVycm9yIGhhcHBlbmVkIGR1cmluZyBwYXJzaW5nIEJBU0U2NCBkYXRhISIpOwotICAgICAgICAgICAgICAgIGlmIChtQnVpbGRlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLnByb3BlcnR5VmFsdWVzKG51bGwpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1UaW1lSGFuZGxlQmFzZTY0ICs9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpIC0gc3RhcnQ7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAoIShtRW5jb2RpbmcgPT0gbnVsbCB8fCBtRW5jb2RpbmcuZXF1YWxzSWdub3JlQ2FzZSgiN0JJVCIpCi0gICAgICAgICAgICAgICAgICAgIHx8IG1FbmNvZGluZy5lcXVhbHNJZ25vcmVDYXNlKCI4QklUIikKLSAgICAgICAgICAgICAgICAgICAgfHwgbUVuY29kaW5nLnRvVXBwZXJDYX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ZGRpbmcKLSAgICAgICAgLy8gcXAtc2VnbWVudCA6PSBxcC1zZWN0aW9uICooU1BBQ0UgLyBUQUIpICI9IgotICAgICAgICAvLyAgICAgICAgICAgICA7IE1heGltdW0gbGVuZ3RoIG9mIDc2IGNoYXJhY3RlcnMKLSAgICAgICAgLy8KLSAgICAgICAgLy8gZS5nLiAoZnJvbSBSRkMgMjA0NSkKLSAgICAgICAgLy8gTm93J3MgdGhlIHRpbWUgPQotICAgICAgICAvLyBmb3IgYWxsIGZvbGsgdG8gY29tZT0KLSAgICAgICAgLy8gIHRvIHRoZSBhaWQgb2YgdGhlaXIgY291bnRyeS4KLSAgICAgICAgaWYgKGZpcnN0U3RyaW5nLnRyaW0oKS5lbmRzV2l0aCgiPSIpKSB7Ci0gICAgICAgICAgICAvLyByZW1vdmUgInRyYW5zcG9ydC1wYWRkaW5nIgotICAgICAgICAgICAgaW50IHBvcyA9IGZpcnN0U3RyaW5nLmxlbmd0aCgpIC0gMTsKLSAgICAgICAgICAgIHdoaWxlKGZpcnN0U3RyaW5nLmNoYXJBdChwb3MpICE9ICc9JykgewotICAgICAgICAgICAgfQotICAgICAgICAgICAgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGZpcnN0U3RyaW5nLnN1YnN0cmluZygwLCBwb3MgKyAxKSk7Ci0gICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiXHJcbiIpOwotICAgICAgICAgICAgU3RyaW5nIGxpbmU7Ci0gICAgICAgICAgICB3aGlsZSAodHJ1ZSkgewotICAgICAgICAgICAgICAgIGxpbmUgPSBnZXRMaW5lKCk7Ci0gICAgICAgICAgICAgICAgaWYgKGxpbmUgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVkNhcmRFeGNlcHRpb24oCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIkZpbGUgZW5kZWQgZHVyaW5nIHBhcnNpbmcgcXVvdGVkLXByaW50YWJsZSBTdHJpbmciKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKGxpbmUudHJpbSgpLmVuZHNXaXRoKCI9IikpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gcmVtb3ZlICJ0cmFuc3BvcnQtcGFkZGluZyIKLSAgICAgICAgICAgICAgICAgICAgcG9zID0gbGluZS5sZW5ndGgoKSAtIDE7Ci0gICAgICAgICAgICAgICAgICAgIHdoaWxlKGxpbmUuY2hhckF0KHBvcykgIT0gJz0nKSB7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobGluZS5zdWJzdHJpbmcoMCwgcG9zICsgMSkpOwotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiXHJcbiIpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGxpbmUpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOyAKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHJldHVybiBmaXJzdFN0cmluZzsKLSAgICAgICAgfQotICAgIH0KLSAgICAKLSAgICBwcm90ZWN0ZWQgU3RyaW5nIGdldEJhc2U2NChTdHJpbmcgZmlyc3RTdHJpbmcpIHRocm93cyBJT0V4Y2VwdGlvbiwgVkNhcmRFeGNlcHRpb24gewotICAgICAgICBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICBidWlsZGVyLmFwcGVuZChmaXJzdFN0cmluZyk7Ci0gICAgICAgIAotICAgICAgICB3aGlsZSAodHJ1ZSkgewotICAgICAgICAgICAgU3RyaW5nIGxpbmUgPSBnZXRMaW5lKCk7Ci0gICAgICAgICAgICBpZiAobGluZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgdGhyb3cgbmV3IFZDYXJkRXhjZXB0aW9uKAotICAgICAgICAgICAgICAgICAgICAgICAgIkZpbGUgZW5kZWQgZHVyaW5nIHBhcnNpbmcgQkFTRTY0IGJpbmFyeSIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKGxpbmUubGVuZ3RoKCkgPT0gMCkgewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobGluZSk7Ci0gICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIHJldHVybiBidWlsZGVyLnRvU3RyaW5nKCk7Ci0gICAgfQotICAgIAotICAgIC8qKgotICAgICAqIE1haW5seSBmb3IgIkFEUiIsICJPUkciLCBhbmQgIk4iCi0gICAgICogV2UgZG8gbm90IGNhcmUgdGhlIG51bWJlciBvZiBzdHJub3NlbWkgaGVyZS4KLSAgICAgKiAKLSAgICAgKiBhZGRyZXNzcGFydHMgPSAwKjYoc3Rybm9zZW1pICI7Iikgc3Rybm9zZW1pCi0gICAgICogICAgICAgICAgICAgIDsgUE8gQm94LCBFeHRlbmRlZCBBZGRyLCBTdHJlZXQsIExvY2FsaXR5LCBSZWdpb24sCi0gICAgICogICAgICAgICAgICAgICAgUG9zdGFsIENvZGUsIENvdW50cnkgTmFtZQotICAgICAqIG9yZ3BhcnRzICAgICA9ICooc3Rybm9zZW1pICI7Iikgc3Rybm9zZW1pCi0gICAgICogICAgICAgICAgICAgIDsgRmlyc3QgaXMgT3JnYW5pemF0aW9uIE5hbWUsCi0gICAgICogICAgICAgICAgICAgICAgcmVtYWluZGVyIGFyZSBPcmdhbml6YXRpb24gVW5pdHMuCi0gICAgICogbmFtZXBhcnRzICAgID0gMCo0KHN0cm5vc2VtaSAiOyIpIHN0cm5vc2Vt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TdHJpbmcgbGluZTsKLSAgICAgICAgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbnVsbDsKLSAgICAgICAgd2hpbGUgKHRydWUpIHsKLSAgICAgICAgICAgIGxpbmUgPSBtUmVhZGVyLnJlYWRMaW5lKCk7Ci0gICAgICAgICAgICBpZiAobGluZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGJ1aWxkZXIgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobVByZXZpb3VzTGluZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyByZXQgPSBtUHJldmlvdXNMaW5lOwotICAgICAgICAgICAgICAgICAgICBtUHJldmlvdXNMaW5lID0gbnVsbDsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJldDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgdGhyb3cgbmV3IFZDYXJkRXhjZXB0aW9uKCJSZWFjaGVkIGVuZCBvZiBidWZmZXIuIik7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGxpbmUubGVuZ3RoKCkgPT0gMCkgewotICAgICAgICAgICAgICAgIGlmIChidWlsZGVyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJ1aWxkZXIudG9TdHJpbmcoKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1QcmV2aW91c0xpbmUgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgcmV0ID0gbVByZXZpb3VzTGluZTsKLSAgICAgICAgICAgICAgICAgICAgbVByZXZpb3VzTGluZSA9IG51bGw7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXQ7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIGlmIChsaW5lLmNoYXJBdCgwKSA9PSAnICcgfHwgbGluZS5jaGFyQXQoMCkgPT0gJ1x0JykgewotICAgICAgICAgICAgICAgIGlmIChidWlsZGVyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gU2VlIFNlY3Rpb24gNS44LjEgb2YgUkZDIDI0MjUgKE1JTUUtRElSIGRvY3VtZW50KS4KLSAgICAgICAgICAgICAgICAgICAgLy8gRm9sbG93aW5nIGlzIHRoZSBleGNlcnB0cyBmcm9tIGl0LiAgCi0gICAgICAgICAgICAgICAgICAgIC8vCi0gICAgICAgICAgICAgICAgICAgIC8vIERFU0NSSVBUSU9OOlRoaXMgaXMgYSBsb25nIGRlc2NyaXB0aW9uIHRoYXQgZXhpc3RzIG9uIGEgbG9uZyBsaW5lLgotICAgICAgICAgICAgICAgICAgICAvLyAKLSAgICAgICAgICAgICAgICAgICAgLy8gQ2FuIGJlIHJlcHJlc2VudGVkIGFzOgotICAgICAgICAgICAgICAgICAgICAvLwotICAgICAgICAgICAgICAgICAgICAvLyBERVNDUklQVElPTjpUaGlzIGlzIGEgbG9uZyBkZXNjcmlwdGlvbgotICAgICAgICAgICAgICAgICAgICAvLyAgdGhhdCBleGlzdHMgb24gYSBsb25nIGxpbmUuCi0gICAgICAgICAgICAgICAgICAgIC8vCi0gICAgICAgICAgICAgICAgICAgIC8vIEl0IGNvdWxkIGFsc28gYmUgcmVwcmVzZW50ZWQgYXM6Ci0gICAgICAgICAgICAgICAgICAgIC8vCi0gICAgICAgICAgICAgICAgICAgIC8vIERFU0NSSVBUSU9OOlRoaXMgaXMgYSBsb25nIGRlc2NyaXAKLSAgICAgICAgICAgICAgICAgICAgLy8gIHRpb24gdGhhdCBleGlzdHMgbwotICAgICAgICAgICAgICAgICAgICAvLyAgbiBhIGxvbmcgbGluZS4KLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobGluZS5zdWJzdHJpbmcoMSkpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobVByZXZpb3VzTGluZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChtUHJldmlvdXNMaW5lKTsKLSAgICAgICAgICAgICAgICAgICAgbVByZXZpb3VzTGluZSA9IG51bGw7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGxpbmUuc3Vic3RyaW5nKDEpKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVkNhcmRFeGNlcHRpb24oIlNwYWNlIGV4aXN0cyBhdCB0aGUgYmVnaW5uaW5nIG9mIHRoZSBsaW5lIik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBpZiAobVByZXZpb3VzTGluZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1QcmV2aW91c0xpbmUgPSBsaW5lOwotICAgICAgICAgICAgICAgICAgICBpZiAoYnVpbGRlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHJldCA9IG1QcmV2aW91c0xpbmU7Ci0gICAgICAgICAgICAgICAgICAgIG1QcmV2aW91c0xpbmUgPSBsaW5lOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmV0OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICAKLSAgICAKLSAgICAvKioKLSAgICAgKiB2Y2FyZCA9IFtncm91cCAiLiJdICJCRUdJTiIgIjoiICJWQ0FSRCIgMSAqIENSTEYKLSAgICAgKiAgICAgICAgIDE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bmd0aCgpID09IDApIHsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoIWxpbmUuc3RhcnRzV2l0aCgiICIpICYmICFsaW5lLnN0YXJ0c1dpdGgoIlx0IikpIHsKLSAgICAgICAgICAgICAgICBtUHJldmlvdXNMaW5lID0gbGluZTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGxpbmUpOwotICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOwotICAgIH0KLSAgICAKLSAgICAvKioKLSAgICAgKiBFU0NBUEVELUNIQVIgPSAiXFwiIC8gIlw7IiAvICJcLCIgLyAiXG4iIC8gIlxOIikKLSAgICAgKiAgICAgICAgICAgICAgOyBcXCBlbmNvZGVzIFwsIFxuIG9yIFxOIGVuY29kZXMgbmV3bGluZQotICAgICAqICAgICAgICAgICAgICA7IFw7IGVuY29kZXMgOywgXCwgZW5jb2RlcyAsCi0gICAgICogICAgICAgICAgICAgIAotICAgICAqIE5vdGU6IEFwcGxlIGVzY2FwZXMgJzonIGludG8gJ1w6JyB3aGlsZSBkb2VzIG5vdCBlc2NhcGUgJ1wnCi0gICAgICovCi0gICAgQE92ZXJyaWRlCi0gICAgcHJvdGVjdGVkIFN0cmluZyBtYXliZVVuZXNjYXBlVGV4dChTdHJpbmcgdGV4dCkgewotICAgICAgICByZXR1cm4gdW5lc2NhcGVUZXh0KHRleHQpOwotICAgIH0KLQotICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nIHVuZXNjYXBlVGV4dChTdHJpbmcgdGV4dCkgewotICAgICAgICBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICBpbnQgbGVuZ3RoID0gdGV4dC5sZW5ndGgoKTsKLSAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykgewotICAgICAgICAgICAgY2hhciBjaCA9IHRleHQuY2hhckF0KGkpOwotICAgICAgICAgICAgaWYgKGNoID09ICdcXCcgJiYgaSA8IGxlbmd0aCAtIDEpIHsKLSAgICAgICAgICAgICAgICBjaGFyIG5leHRfY2ggPSB0ZXh0LmNoYXJBdCgrK2kpOyAKLSAgICAgICAgICAgICAgICBpZiAobmV4dF9jaCA9PSAnbicgfHwgbmV4dF9jaCA9PSAnTicpIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIlxuIik7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobmV4dF9jaCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChjaCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIGJ1aWxkZXIudG9TdHJpbmcoKTsgICAgICAgIAotICAgIH0KLQotICAgIEBPdmVycmlkZQotICAgIHByb3RlY3RlZCBTdHJpbmcgbWF5YmVVbmVzY2FwZUNoYXJhY3RlcihjaGFyIGNoKSB7Ci0gICAgICAgIHJldHVybiB1bmVzY2FwZUNoYXJhY3RlcihjaCk7Ci0gICAgfQotCi0gICAgcHVibGljIHN0YXRpYyBTdHJpbmcgdW5lc2NhcGVDaGFyYWN0ZXIoY2hhciBjaCkgewotICAgICAgICBpZiAoY2ggPT0gJ24nIHx8IGNoID09ICdOJykgewotICAgICAgICAgICAgcmV0dXJuICJcbiI7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICByZXR1cm4gU3RyaW5nLnZhbHVlT2YoY2gpOwotICAgICAgICB9ICAgICAgICAKLSAgICB9Ci19CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9waW0vdmNhcmQvVkNh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zZWQgYXMga25vd24gdHlwZS4gUmV0dXJucyBTdHJpbmcgb2JqZWN0Ci0gICAgICogd2hlbiBub3QsIHdoaWNoIHNob3VsZCBiZSBzZXQgdG8gbGFiZWwuIAotICAgICAqLwotICAgIHB1YmxpYyBzdGF0aWMgT2JqZWN0IGdldFBob25lVHlwZUZyb21TdHJpbmdzKENvbGxlY3Rpb248U3RyaW5nPiB0eXBlcywKLSAgICAgICAgICAgIFN0cmluZyBudW1iZXIpIHsKLSAgICAgICAgaWYgKG51bWJlciA9PSBudWxsKSB7Ci0gICAgICAgICAgICBudW1iZXIgPSAiIjsKLSAgICAgICAgfQotICAgICAgICBpbnQgdHlwZSA9IC0xOwotICAgICAgICBTdHJpbmcgbGFiZWwgPSBudWxsOwotICAgICAgICBib29sZWFuIGlzRmF4ID0gZmFsc2U7Ci0gICAgICAgIGJvb2xlYW4gaGFzUHJlZiA9IGZhbHNlOwotICAgICAgICAKLSAgICAgICAgaWYgKHR5cGVzICE9IG51bGwpIHsKLSAgICAgICAgICAgIGZvciAoU3RyaW5nIHR5cGVTdHJpbmcgOiB0eXBlcykgewotICAgICAgICAgICAgICAgIGlmICh0eXBlU3RyaW5nID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHR5cGVTdHJpbmcgPSB0eXBlU3RyaW5nLnRvVXBwZXJDYXNlKCk7Ci0gICAgICAgICAgICAgICAgaWYgKHR5cGVTdHJpbmcuZXF1YWxzKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfUFJFRikpIHsKLSAgICAgICAgICAgICAgICAgICAgaGFzUHJlZiA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlU3RyaW5nLmVxdWFscyhWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX0ZBWCkpIHsKLSAgICAgICAgICAgICAgICAgICAgaXNGYXggPSB0cnVlOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlU3RyaW5nLnN0YXJ0c1dpdGgoIlgtIikgJiYgdHlwZSA8IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVTdHJpbmcgPSB0eXBlU3RyaW5nLnN1YnN0cmluZygyKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAodHlwZVN0cmluZy5sZW5ndGgoKSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBmaW5hbCBJbnRlZ2VyIHRtcCA9IHNLbm93blBob25lVHlwZU1hcF9TdG9JLmdldCh0eXBlU3RyaW5nKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHRtcCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgdHlwZUNhbmRpZGF0ZSA9IHRtcDsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRZUEVfUEFHRVIgaXMgcHJlZmVyZWQgd2hlbiB0aGUgbnVtYmVyIGNvbnRhaW5zIEAgc3Vycm9uZGVkIGJ5Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBhIHBhZ2VyIG51bWJlciBhbmQgYSBkb21haW4gbmFtZS4KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGUuZy4KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIG8gMTExMUBkb21haW4uY29tCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyB4IEBkb21haW4uY29tCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyB4IDExMTFACi0gICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgaW5kZXhPZkF0ID0gbnVtYmVyLmluZGV4T2YoIkAiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodHlwZUNhbmRpZGF0ZSA9PSBQaG9uZS5UWVBFX1BBR0VSCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIDAgPCBpbmRleE9mQXQgJiYgaW5kZXhPZkF0IDwgbnVtYmVyLmxlbmd0aCgpIC0gMSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgdHlwZSA8IDAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgdHlwZSA9PSBQaG9uZS5UWVBFX0NVU1RPTSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSB0bXA7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZSA8IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSBQaG9uZS5UWVBFX0NVU1RPTTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsID0gdHlwZVN0cmluZzsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBpZiAodHlwZSA8IDApIHsKLSAgICAgICAgICAgIGlmIChoYXNQcmVmKSB7Ci0gICAgICAgICAgICAgICAgdHlwZSA9IFBob25lLlRZUEVfTUFJTjsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgLy8gZGVmYXVsdCB0byBUWVBFX0hPTUUKLSAgICAgICAgICAgICAgICB0eXBlID0gUGhvbmUuVFlQRV9IT01FOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGlmIChpc0ZheCkgewotICAgICAgICAgICAgaWYgKHR5cGUgPT0gUGhvbmUuVFlQRV9IT01FKSB7Ci0gICAgICAgICAgICAgICAgdHlwZSA9IFBob25lLlRZUEVfRkFYX0hPTUU7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gUGhvbmUuVFlQRV9XT1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1dFVua25vd25Ub0NvbnRhY3RzUGhvdGVUeXBlKGZpbmFsIFN0cmluZyBsYWJlbCkgewotICAgICAgICByZXR1cm4gc1Bob25lVHlwZXNVbmtub3duVG9Db250YWN0c1NldC5jb250YWlucyhsYWJlbCk7Ci0gICAgfQotCi0gICAgcHVibGljIHN0YXRpYyBTdHJpbmcgZ2V0UHJvcGVydHlOYW1lRm9ySW0oZmluYWwgaW50IHByb3RvY29sKSB7Ci0gICAgICAgIHJldHVybiBzS25vd25JbVByb3BOYW1lTWFwX0l0b1MuZ2V0KHByb3RvY29sKTsKLSAgICB9Ci0KLSAgICBwdWJsaWMgc3RhdGljIFN0cmluZ1tdIHNvcnROYW1lRWxlbWVudHMoZmluYWwgaW50IHZjYXJkVHlwZSwKLSAgICAgICAgICAgIGZpbmFsIFN0cmluZyBmYW1pbHlOYW1lLCBmaW5hbCBTdHJpbmcgbWlkZGxlTmFtZSwgZmluYWwgU3RyaW5nIGdpdmVuTmFtZSkgewotICAgICAgICBmaW5hbCBTdHJpbmdbXSBsaXN0ID0gbmV3IFN0cmluZ1szXTsKLSAgICAgICAgZmluYWwgaW50IG5hbWVPcmRlclR5cGUgPSBWQ2FyZENvbmZpZy5nZXROYW1lT3JkZXJUeXBlKHZjYXJkVHlwZSk7Ci0gICAgICAgIHN3aXRjaCAobmFtZU9yZGVyVHlwZSkgewotICAgICAgICAgICAgY2FzZSBWQ2FyZENvbmZpZy5OQU1FX09SREVSX0pBUEFORVNFOiB7Ci0gICAgICAgICAgICAgICAgaWYgKGNvbnRhaW5zT25seVByaW50YWJsZUFzY2lpKGZhbWlseU5hbWUpICYmCi0gICAgICAgICAgICAgICAgICAgICAgICBjb250YWluc09ubHlQcmludGFibGVBc2NpaShnaXZlbk5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGxpc3RbMF0gPSBnaXZlbk5hbWU7Ci0gICAgICAgICAgICAgICAgICAgIGxpc3RbMV0gPSBtaWRkbGVOYW1lOwotICAgICAgICAgICAgICAgICAgICBsaXN0WzJdID0gZmFtaWx5TmFtZTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBsaXN0WzBdID0gZmFtaWx5TmFtZTsKLSAgICAgICAgICAgICAgICAgICAgbGlzdFsxXSA9IG1pZGRsZU5hbWU7Ci0gICAgICAgICAgICAgICAgICAgIGxpc3RbMl0gPSBnaXZlbk5hbWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBWQ2FyZENvbmZpZy5OQU1FX09SREVSX0VVUk9QRTogewotICAgICAgICAgICAgICAgIGxpc3RbMF0gPSBtaWRkbGVOYW1lOwotICAgICAgICAgICAgICAgIGxpc3RbMV0gPSBnaXZlbk5hbWU7Ci0gICAgICAgICAgICAgICAgbGlzdFsyXSA9IGZhbWlseU5hbWU7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBkZWZhdWx0OiB7Ci0gICAgICAgICAgICAgICAgbGlzdFswXSA9IGdpdmVuTmFtZTsKLSAgICAgICAgICAgICAgICBsaXN0WzFdID0gbWlkZGxlTmFtZTsKLSAgICAgICAgICAgICAgICBsaXN0WzJdID0gZmFtaWx5TmFtZTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gbGlzdDsKLSAgICB9Ci0KLSAgICBwdWJsaWMgc3RhdGljIGludCBnZXRQaG9uZU51bWJlckZvcm1hdChmaW5hbCBpbnQgdmNhcmRUeXBlKSB7Ci0gICAgICAgIGlmIChWQ2FyZENvbmZpZy5pc0phcGFuZXNlRGV2aWNlKHZjYXJkVHlwZSkpIHsKLSAgICAgICAgICAgIHJldHVybiBQaG9uZU51bWJlclV0aWxzLkZPUk1BVF9KQVBBTjsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICA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gdmNhcmRUeXBlLAotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGZhbWlseU5hbWUsIGZpbmFsIFN0cmluZyBtaWRkbGVOYW1lLCBmaW5hbCBTdHJpbmcgZ2l2ZW5OYW1lLAotICAgICAgICAgICAgZmluYWwgU3RyaW5nIHByZWZpeCwgZmluYWwgU3RyaW5nIHN1ZmZpeCkgewotICAgICAgICBmaW5hbCBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICBmaW5hbCBTdHJpbmdbXSBuYW1lTGlzdCA9IHNvcnROYW1lRWxlbWVudHModmNhcmRUeXBlLCBmYW1pbHlOYW1lLCBtaWRkbGVOYW1lLCBnaXZlbk5hbWUpOwotICAgICAgICBib29sZWFuIGZpcnN0ID0gdHJ1ZTsKLSAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShwcmVmaXgpKSB7Ci0gICAgICAgICAgICBmaXJzdCA9IGZhbHNlOwotICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQocHJlZml4KTsKLSAgICAgICAgfQotICAgICAgICBmb3IgKGZpbmFsIFN0cmluZyBuYW1lUGFydCA6IG5hbWVMaXN0KSB7Ci0gICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KG5hbWVQYXJ0KSkgewotICAgICAgICAgICAgICAgIGlmIChmaXJzdCkgewotICAgICAgICAgICAgICAgICAgICBmaXJzdCA9IGZhbHNlOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCcgJyk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKG5hbWVQYXJ0KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHN1ZmZpeCkpIHsKLSAgICAgICAgICAgIGlmICghZmlyc3QpIHsKLSAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgnICcpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoc3VmZml4KTsKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOwotICAgIH0KLQotICAgIHB1YmxpYyBzdGF0aWMgTGlzdDxTdHJpbmc+IGNvbnN0cnVjdExpc3RGcm9tVmFsdWUoZmluYWwgU3RyaW5nIHZhbHVlLAotICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBpc1YzMCkgewotICAgICAgICBmaW5hbCBMaXN0PFN0cmluZz4gbGlzdCA9IG5ldyBBcnJheUxpc3Q8U3RyaW5nPigpOwotICAgICAgICBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICBpbnQgbGVuZ3RoID0gdmFsdWUubGVuZ3RoKCk7Ci0gICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHsKLSAgICAgICAgICAgIGNoYXIgY2ggPSB2YWx1ZS5jaGFyQXQoaSk7Ci0gICAgICAgICAgICBpZiAoY2ggPT0gJ1xcJyAmJiBpIDwgbGVuZ3RoIC0gMSkgewotICAgICAgICAgICAgICAgIGNoYXIgbmV4dENoID0gdmFsdWUuY2hhckF0KGkgKyAxKTsKLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgdW5lc2NhcGVkU3RyaW5nID0KLSAgICAgICAgICAgICAgICAgICAgKGlzVjMwID8gVkNhcmRQYXJzZXJfVjMwLnVuZXNjYXBlQ2hhcmFjdGVyKG5leHRDaCkgOgotICAgICAgICAgICAgICAgICAgICAgICAgVkNhcmRQYXJzZXJfVjIxLnVuZXNjYXBlQ2hhcmFjdGVyKG5leHRDaCkpOwotICAgICAgICAgICAgICAgIGlmICh1bmVzY2FwZWRTdHJpbmcgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCh1bmVzY2FwZWRTdHJpbmcpOwotICAgICAgICAgICAgICAgICAgICBpKys7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoY2gpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT0gJzsnKSB7Ci0gICAgICAgICAgICAgICAgbGlzdC5hZGQoYnVpbGRlci50b1N0cmluZygpKTsKLSAgICAgICAgICAgICAgICBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoY2gpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGxpc3QuYWRkKGJ1aWxkZXIudG9TdHJpbmcoKSk7Ci0gICAgICAgIHJldHVybiBsaXN0OwotICAgIH0KLQotICAgIHB1YmxpYyBzdGF0aWMgYm9vbGVhbiBjb250YWluc09ubHlQcmludGFibGVBc2NpaShmaW5hbCBTdHJpbmcuLi52YWx1ZXMpIHsKLSAgICAgICAgaWYgKHZhbHVlcyA9PSBudWxsKSB7Ci0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gY29udGFpbnNPbmx5UHJpbnRhYmxlQXNjaWkoQXJyYXlzLmFzTGlzdCh2YWx1ZXMpKTsKLSAgICB9Ci0KLSAgICBwdWJsaWMgc3RhdGljIGJvb2xlYW4gY29udGFpbnNPbmx5UHJpbnRhYmxlQXNjaWkoZmluYWwgQ29sbGVjdGlvbjxTdHJpbmc+IHZhbHVlcykgewotICAgICAgICBpZiAodmFsdWVzID09IG51bGwpIHsKLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9Ci0gICAgICAgIGZvciAoZmluYWwgU3RyaW5nIHZhbHVlID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ICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgIH0KLSAgICAgICAgZmluYWwgaW50IGFzY2lpRmlyc3QgPSAweDIwOwotICAgICAgICBmaW5hbCBpbnQgYXNjaWlMYXN0ID0gMHg3RTsgIC8vIGluY2x1ZGVkCi0gICAgICAgIGZvciAoZmluYWwgU3RyaW5nIHZhbHVlIDogdmFsdWVzKSB7Ci0gICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkodmFsdWUpKSB7Ci0gICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBmaW5hbCBpbnQgbGVuZ3RoID0gdmFsdWUubGVuZ3RoKCk7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbmd0aDsgaSA9IHZhbHVlLm9mZnNldEJ5Q29kZVBvaW50cyhpLCAxKSkgewotICAgICAgICAgICAgICAgIGZpbmFsIGludCBjID0gdmFsdWUuY29kZVBvaW50QXQoaSk7Ci0gICAgICAgICAgICAgICAgaWYgKCEoYXNjaWlGaXJzdCA8PSBjICYmIGMgPD0gYXNjaWlMYXN0KSkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiB0cnVlOwotICAgIH0KLQotICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFNldDxDaGFyYWN0ZXI+IHNVbkFjY2VwdGFibGVBc2NpaUluVjIxV29yZFNldCA9Ci0gICAgICAgIG5ldyBIYXNoU2V0PENoYXJhY3Rlcj4oQXJyYXlzLmFzTGlzdCgnWycsICddJywgJz0nLCAnOicsICcuJywgJywnLCAnICcpKTsKLQotICAgIC8qKgotICAgICAqIFRoaXMgaXMgdXNlZnVsIHNpbmNlIHZDYXJkIDMuMCBvZnRlbiByZXF1aXJlcyB0aGUgKCJYLSIpIHByb3BlcnRpZXMgYW5kIG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XJyYXkpLgorICAgICAqIAorICAgICAqIEBwYXJhbSB2YWx1ZSBUaGUgdmFsdWUgd2hvc2UgaW5kZXggc2hvdWxkIGJlIHJldHVybmVkLgorICAgICAqIEByZXR1cm4gVGhlIGluZGV4IG9mIHRoZSB2YWx1ZSwgb3IgLTEgaWYgbm90IGZvdW5kLgorICAgICAqLworICAgIHB1YmxpYyBpbnQgZmluZEluZGV4T2ZWYWx1ZShTdHJpbmcgdmFsdWUpIHsKKyAgICAgICAgaWYgKHZhbHVlICE9IG51bGwgJiYgbUVudHJ5VmFsdWVzICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSBtRW50cnlWYWx1ZXMubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0pIHsKKyAgICAgICAgICAgICAgICBpZiAobUVudHJ5VmFsdWVzW2ldLmVxdWFscyh2YWx1ZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisgICAgCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgb25QcmVwYXJlRGlhbG9nQnVpbGRlcihCdWlsZGVyIGJ1aWxkZXIpIHsKKyAgICAgICAgc3VwZXIub25QcmVwYXJlRGlhbG9nQnVpbGRlcihidWlsZGVyKTsKKyAgICAgICAgCisgICAgICAgIGlmIChtRW50cmllcyA9PSBudWxsIHx8IG1FbnRyeVZhbHVlcyA9PSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAiTXVsdGlTZWxlY3RMaXN0UHJlZmVyZW5jZSByZXF1aXJlcyBhbiBlbnRyaWVzIGFycmF5IGFuZCAiICsKKyAgICAgICAgICAgICAgICAgICAgImFuIGVudHJ5VmFsdWVzIGFycmF5LiIpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBib29sZWFuW10gY2hlY2tlZEl0ZW1zID0gZ2V0U2VsZWN0ZWRJdGVtcygpOworICAgICAgICBidWlsZGVyLnNldE11bHRpQ2hvaWNlSXRlbXMobUVudHJpZXMsIGNoZWNrZWRJdGVtcywKKyAgICAgICAgICAgICAgICBuZXcgRGlhbG9nSW50ZXJmYWNlLk9uTXVsdGlDaG9pY2VDbGlja0xpc3RlbmVyKCkgeworICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKERpYWxvZ0ludGVyZmFjZSBkaWFsb2csIGludCB3aGljaCwgYm9vbGVhbiBpc0NoZWNrZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0NoZWNrZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUHJlZmVyZW5jZUNoYW5nZWQgfD0gbU5ld1ZhbHVlcy5hZGQobUVudHJpZXNbd2hpY2hdLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUHJlZmVyZW5jZUNoYW5nZWQgfD0gbU5ld1ZhbHVlcy5yZW1vdmUobUVudHJpZXNbd2hpY2hdLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgIG1OZXdWYWx1ZXMuY2xlYXIoKTsKKyAgICAgICAgbU5ld1ZhbHVlcy5hZGRBbGwobVZhbHVlcyk7CisgICAgfQorICAgIAorICAgIHByaXZhdGUgYm9vbGVhbltdIGdldFNlbGVjdGVkSXRlbXMoKSB7CisgICAgICAgIGZpbmFsIENoYXJTZXF1ZW5jZVtdIGVudHJpZXMgPSBtRW50cmllczsKKyAgICAgICAgZmluYWwgaW50IGVudHJ5Q291bnQgPSBlbnRyaWVzLmxlbmd0aDsKKyAgICAgICAgZ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HJldHVybiBteVN0YXRlOworICAgIH0KKyAgICAKKyAgICBwcml2YXRlIHN0YXRpYyBjbGFzcyBTYXZlZFN0YXRlIGV4dGVuZHMgQmFzZVNhdmVkU3RhdGUgeworICAgICAgICBTZXQ8U3RyaW5nPiB2YWx1ZXM7CisgICAgICAgIAorICAgICAgICBwdWJsaWMgU2F2ZWRTdGF0ZShQYXJjZWwgc291cmNlKSB7CisgICAgICAgICAgICBzdXBlcihzb3VyY2UpOworICAgICAgICAgICAgdmFsdWVzID0gbmV3IEhhc2hTZXQ8U3RyaW5nPigpOworICAgICAgICAgICAgU3RyaW5nW10gc3RyaW5ncyA9IHNvdXJjZS5yZWFkU3RyaW5nQXJyYXkoKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgZmluYWwgaW50IHN0cmluZ0NvdW50ID0gc3RyaW5ncy5sZW5ndGg7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHN0cmluZ0NvdW50OyBpKyspIHsKKyAgICAgICAgICAgICAgICB2YWx1ZXMuYWRkKHN0cmluZ3NbaV0pOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBwdWJsaWMgU2F2ZWRTdGF0ZShQYXJjZWxhYmxlIHN1cGVyU3RhdGUpIHsKKyAgICAgICAgICAgIHN1cGVyKHN1cGVyU3RhdGUpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgd3JpdGVUb1BhcmNlbChQYXJjZWwgZGVzdCwgaW50IGZsYWdzKSB7CisgICAgICAgICAgICBzdXBlci53cml0ZVRvUGFyY2VsKGRlc3QsIGZsYWdzKTsKKyAgICAgICAgICAgIGRlc3Qud3JpdGVTdHJpbmdBcnJheSh2YWx1ZXMudG9BcnJheShuZXcgU3RyaW5nWzBdKSk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgUGFyY2VsYWJs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biB0aGUgc3RyaW5ncywgYW5kIGNoZWNrIGlmIHdlIHNob3VsZCBjb21taXQgKGFuZAorICAgICAqIGNvbW1pdCBpZiBzbykuCisgICAgICogCisgICAgICogQHBhcmFtIHZhbHVlcyBUaGUgdmFsdWVzIHRvIHBlcnNpc3QuCisgICAgICogQHJldHVybiBUcnVlIGlmIHRoZSBQcmVmZXJlbmNlIGlzIHBlcnNpc3RlbnQuIChUaGlzIGlzIG5vdCB3aGV0aGVyIHRoZQorICAgICAqICAgICAgICAgdmFsdWUgd2FzIHBlcnNpc3RlZCwgc2luY2Ugd2UgbWF5IG5vdCBuZWNlc3NhcmlseSBjb21taXQgaWYgdGhlcmUKKyAgICAgKiAgICAgICAgIHdpbGwgYmUgYSBiYXRjaCBjb21taXQgbGF0ZXIuKQorICAgICAqIEBzZWUgI2dldFBlcnNpc3RlZFN0cmluZyhTZXQpCisgICAgICogCisgICAgICogQGhpZGUgUGVuZGluZyBBUEkgYXBwcm92YWwKKyAgICAgKi8KKyAgICBwcm90ZWN0ZWQgYm9vbGVhbiBwZXJzaXN0U3RyaW5nU2V0KFNldDxTdHJpbmc+IHZhbHVlcykgeworICAgICAgICBpZiAoc2hvdWxkUGVyc2lzdCgpKSB7CisgICAgICAgICAgICAvLyBTaG91bGRuJ3Qgc3RvcmUgbnVsbAorICAgICAgICAgICAgaWYgKHZhbHVlcy5lcXVhbHMoZ2V0UGVyc2lzdGVkU3RyaW5nU2V0KG51bGwpKSkgeworICAgICAgICAgICAgICAgIC8vIEl0J3MgYWxyZWFkeSB0aGVyZSwgc28gdGhlIHNhbWUgYXMgcGVyc2lzdGluZworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBTaGFyZWRQcmVmZXJlbmNlcy5FZGl0b3IgZWRpdG9yID0gbVByZWZlcmVuY2VNYW5hZ2VyLmdldEVkaXRvcigpOworICAgICAgICAgICAgZWRpdG9yLnB1dFN0cmlu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ICAgICAgIEBPdmVycmlkZQogICAgICAgICBwdWJsaWMgdm9pZCBoYW5kbGVNZXNzYWdlKE1lc3NhZ2UgbXNnKSB7CiAgICAgICAgICAgICBzd2l0Y2ggKG1zZy53aGF0KSB7Ci0gICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgICAgICBjYXNlIE1TR19CSU5EX1BSRUZFUkVOQ0VTOgogICAgICAgICAgICAgICAgICAgICBiaW5kUHJlZmVyZW5jZXMoKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CkBAIC0xMDUsNyArMTIxLDQ5IEBACiAgICAgICAgIHN1cGVyLm9uQ3JlYXRlKHNhdmVkSW5zdGFuY2VTdGF0ZSk7CiAKICAgICAgICAgc2V0Q29udGVudFZpZXcoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5sYXlvdXQucHJlZmVyZW5jZV9saXN0X2NvbnRlbnQpOwotICAgICAgICAKKworICAgICAgICAvLyBzZWUgaWYgd2Ugc2hvdWxkIHNob3cgQmFjay9OZXh0IGJ1dHRvbnMKKyAgICAgICAgSW50ZW50IGludGVudCA9IGdldEludGVudCgpOworICAgICAgICBpZiAoaW50ZW50LmdldEJvb2xlYW5FeHRyYShFWFRSQV9QUkVGU19TSE9XX0JVVFRPTl9CQVIsIGZhbHNlKSkgeworCisgICAgICAgICAgICBmaW5kVmlld0J5SWQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC5idXR0b25fYmFyKS5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7CisKKyAgICAgICAgICAgIEJ1dHRvbiBiYWNrQnV0dG9uID0gKEJ1dHRvbilmaW5kVmlld0J5SWQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC5iYWNrX2J1dHRvbik7CisgICAgICAgICAgICBiYWNrQnV0dG9uLnNldE9uQ2xpY2tMaXN0ZW5lcihuZXcgT25DbGlja0xpc3RlbmVyKCkgeworICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soVmlldyB2KSB7CisgICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChSRVNVTFRfQ0FOQ0VMRUQpOworICAgICAgICAgICAgICAgICAgICBmaW5pc2goKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIG1OZXh0QnV0dG9uID0gKEJ1dHRvbilmaW5kVmlld0J5SWQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC5uZXh0X2J1dHRvbik7CisgICAgICAgICAgICBtTmV4dEJ1dHRvbi5zZXRPbkNsaWNrTGlzdGVuZXIobmV3IE9uQ2xpY2tMaXN0ZW5lcigpIHsKKyAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKFZpZXcgdikgeworICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoUkVTVUxUX09LKTsKKyAgICAgICAgICAgICAgICAgICAgZmluaXNoKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIC8vIHNldCBvdXIgdmFyaW91cyBidXR0b24gcGFyYW1ldGVycworICAgICAgICAgICAgaWYgKGludGVudC5oYXNFeHRyYShFWFRSQV9QUkVGU19TRVRfTkVYVF9URVhUKSkgeworICAgICAgICAgICAgICAgIFN0cmluZyBidXR0b25UZXh0ID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKEVYVFJBX1BSRUZTX1NFVF9ORVhUX1RFWFQpOworICAgICAgICAgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eShidXR0b25UZXh0KSkgeworICAgICAgICAgICAgICAgICAgICBtTmV4dEJ1dHRvbi5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICBtTmV4dEJ1dHRvbi5zZXRUZXh0KGJ1dHRvblRleHQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChpbnRlbnQuaGFzRXh0cmEoRVhUUkFfUFJFRlNfU0VUX0JBQ0tfVEVYVCkpIHsKKyAgICAgICAgICAgICAgICBTdHJpbmcgYnV0dG9uVGV4dCA9IGludGVudC5nZXRTdHJpbmdFeHRyYShFWFRSQV9QUkVGU19TRVRfQkFDS19URVhUKTsKKyAgICAgICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkoYnV0dG9uVGV4dCkpIHsKKyAgICAgICAgICAgICAgICAgICAgYmFja0J1dHRvbi5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICBiYWNrQnV0dG9uLnNldFRleHQoYnV0dG9uVGV4dCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKICAgICAgICAgbVByZWZlcmVuY2VNYW5hZ2VyID0gb25DcmVhdGVQcmVmZXJlbmNlTWFuYWdlcigpOwogICAgICAgICBnZXRMaXN0VmlldygpLnNldFNjcm9sbEJhclN0eWxlKFZpZXcuU0NST0xMQkFSU19JTlNJREVfT1ZFUkxBWSk7CiAgICAgfQpAQCAtMTEzLDE0ICsxNzEsMTMgQEAKICAgICBAT3ZlcnJpZGUKICAgICBwcm90ZWN0ZWQgdm9pZCBvblN0b3AoKSB7CiAgICAgICAgIHN1cGVyLm9uU3RvcCgpOwotICAgICAgICAKKwogICAgICAgICBtUHJlZmVyZW5jZU1hbmFnZXIuZGlzcGF0Y2hBY3Rpdml0eVN0b3AoKTsKICAgICB9CiAKICAgICBAT3ZlcnJpZGUKICAgICBwcm90ZWN0ZWQgdm9pZCBvbkRlc3Ryb3koKSB7CiAgICAgICAgIHN1cGVyLm9uRGVzdHJveSgpOwotICAgICAgICAKICAgICAgICAgbVByZWZlcmVuY2VNYW5hZ2VyLmRpc3BhdGNoQWN0aXZpdHlEZXN0c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IFRPRE8gUmVwbGFjZSB0aGlzIHdpdGggc29tZXRoaW5nIG1vcmUgZ2VuZXJhbCBpbiB0aGUgZnV0dXJlLgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChsb25nKTwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIF9TWU5DX0RBVEEgPSAiX3N5bmNfbG9jYWxfaWQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBVc2VkIG9ubHkgaW4gcGVyc2lzdGVudCBwcm92aWRlcnMsIGFuZCBvbmx5IGR1cmluZyBtZXJnaW5nLgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChsb25nKTwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIF9TWU5DX01BUksgPSAiX3N5bmNfbWFyayI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFVzZWQgdG8gaW5kaWNhdGUgdGhhdCBsb2NhbCwgdW5zeW5jZWQsIGNoYW5nZXMgYXJlIHByZXNlbnQuCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVIgKGxvbmcpPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgX1NZTkNfRElSVFkgPSAiX3N5bmNfZGlydHkiOworCisgICAgfQorCisgICAgLyoqCisgICAgICogQ29sdW1ucyBmcm9tIHRoZSBBY2NvdW50IGluZm9ybWF0aW9uIHVzZWQgYnkgQ2FsZW5kYXJzIGFuZCBFdmVudHMgdGFibGVzLgorICAgICAqLworICAgIHB1YmxpYyBpbnRlcmZhY2UgQWNjb3VudENvbHVtbnMgeworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIG5hbWUgb2YgdGhlIGFjY291bnQgaW5zdGFuY2UgdG8gd2hpY2ggdGhpcyByb3cgYmVsb25ncywgd2hpY2ggd2hlbiBwYWlyZWQgd2l0aAorICAgICAgICAgKiB7QGxpbmsgI0FDQ09VTlRfVFlQRX0gaWRlbnRpZmllcyBhIHNwZWNpZmljIGFjY291bnQuCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBBQ0NPVU5UX05BTUUgPSAiYWNjb3VudF9uYW1lIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIHR5cGUgb2YgYWNjb3VudCB0byB3aGljaCB0aGlzIHJvdyBiZWxvbmdzLCB3aGljaCB3aGVuIHBhaXJlZCB3aXRoCisgICAgICAgICAqIHtAbGluayAjQUNDT1VOVF9OQU1FfSBpZGVudGlmaWVzIGEgc3BlY2lmaWMgYWNjb3VudC4KKyAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEFDQ09VTlRfVFlQRSA9ICJhY2NvdW50X3R5cGUiOworICAgIH0KKwogICAgIC8qKgogICAgICAqIENvbHVtbnMgZnJvbSB0aGUgQ2FsZW5kYXJzIHRhYmxlIHRoYXQgb3RoZXIgdGFibGVzIGpvaW4gaW50byB0aGVtc2VsdmVzLgogICAgICAqLwotICAgIHB1YmxpYyBpbnRlcmZhY2UgQ2FsZW5kYXJzQ29sdW1ucwotICAgIHsKKyAgICBwdWJsaWMgaW50ZXJmYWNlIENhbGVuZGFyc0NvbHVtbnMgewogICAgICAgICAvKioKICAgICAgICAgICogVGhlIGNvbG9yIG9mIHRoZSBjYWxlbmRhcgogICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChjb2xvciB2YWx1ZSk8L1A+CkBAIC0xMzUsNzUgKzIxMSwxMDQgQEAKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU1lOQ19TVEFURSA9ICJzeW5jX3N0YXRlIjsKIAogICAgICAgICAvKioKLSAgIC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BiZWVuIHN5bmNocm9uaXplZC4KLSAgICAgICAgICogPFA+VHlwZTogSU5URUdFUiAobG9uZyk8L1A+Ci0gICAgICAgICAqLwotICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBfU1lOQ19USU1FID0gIl9zeW5jX3RpbWUiOwotCi0gICAgICAgIC8qKgotICAgICAgICAgKiBUaGUgdmVyc2lvbiBvZiB0aGUgcm93LCBhcyBhc3NpZ25lZCBieSB0aGUgc2VydmVyLgotICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgotICAgICAgICAgKi8KLSAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgX1NZTkNfVkVSU0lPTiA9ICJfc3luY192ZXJzaW9uIjsKLQotICAgICAgICAvKioKLSAgICAgICAgICogRm9yIHVzZSBieSBzeW5jIGFkYXB0ZXIgYXQgaXRzIGRpc2NyZXRpb247IG5vdCBtb2RpZmllZCBieSBDYWxlbmRhclByb3ZpZGVyCi0gICAgICAgICAqIE5vdGUgdGhhdCB0aGlzIGNvbHVtbiB3YXMgZm9ybWVybHkgbmFtZWQgX1NZTkNfTE9DQUxfSUQuICBXZSBhcmUgdXNpbmcgaXQgdG8gYXZvaWQgYQotICAgICAgICAgKiBzY2hlbWEgY2hhbmdlLgotICAgICAgICAgKiBUT0RPIFJlcGxhY2UgdGhpcyB3aXRoIHNvbWV0aGluZyBtb3JlIGdlbmVyYWwgaW4gdGhlIGZ1dHVyZS4KLSAgICAgICAgICogPFA+VHlwZTogSU5URUdFUiAobG9uZyk8L1A+Ci0gICAgICAgICAqLwotICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBfU1lOQ19EQVRBID0gIl9zeW5jX2xvY2FsX2lkIjsKLQotICAgICAgICAvKioKLSAgICAgICAgICogVXNlZCBvbmx5IGluIHBlcnNpc3RlbnQgcHJvdmlkZXJzLCBhbmQgb25seSBkdXJpbmcgbWVyZ2luZy4KLSAgICAgICAgICogP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zb3JFbnRpdHlJdGVyYXRvciB7CisgICAgICAgICAgICBwcml2YXRlIGZpbmFsIENvbnRlbnRSZXNvbHZlciBtUmVzb2x2ZXI7CisgICAgICAgICAgICBwcml2YXRlIGZpbmFsIENvbnRlbnRQcm92aWRlckNsaWVudCBtUHJvdmlkZXI7CisKKyAgICAgICAgICAgIHB1YmxpYyBFbnRpdHlJdGVyYXRvckltcGwoQ3Vyc29yIGN1cnNvciwgQ29udGVudFJlc29sdmVyIHJlc29sdmVyKSB7CisgICAgICAgICAgICAgICAgc3VwZXIoY3Vyc29yKTsKKyAgICAgICAgICAgICAgICBtUmVzb2x2ZXIgPSByZXNvbHZlcjsKKyAgICAgICAgICAgICAgICBtUHJvdmlkZXIgPSBudWxsOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBwdWJsaWMgRW50aXR5SXRlcmF0b3JJbXBsKEN1cnNvciBjdXJzb3IsIENvbnRlbnRQcm92aWRlckNsaWVudCBwcm92aWRlcikgeworICAgICAgICAgICAgICAgIHN1cGVyKGN1cnNvcik7CisgICAgICAgICAgICAgICAgbVJlc29sdmVyID0gbnVsbDsKKyAgICAgICAgICAgICAgICBtUHJvdmlkZXIgPSBwcm92aWRlcjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwdWJsaWMgRW50aXR5IGdldEVudGl0eUFuZEluY3JlbWVudEN1cnNvcihDdXJzb3IgY3Vyc29yKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgICAgICAgICAvLyB3ZSBleHBlY3QgdGhlIGN1cnNvciBpcyBhbHJlYWR5IGF0IHRoZSByb3cgd2UgbmVlZCB0byByZWFkIGZyb20KKyAgICAgICAgICAgICAgICBmaW5hbCBsb25nIGNhbGVuZGFySWQgPSBjdXJzb3IuZ2V0TG9uZyhjdXJzb3IuZ2V0Q29sdW1uSW5kZXhPclRocm93KF9JRCkpOworCisgICAgICAgICAgICAgICAgLy8gQ3JlYXRlIHRoZSBjb250ZW50IHZhbHVlCisgICAgICAgICAgICAgICAgQ29udGVudFZhbHVlcyBjdiA9IG5ldyBDb250ZW50VmFsdWVzKCk7CisgICAgICAgICAgICAgICAgY3YucHV0KF9JRCwgY2FsZW5kYXJJZCk7CisKKyAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvclN0cmluZ1RvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIGN2LCBfU1lOQ19BQ0NPVU5UKTsKKyAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvclN0cmluZ1RvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIGN2LCBfU1lOQ19BQ0NPVU5UX1RZUEUpOworCisgICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5jdXJzb3JTdHJpbmdUb0NvbnRlbnRWYWx1ZXNJZlByZXNlbnQoY3Vyc29yLCBjdiwgX1NZTkNfSUQpOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yU3RyaW5nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIF9TWU5DX1ZFUlNJT04pOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yU3RyaW5nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIF9TWU5DX1RJTUUpOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yU3RyaW5nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIF9TWU5DX0RBVEEpOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yTG9uZ1RvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIGN2LCBfU1lOQ19ESVJUWSk7CisgICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5jdXJzb3JMb25nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIF9TWU5DX01BUkspOworCisgICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5jdXJzb3JTdHJpbmdUb0NvbnRlbnRWYWx1ZXNJZlByZXNlbnQoY3Vyc29yLCBjdiwgQ2FsZW5kYXJzLlNFTEZfVVJMKTsKKyAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvclN0cmluZ1RvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIGN2LAorICAgICAgICAgICAgICAgICAgICAgICAgQ2FsZW5kYXJzLkVESVRfVVJMKTsKKyAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvclN0cmluZ1RvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIGN2LAorICAgICAgICAgICAgICAgICAgICAgICAgQ2FsZW5kYXJzLkVWRU5UU19VUkwpOworCisgICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5jdXJzb3JTdHJpbmdUb0NvbnRlbnRWYWx1ZXNJZlByZXNlbnQoY3Vyc29yLCBjdiwgQ2FsZW5kYXJzLk5BTUUpOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yU3RyaW5nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsCisgICAgICAgICAgICAgICAgICAgICAgICBDYWxlbmRhcnMuRElTUExBWV9OQU1FKTsKKyAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvckludFRvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIGN2LCBDYWxlbmRhcnMuSElEREVOKTsKKyAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvckludFRvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIGN2LCBDYWxlbmRhcnMuQ09MT1IpOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29ySW50VG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIEFDQ0VTU19MRVZFTCk7CisgICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5jdXJzb3JJbnRUb0NvbnRlbnRWYWx1ZXNJZlByZXNlbnQoY3Vyc29yLCBjdiwgU0VMRUNURUQpOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29ySW50VG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIFNZTkNfRVZFTlRTKTsKKyAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvclN0cmluZ1RvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIGN2LCBDYWxlbmRhcnMuTE9DQVRJT04pOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yU3RyaW5nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIFRJTUVaT05FKTsKKyAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvclN0cmluZ1RvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIGN2LAorICAgICAgICAgICAgICAgICAgICAgICAgQ2FsZW5kYXJzLk9XTkVSX0FDQ09VTlQpOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29ySW50VG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsCisgICAgICAgICAgICAgICAgICAgICAgICBDYWxlbmRhcnMuT1JHQU5JWkVSX0NBTl9SRVNQT05EKTsKKworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29ySW50VG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIERFTEVURUQpOworCisgICAgICAgICAgICAgICAgLy8gQ3JlYXRlIHRoZSBFbnRpdHkgZnJvbSB0aGUgQ29udGVudFZhbHVlCisgICAgICAgICAgICAgICAgRW50aXR5IGVudGl0eSA9IG5ldyBFbnRpdHkoY3YpOworCisgICAgICAgICAgICAgICAgLy8gU2V0IGN1cnNvciB0byBuZXh0IHJvdworICAgICAgICAgICAgICAgIGN1cnNvci5tb3ZlVG9OZXh0KCk7CisKKyAgICAgICAgICAgICAgICAvLyBSZXR1cm4gdGhlIGNyZWF0ZWQgRW50aXR5CisgICAgICAgICAgICAgICAgcmV0dXJuIGVudGl0eTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICB9CisKKyAgICAvKioKICAgICAgKiBDb250YWlucyBhIGxpc3Qgb2YgYXZhaWxhYmxlIGNhbGVuZGFycy4KICAgICAgKi8KLSAgICBwdWJsaWMgc3RhdGljIGNsYXNzIENhbGVuZGFycyBpbXBsZW1lbnRzIEJhc2VDb2x1bW5zLCBDYWxlbmRhcnNDb2x1bW5zCisgICAgcHVibGljIHN0YXRpYyBjbGFzcyBDYWxlbmRhcnMgaW1wbGVtZW50cyBCYXNlQ29sdW1ucywgU3luY0NvbHVtbnMsIEFjY291bnRDb2x1bW5zLAorICAgICAgICAgICAgQ2FsZW5kYXJzQ29sdW1ucwogICAgIHsKICAgICAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3RyaW5nIFdIRVJFX0RFTEVURV9GT1JfQUNDT1VOVCA9IENhbGVuZGFycy5fU1lOQ19BQ0NPVU5UICsgIj0/IgogICAgICAgICAgICAgICAgICsgIiBBTkQgIiArIENhbGVuZGFycy5fU1lOQ19BQ0NPVU5UX1RZUEUgKyAiPT8iOwpAQCAtMjU4LDYgKzM2MywyNCBAQAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBVUkwgPSAidXJsIjsKIAogICAgICAgICAvKioKKyAgICAgICAgICogVGhlIFVSTCBmb3IgdGhlIGNhbGVuZGFyIGl0c2VsZgorICAgICAgICAgKiA8UD5UeXBlOiBURVhUIChVUkwpPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU0VMRl9VUkwgPSAic2VsZlVybCI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBVUkwgZm9yIHRoZSBjYWxlbmRhciB0byBiZSBlZGl0ZWQKKyAgICAgICAgICogPFA+VHlwZTogVEVYVCAoVVJMKTwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEVESVRfVVJMID0gImVkaXRVcmwiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgVVJMIGZvciB0aGUgY2FsZW5kYXIgZXZlbnRzCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQgKFVSTCk8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBFVkVOVFNfVVJMID0gImV2ZW50c1VybCI7CisKKyAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBuYW1lIG9mIHRoZSBjYWxlbmRhcgogICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgogICAgICAgICAgKi8KQEAgLTI5Niw2ICs0MTksOSBAQAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBPUkdBTklaRVJfQ0FOX1JFU1BPTkQgPSAib3JnYW5pemVyQ2FuUmVzcG9uZCI7CiAgICAgfQogCisgICAgLyoqCisgICAgICogQ29sdW1ucyBmcm9tIHRoZSBBdHRlbmRlZXMgdGFibGUgdGhhdCBvdGhlciB0YWJsZXMgam9pbiBpbnRvIHRoZW1zZWx2ZXMuCisgICAgICovCiAgICAgcHVibGljIGludGVyZmFjZSBBdHRlbmRlZXNDb2x1bW5zIHsKIAogICAgICAgICAvKioKQEAgLTM2MSw4ICs0ODcsNyBAQAogICAgIC8qKgogICAgICAqIENvbHVtbnMgZnJvbSB0aGUgRXZlbnRzIHRhYmxlIHRoYXQgb3RoZXIgdGFibGVzIGpvaW4gaW50byB0aGVtc2VsdmVzLgogICAgICAqLwotICAgIHB1YmxpYyBpbnRlcmZhY2UgRXZlbnRzQ29sdW1ucwotICAgIHsKKyAgICBwdWJsaWMgaW50ZXJmYWNlIEV2ZW50c0NvbHVtbnMgewogICAgICAgICAvKioKICAgICAgICAgICogVGhlIGNhbGVuZGFyIHRoZSBldmVudCBiZWxvbmdzIHRvCiAgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVIgKGZvcmVpZ24ga2V5IHRvIHRoZSBDYWxlbmRhcnMgdGFibGUpPC9QPgpAQCAtNDM4LDYgKzU2MywxOCBAQAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBEVEVORCA9ICJkdGVuZCI7CiAKICAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSB0aW1lIHRoZSBldmVudCBzdGFydHMgd2l0aCBhbGxEYXkgZXZlbnRzIGluIGEgbG9jYWwgdHoKKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUiAobG9uZzsgbWlsbGlzIHNpbmNlIGVwb2NoKTwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERUU1RBUlQyID0gImR0c3RhcnQyIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIHRpbWUgdGhlIGV2ZW50IGVuZHMgd2l0aCBhbGxEYXkgZXZlbnRzIGluIGEgbG9jYWwgdHoKKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUiAobG9uZzsgbWlsbGlzIHNpbmNlIGVwb2NoKTwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERURU5EMiA9ICJkdGVuZDIiOworCisgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgZHVyYXRpb24gb2YgdGhlIGV2ZW50CiAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQgKGR1cmF0aW9uIGluIFJGQzI0NDUgZm9ybWF0KTwvUD4KICAgICAgICAgICovCkBAIC00NTAsNiArNTg3LDEyIEBACiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEVWRU5UX1RJTUVaT05FID0gImV2ZW50VGltZXpvbmUiOwogCiAgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgdGltZXpvbmUgZm9yIHRoZSBldmVudCwgYWxsRGF5IGV2ZW50cyB3aWxsIGhhdmUgYSBsb2NhbCB0eiBpbnN0ZWFkIG9mIFVUQworICAgICAgICAgKiA8UD5UeXBlOiBURVhUCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBFVkVOVF9USU1FWk9ORTIgPSAiZXZlbnRUaW1lem9uZTIiOworCisgICAgICAgIC8qKgogICAgICAgICAgKiBXaGV0aGVyIHRoZSBldmVudCBsYXN0cyBhbGwgZGF5IG9yIG5vdAogICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChib29sZWFuKTwvUD4KICAgICAgICAgICovCkBAIC01OTgsNyArNzQxLDggQEAKICAgICAvKioKICAgICAgKiBDb250YWlucyBvbmUgZW50cnkgcGVyIGNhbGVuZGFyIGV2ZW50LiBSZWN1cnJpbmcgZXZlbnRzIHNob3cgdXAgYXMgYSBzaW5nbGUgZW50cnkuCiAgICAgICovCi0gICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBFdmVudHNFbnRpdHkgaW1wbGVtZW50cyBCYXNlQ29sdW1ucywgRXZlbnRzQ29sdW1ucywgQ2FsZW5kYXJzQ29sdW1ucyB7CisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBFdmVudHNFbnRpdHkgaW1wbGVtZW50cyBCYXNlQ29sdW1ucywgU3luY0NvbHVtbnMsIEFjY291bnRDb2x1bW5zLAorICAgICAgICAgICAgRXZlbnRzQ29sdW1ucyB7CiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgY29udGVudDovLyBzdHlsZSBVUkwgZm9yIHRoaXMgdGFibGUKICAgICAgICAgICovCkBAIC03MDMsOCArODQ3LDkgQEAKICAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvclN0cmluZ1RvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIGN2LCBfU1lOQ19EQVRBKTsKICAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvckxvbmdUb0NvbnRlbnRWYWx1ZXNJZlByZXNlbnQoY3Vyc29yLCBjdiwgX1NZTkNfRElSVFkpOwogICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yU3RyaW5nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIF9TWU5DX1ZFUlNJT04pOwotICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29ySW50VG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIERFTEVURUQpOwotICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yU3RyaW5nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIENhbGVuZGFycy5VUkwpOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29ySW50VG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIEV2ZW50c0NvbHVtbnMuREVMRVRFRCk7CisgICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5jdXJzb3JTdHJpbmdUb0NvbnRlbnRWYWx1ZXNJZlByZXNlbnQoY3Vyc29yLCBjdiwKKyAgICAgICAgICAgICAgICAgICAgICAgIENhbGVuZGFycy5FVkVOVFNfVVJMKTsKIAogICAgICAgICAgICAgICAgIEVudGl0eSBlbnRpdHkgPSBuZXcgRW50aXR5KGN2KTsKICAgICAgICAgICAgICAgICBDdXJzb3Igc3ViQ3Vyc29yOwpAQCAtNzk1LDcgKzk0MCw4IEBACiAgICAgLyoqCiAgICAgICogQ29udGFpb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mkgQ09OVEVOVF9VUkkgPQogICAgICAgICAgICAgICAgIFVyaS53aXRoQXBwZW5kZWRQYXRoKENhbGVuZGFyLkNPTlRFTlRfVVJJLCBDT05URU5UX0RJUkVDVE9SWSk7CiAgICAgfQorCisgICAgLyoqCisgICAgICogQ29sdW1ucyBmcm9tIHRoZSBFdmVudHNSYXdUaW1lcyB0YWJsZQorICAgICAqLworICAgIHB1YmxpYyBpbnRlcmZhY2UgRXZlbnRzUmF3VGltZXNDb2x1bW5zIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBjb3JyZXNwb25kaW5nIGV2ZW50IGlkCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVIgKGxvbmcpPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRVZFTlRfSUQgPSAiZXZlbnRfaWQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgUkZDMjQ0NSBjb21wbGlhbnQgdGltZSB0aGUgZXZlbnQgc3RhcnRzCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBEVFNUQVJUXzI0NDUgPSAiZHRzdGFydDI0NDUiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgUkZDMjQ0NSBjb21wbGlhbnQgdGltZSB0aGUgZXZlbnQgZW5kcworICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRFRFTkRfMjQ0NSA9ICJkdGVuZDI0NDUiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgUkZDMjQ0NSBjb21wbGlhbnQgb3JpZ2luYWwgaW5zdGFuY2UgdGltZSBvZiB0aGUgcmVjdXJyaW5nIGV2ZW50IGZvciB3aGljaCB0aGlzCisgICAgIC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7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBNSU1FLXR5cGUgb2Yge0BsaW5rICNDT05URU5UX1VSSX0gcHJvdmlkaW5nIGEgZGlyZWN0b3J5IG9mCisgICAgICAgICAqIGNvbnRhY3QgZGlyZWN0b3JpZXMuCisgICAgICAgICAqCisgICAgICAgICAqIEBoaWRlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX1RZUEUgPQorICAgICAgICAgICAgICAgICJ2bmQuYW5kcm9pZC5jdXJzb3IuZGlyL2NvbnRhY3RfZGlyZWN0b3JpZXMiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgTUlNRSB0eXBlIG9mIGEge0BsaW5rICNDT05URU5UX1VSSX0gaXRlbS4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENPTlRFTlRfSVRFTV9UWVBFID0KKyAgICAgICAgICAgICAgICAidm5kLmFuZHJvaWQuY3Vyc29yLml0ZW0vY29udGFjdF9kaXJlY3RvcnkiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgbmFtZSBvZiB0aGUgcGFja2FnZSB0aGF0IG93bnMgdGhpcyBkaXJlY3RvcnkuIFRoaXMgZmllbGQgaXMKKyAgICAgICAgICogcmVxdWlyZWQgaW4gYW4gaW5zZXJ0IHJlcXVlc3QgYW5kIG11c3QgbWF0Y2ggdGhlIG5hbWUgb2YgdGhlIHBhY2thZ2UKKyAgICAgICAgICogbWFraW5nIHRoZSByZXF1ZXN0LiBJZiB0aGUgcGFja2FnZSBpcyBsYXRlciB1bmluc3RhbGxlZCwgdGhlCisgICAgICAgICAqIGRpcmVjdG9yaWVzIGl0IG93bnMgYXJlIGF1dG9tYXRpY2FsbHkgcmVtb3ZlZCBmcm9tIHRoaXMgdGFibGUuIE9ubHkKKyAgICAgICAgICogdGhlIHNwZWNpZmllZCBwYWNrYWdlIGlzIGFsbG93ZWQgdG8gbW9kaWZ5IG9yIGRlbGV0ZSB0aGlzIHJvdyBsYXRlci4KKyAgICAgICAgICoKKyAgICAgICAgICogPHA+VFlQRTogVEVYVDwvcD4KKyAgICAgICAgICoKKyAgICAgICAgICogQGhpZGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBBQ0tBR0VfTkFNRSA9ICJwYWNrYWdlTmFtZSI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSB0eXBlIG9mIGRpcmVjdG9yeSBjYXB0dXJlZCBhcyBhIHJlc291cmNlIElEIGluIHRoZSBjb250ZXh0IG9mIHRoZQorICAgICAgICAgKiBwYWNrYWdlIHtAbGluayAjUEFDS0FHRV9OQU1FfSwgZS5nLiAiQ29ycG9yYXRlIERpcmVjdG9yeSIKKyAgICAgICAgICoKKyAgICAgICAgICogPHA+VFlQRTogSU5URUdFUjwvcD4KKyAgICAgICAgICoKKyAgICAgICAgICogQGhpZGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFRZUEVfUkVTT1VSQ0VfSUQgPSAidHlwZVJlc291cmNlSWQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBBbiBvcHRpb25hbCBuYW1lIHRoYXQgY2FuIGJlIHVzZWQgaW4gdGhlIFVJIHRvIHJlcHJlc2VudCB0aGlzIGRpcmVjdG9yeSwKKyAgICAgICAgICogZS5nLiAiQWNtZSBDb3JwIgorICAgICAgICAgKiA8cD5UWVBFOiB0ZXh0PC9wPgorICAgICAgICAgKgorICAgICAgICAgKiBAaGlkZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRElTUExBWV9OQU1FID0gImRpc3BsYXlOYW1lIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGF1dGhvcml0eSB0byB3aGljaCB0aGUgcmVxdWVzdCBzaG91bGQgZm9yd2FyZGVkIGluIG9yZGVyIHRvIGFjY2VzcworICAgICAgICAgKiB0aGlzIGRpcmVjdG9yeS4KKyAgICAgICAgICoKKyAgICAgICAgICogPHA+VFlQRTogdGV4dDwvcD4KKyAgICAgICAgICoKKyAgICAgICAgICogQGhpZGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERJUkVDVE9SWV9BVVRIT1JJVFkgPSAiYXV0aG9yaXR5IjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGFjY291bnQgdHlwZSB3aGljaCB0aGlzIGRpcmVjdG9yeSBpcyBhc3NvY2lhdGVkLgorICAgICAgICAgKgorICAgICAgICAgKiA8cD5UWVBFOiB0ZXh0PC9wPgorICAgICAgICAgKgorICAgICAgICAgKiBAaGlkZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQUNDT1VOVF9UWVBFID0gImFjY291bnRUeXBlIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGFjY291bnQgd2l0aCB3aGljaCB0aGlzIGRpcmVjdG9yeSBpcyBhc3NvY2lhdGVkLiBJZiB0aGUgYWNjb3VudCBpcyBsYXRlcgorICAgICAgICAgKiByZW1vdmVkLCB0aGUgZGlyZWN0b3JpZXMgaXQgb3ducyBhcmUgYXV0b21hdGljYWxseSByZW1vdmVkIGZyb20gdGhpcyB0YWJsZS4KKyAgICAgICAgICoKKyAgICAgICAgICogPHA+VFlQRTogdGV4dDwvcD4KKyAgICAgICAgICoKKyAgICAgICAgICogQGhpZGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEFDQ09VTlRfTkFNRSA9ICJhY2NvdW50TmFtZSI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIE9uZSBvZiB7QGxpbmsgI0VYUE9SVF9TVVBQT1JUX05PTkV9LCB7QGxpbmsgI0VYUE9SVF9TVVBQT1JUX0FOWV9BQ0NPVU5UfSwKKyAgICAgICAgICoge0BsaW5rICNFWFBPUlRfU1VQUE9SVF9TQU1FX0FDQ09VTlRfT05MWX0uIFRoaXMgaXMgdGhlIGV4cGVjdGF0aW9uIHRoZQorICAgICAgICAgKiBkaXJlY3RvcnkgaGFzIGZvciBkYXRhIGV4cG9ydGVkIGZyb20gaXQuICBDbGllbnRzIG11c3Qgb2JleSB0aGlzIHNldHRpbmcuCisgICAgICAgICAqCisgICAgICAgICAqIEBoaWRlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBFWFBPUlRfU1VQUE9SVCA9ICJleHBvcnRTdXBwb3J0IjsKKworICAgICAgICAvKioKKyAgICAgICAgICogQW4ge0BsaW5rICNFWFBPUlRfU1VQUE9SVH0gc2V0dGluZyB0aGF0IGluZGljYXRlcyB0aGF0IHRoZSBkaXJlY3RvcnkKKyAgICAgICAgICogZG9lcyBub3QgYWxsb3cgYW55IGRhdGEgdG8gYmUgY29waWVkIG91dCBvZiBpdC4KKyAgICAgICAgICoKKyAgICAgICAgICogQGhpZGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEVYUE9SVF9TVVBQT1JUX05PTkUgPSAwOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBBbiB7QGxpbmsgI0VYUE9SVF9TVVBQT1JUfSBzZXR0aW5nIHRoYXQgaW5kaWNhdGVzIHRoYXQgdGhlIGRpcmVjdG9yeQorICAgICAgICAgKiBhbGxvdyBpdHMgZGF0YSBjb3BpZWQgb25seSB0byB0aGUgYWNjb3VudCBzcGVjaWZpZWQgYnkKKyAgICAgICAgICoge0BsaW5rICNBQ0NPVU5UX1RZUEV9L3tAbGluayAjQUNDT1VOVF9OQU1FfS4KKyAgICAgICAgICoKKyAgICAgICAgICogQGhpZGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEVYUE9SVF9TVVBQT1JUX1NBTUVfQUNDT1VOVF9PTkxZID0gMTsKKworICAgICAgICAvKioKKyAgICAgICAgICogQW4ge0BsaW5rICNFWFBPUlRfU1VQUE9SVH0gc2V0dGluZyB0aGF0IGluZGljYXRlcyB0aGF0IHRoZSBkaXJlY3RvcnkKKyAgICAgICAgICogYWxsb3cgaXRzIGRhdGEgY29waWVkIHRvIGFueSBjb250YWN0cyBhY2NvdW50LgorICAgICAgICAgKgorICAgICAgICAgKiBAaGlkZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRVhQT1JUX1NVUFBPUlRfQU5ZX0FDQ09VTlQgPSAyOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBfSUQgb2YgdGhlIGRlZmF1bHQgZGlyZWN0b3J5LCB3aGljaCByZXByZXNlbnRzIGxvY2FsbHkgc3RvcmVkIGNvbnRhY3RzLgorICAgICAgICAgKgorICAgICAgICAgKiBAaGlkZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBsb25nIERFRkFVTFQgPSAwOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBfSUQgb2YgdGhlIGRpcmVjdG9yeSB0aGF0IHJlcHJlc2VudHMgbG9jYWxseSBzdG9yZWQgaW52aXNpYmxlIGNvbnRhY3RzLgorICAgICAgICAgKgorICAgICAgICAgKiBAaGlkZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBsb25nIExPQ0FMX0lOVklTSUJMRSA9IDE7CisgICAgfQorCisgICAgLyoqCiAgICAgICogQGhpZGUgc2hvdWxkIGJlIHJlbW92ZWQgd2hlbiB1c2VycyBhcmUgdXBkYXRlZCB0byByZWZlciB0byBTeW5jU3RhdGUKICAgICAgKiBAZGVwcmVjYXRlZCB1c2UgU3luY1N0YXRlIGluc3RlYWQKICAgICAgKi8KQEAgLTQ5MDIsNiArNTEzNCwyMyBAQAogICAgICAgICAgKiBUeXBlOiBJTlRFR0VSIChib29sZWFuKQogICAgICAgICAgKi8KICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU0hPVUxEX1NZTkMgPSAic2hvdWxkX3N5bmMiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBBbnkgbmV3bHkgY3JlYXRlZCBjb250YWN0cyB3aWxsIGF1dG9tYXRpY2FsbHkgYmUgYWRkZWQgdG8gZ3JvdXBzIHRoYXQgaGF2ZSB0aGlzCisgICAgICAgICAqIGZsYWcgc2V0IHRvIHRydWUuCisgICAgICAgICAqIDxwPgorICAgICAgICAgKiBUeXBlOiBJTlRFR0VSIChib29sZWFuKQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQVVUT19BREQgPSAiYXV0b19hZGQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBXaGVuIGEgY29udGFjdHMgaXMgbWFya2VkIGFzIGEgZmF2b3JpdGVzIGl0IHdpbGwgYmUgYXV0b21hdGljYWxseSBhZGRlZAorICAgICAgICAgKiB0byB0aGUgZ3JvdXBzIHRoYXQgaGF2ZSB0aGlzIGZsYWcgc2V0LCBhbmQgd2hlbiBpdCBpcyByZW1vdmVkIGZyb20gZmF2b3JpdGVzCisgICAgICAgICAqIGl0IHdpbGwgYmUgcmVtb3ZlZCBmcm9tIHRoZXNlIGdyb3Vwcy4KKyAgICAgICAgICogPHA+CisgICAgICAgICAqIFR5cGU6IElOVEVHRVIgKGJvb2xlYW4pCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBGQVZPUklURVMgPSAiZmF2b3JpdGVzIjsKICAgICB9CiAKICAgICAvKioKQEAgLTUwNDIsNiArNTI5MSw4IEBACiAgICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5jdXJzb3JMb25nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgdmFsdWVzLCBERUxFVEVEKTsKICAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvclN0cmluZ1RvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIHZhbHVlcywgTk9URVMpOwogICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yU3RyaW5nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgdmFsdWVzLCBTSE9VTERfU1lOQyk7CisgICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5jdXJzb3JTdHJpbmdUb0NvbnRlbnRWYWx1ZXNJZlByZXNlbnQoY3Vyc29yLCB2YWx1ZXMsIEZBVk9SSVRFUyk7CisgICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5jdXJzb3JTdHJpbmdUb0NvbnRlbnRWYWx1ZXNJZlByZXNlbnQoY3Vyc29yLCB2YWx1ZXMsIEFVVE9fQUREKTsKICAgICAgICAgICAgICAgICBjdXJzb3IubW92ZVRvTmV4dCgpOwogICAgICAgICAgICAgICAgIHJldHVybiBuZXcgRW50aXR5KHZhbHVlcyk7CiAgICAgICAgICAgICB9CkBAIC01NTU4LDYgKzU4MDksMjggQEAKICAgICAgICAgICAgICAgICAiY29tLmFuZHJvaWQuY29udGFjdHMuYWN0aW9uLlNIT1dfT1JfQ1JFQVRFX0NPTlRBQ1QiOwogCiAgICAgICAgIC8qKgorICAgICAgICAgKiBTdGFydHMgYW4gQWN0aXZpdHkgdGhhdCBsZXRzIHRoZSB1c2VyIHNlbGVjdCB0aGUgbXVsdGlwbGUgcGhvbmVzIGZyb20gYQorICAgICAgICAgKiBsaXN0IG9mIHBob25lIG51bWJlcnMgd2hpY2ggY29tZSBmcm9tIHRoZSBjb250YWN0cyBvcgorICAgICAgICAgKiB7QGxpbmsgI0VYVFJBX1BIT05FX1VSSVN9LgorICAgICAgICAgKiA8cD4KKyAgICAgICAgICogVGhlIHBob25lIG51bWJlcnMgYmVpbmcgcGFzc2VkIGluIHRocm91Z2gge0BsaW5rICNFWFRSQV9QSE9ORV9VUklTfQorICAgICAgICAgKiBjb3VsZCBiZWxvbmcgdG8gdGhlIGNvbnRhY3RzIG9yIG5vdCwgYW5kIHdpbGwgYmUgc2VsZWN0ZWQgYnkgZGVmYXVsdC4KKyAgICAgICAgICogPHA+CisgICAgICAgICAqIFRoZSB1c2VyJ3Mgc2VsZWN0aW9uIHdpbGwgYmUgcmV0dXJuZWQgZnJvbQorICAgICAgICAgKiB7QGxpbmsgYW5kcm9pZC5hcHAuQWN0aXZpdHkjb25BY3Rpdml0eVJlc3VsdChpbnQsIGludCwgYW5kcm9pZC5jb250ZW50LkludGVudCl9CisgICAgICAgICAqIGlmIHRoZSByZXN1bHRDb2RlIGlzCisgICAgICAgICAqIHtAbGluayBhbmRyb2lkLmFwcC5BY3Rpdml0eSNSRVNVTFRfT0t9LCB0aGUgYXJyYXkgb2YgcGlja2VkIHBob25lCisgICAgICAgICAqIG51bWJlcnMgYXJlIGluIHRoZSBJbnRlbnQncworICAgICAgICAgKiB7QGxpbmsgI0VYVFJBX1BIT05FX1VSSVN9OyBvdGhlcndpc2UsIHRoZQorICAgICAgICAgKiB7QGxpbmsgYW5kcm9pZC5hcHAuQWN0aXZpdHkjUkVTVUxUX0NBTkNFTEVEfSBpcyByZXR1cm5lZCBpZiB0aGUgdXNlcgorICAgICAgICAgKiBsZWZ0IHRoZSBBY3Rpdml0eSB3aXRob3V0IGNoYW5naW5nIHRoZSBzZWxlY3Rpb24uCisgICAgICAgICAqCisgICAgICAgICAqIEBoaWRlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBBQ1RJT05fR0VUX01VTFRJUExFX1BIT05FUyA9CisgICAgICAgICAgICAgICAgImNvbS5hbmRyb2lkLmNvbnRhY3RzLmFjdGlvbi5HRVRfTVVMVElQTEVfUEhPTkVTIjsKKworICAgICAgICAvKioKICAgICAgICAgIC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DsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgbG9uZyBtYWdpYyA9IHRodW1iRmlsZS5nZXRNYWdpYyhvcmlnSWQpOworICAgICAgICAgICAgICAgIGlmIChtYWdpYyAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChraW5kID09IE1JQ1JPX0tJTkQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVbXSBkYXRhID0gbmV3IGJ5dGVbTWluaVRodW1iRmlsZS5CWVRFU19QRVJfTUlOVEhVTUJdOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRodW1iRmlsZS5nZXRNaW5pVGh1bWJGcm9tRmlsZShvcmlnSWQsIGRhdGEpICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaXRtYXAgPSBCaXRtYXBGYWN0b3J5LmRlY29kZUJ5dGVBcnJheShkYXRhLCAwLCBkYXRhLmxlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGJpdG1hcCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgImNvdWxkbid0IGRlY29kZSBieXRlIGFycmF5LiIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICByZXR1cm4gYml0bWFwOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoa2luZCA9PSBNSU5JX0tJTkQpIHsKLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGNvbHVtbiA9IGlzVmlkZW8gPyAidmlkZW9faWQ9IiA6ICJpbWFnZV9pZD0iOwotICAgICAgICAgICAgICAgICAgICBDdXJzb3IgYyA9IG51bGw7Ci0gICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYml0bWFwOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGtpbmQgPT0gTUlOSV9LSU5EKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgY29sdW1uID0gaXNWaWRlbyA/ICJ2aWRlb19pZD0iIDogImltYWdlX2lkPSI7CiAgICAgICAgICAgICAgICAgICAgICAgICBjID0gY3IucXVlcnkoYmFzZVVyaSwgUFJPSkVDVElPTiwgY29sdW1uICsgb3JpZ0lkLCBudWxsLCBudWxsKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjICE9IG51bGwgJiYgYy5tb3ZlVG9GaXJzdCgpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYml0bWFwID0gZ2V0TWluaVRodW1iRnJvbUZpbGUoYywgYmFzZVVyaSwgY3IsIG9wdGlvbnMpOwpAQCAtMzQwLDE3ICszNDEsMTMgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJpdG1hcDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYyAhPSBudWxsKSBjLmNsb3NlKCk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIEN1cnNvciBjID0gbnVsbDsKLSAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgVXJpIGJsb2NraW5nVXJpID0gYmFzZVVyaS5idWlsZFVwb24oKS5hcHBlbmRRdWVyeVBhcmFtZXRlcigiYmxvY2tpbmciLCAiMSIpCiAgICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kUXVlcnlQYXJhbWV0ZXIoIm9yaWdfaWQiLCBTdHJpbmcudmFsdWVPZihvcmlnSWQpKQogICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZFF1ZXJ5UGFyYW1ldGVyKCJncm91cF9pZCIsIFN0cmluZy52YWx1ZU9mKGdyb3VwSWQpKS5idWlsZCgpOworICAgICAgICAgICAgICAgIGlmIChjICE9IG51bGwpIGMuY2xvc2UoKTsKICAgICAgICAgICAgICAgICBjID0gY3IucXVlcnkoYmxvY2tpbmdVcmksIFBST0pFQ1RJT04sIG51bGwsIG51bGwsIG51bGwpOwogICAgICAgICAgICAgICAgIC8vIFRoaXMgaGFwcGVucyB3aGVuIG9yaWdpbmFsIGltYWdlL3ZpZGVvIGRvZXNuJ3QgZXhpc3QuCiAgICAgICAgICAgICAgICAgaWYgKGMgPT0gbnVsbCkgcmV0dXJuIG51bGw7CkBAIC0zOTcsNiArMzk0LDkgQEAKICAgICAgICAgICAgICAgICBMb2cudyhUQUcsIGV4KTsKICAgICAgICAgICAgIH0gZmluYWxseSB7CiAgICAgICAgICAgICAgICAgaWYgKGMgIT0gbnVsbCkgYy5jbG9zZSgpOworICAgICAgICAgICAgICAgIC8vIFRvIGF2b2lkIGZpbGUgZGVzY3JpcHRvciBsZWFrIGluIGFwcGxpY2F0aW9uIHByb2Nlc3MuCisgICAgICAgICAgICAgICAgdGh1bWJGaWxlLmRlYWN0aXZhdGUoKTsKKyAgICAgICAgICAgICAgICB0aHVtYkZpbGUgPSBudWxsOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgcmV0dXJuIGJpdG1hcDsKICAgICAgICAgfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvcHJvdmlkZXIvTXRwLmphdmEgYi9jb3JlL2phdmEvYW5kcm9pZC9wcm92aWRlci9NdHAuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4xNWY4NjY2Ci0tLSAvZGV2L251bGwKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvcHJvdmlkZXIvTXRwLmphdmEKQEAgLTAsMCArMSwzMzUgQEAKKy8qCisgKiBDb3B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mljZXMuCisgKiBAaGlkZQorICovCitwdWJsaWMgZmluYWwgY2xhc3MgTXRwCit7CisgICAgcHJpdmF0ZSBmaW5hbCBzdGF0aWMgU3RyaW5nIFRBRyA9ICJNdHAiOworCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQVVUSE9SSVRZID0gIm10cCI7CisKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBTdHJpbmcgQ09OVEVOVF9BVVRIT1JJVFlfU0xBU0ggPSAiY29udGVudDovLyIgKyBBVVRIT1JJVFkgKyAiLyI7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3RyaW5nIENPTlRFTlRfQVVUSE9SSVRZX0RFVklDRV9TTEFTSCA9ICJjb250ZW50Oi8vIiArIEFVVEhPUklUWSArICIvZGV2aWNlLyI7CisKKyAgICAvKioKKyAgICAgKiBDb250YWlucyBsaXN0IG9mIGFsbCBNVFAvUFRQIGRldmljZXMKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIERldmljZSBpbXBsZW1lbnRzIEJhc2VDb2x1bW5zIHsKKworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFVyaSBDT05URU5UX1VSSSA9IFVyaS5wYXJzZShDT05URU5UX0FVVEhPUklUWV9TTEFTSCArICJkZXZpY2UiKTsKKworICAgICAgICBwdWJsaWMgc3RhdGljIFVyaSBnZXRDb250ZW50VXJpKGludCBkZXZpY2VJRCkgeworICAgICAgICAgICAgcmV0dXJuIFVyaS5wYXJzZShDT05URU5UX0FVVEhPUklUWV9ERVZJQ0VfU0xBU0ggKyBkZXZpY2VJRCk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIG1hbnVmYWN0dXJlciBvZiB0aGUgZGV2aWNlCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBNQU5VRkFDVFVSRVIgPSAibWFudWZhY3R1cmVyIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIG1vZGVsIG5hbWUgb2YgdGhlIGRldmljZQorICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgTU9ERUwgPSAibW9kZWwiOworICAgIH0KKworICAgIC8qKgorICAgICAqIENvbnRhaW5zIGxpc3Qgb2Ygc3RvcmFnZSB1bml0cyBmb3IgYW4gTVRQL1BUUCBkZXZpY2UKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIFN0b3JhZ2UgaW1wbGVtZW50cyBCYXNlQ29sdW1ucyB7CisKKyAgICAgICAgcHVibGljIHN0YXRpYyBVcmkgZ2V0Q29udGVudFVyaShpbnQgZGV2aWNlSUQpIHsKKyAgICAgICAgICAgIHJldHVybiBVcmkucGFyc2UoQ09OVEVOVF9BVVRIT1JJVFlfREVWSUNFX1NMQVNIICsgZGV2aWNlSUQgKyAiL3N0b3JhZ2UiKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBzdGF0aWMgVXJpIGdldENvbnRlbnRVcmkoaW50IGRldmljZUlELCBpbnQgc3RvcmFnZUlEKSB7CisgICAgICAgICAgICByZXR1cm4gVXJpLnBhcnNlKENPTlRFTlRfQVVUSE9SSVRZX0RFVklDRV9TTEFTSCArIGRldmljZUlEICsgIi9zdG9yYWdlLyIgKyBzdG9yYWdlSUQpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFN0b3JhZ2UgdW5pdCBpZGVudGlmaWVyCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBJREVOVElGSUVSID0gImlkZW50aWZpZXIiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBTdG9yYWdlIHVuaXQgZGVzY3JpcHRpb24KKyAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERFU0NSSVBUSU9OID0gImRlc2NyaXB0aW9uIjsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDb250YWlucyBsaXN0IG9mIG9iamVjdHMgb24gYW4gTVRQL1BUUCBkZXZpY2UKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIE9iamVjdCBpbXBsZW1lbnRzIEJhc2VDb2x1bW5zIHsKKworICAgICAgICBwdWJsaWMgc3RhdGljIFVyaSBnZXRDb250ZW50VXJpKGludCBkZXZpY2VJRCwgaW50IG9iamVjdElEKSB7CisgICAgICAgICAgICByZXR1cm4gVXJpLnBhcnNlKENPTlRFTlRfQVVUSE9SSVRZX0RFVklDRV9TTEFTSCArIGRldmljZUlECisgICAgICAgICAgICAgICAgICAgICsgIi9vYmplY3QvIiArIG9iamVjdElEKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBzdGF0aWMgVXJpIGdldENvbnRlbnRVcmlGb3JPYmplY3RDaGlsZHJlbihpbnQgZGV2aWNlSUQsIGludCBvYmplY3RJRCkgeworICAgICAgICAgICAgcmV0dXJuIFVyaS5wYXJzZShDT05URU5UX0FVVEhPUklUWV9ERVZJQ0VfU0xBU0ggKyBkZXZpY2VJRAorICAgICAgICAgICAgICAgICAgICArICIvb2JqZWN0LyIgKyBvYmplY3RJRCArICIvY2hpbGQiKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBzdGF0aWMgVXJpIGdldENvbnRlbnRVcmlGb3JTdG9yYWdlQ2hpbGRyZW4oaW50IGRldmljZUlELCBpbnQgc3RvcmFnZUlEKSB7CisgICAgICAgICAgICByZXR1cm4gVXJpLnBhcnNlKENPTlRFTlRfQVVUSE9SSVRZX0RFVklDRV9TTEFTSCArIGRldmljZUlECisgICAgICAgICAgICAgICAgICAgICsgIi9zdG9yYWdlLyIgKyBzdG9yYWdlSUQgKyAiL2NoaWxkIik7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGZvbGxvd2luZyBjb2x1bW5zIGNvcnJlc3BvbmQgdG8gdGhlIGZpZWxkcyBpbiB0aGUgT2JqZWN0SW5mbyBkYXRhc2V0CisgICAgICAgICAqIGFzIGRlc2NyaWJlZCBpbiB0aGUgTVRQIHNwZWNpZmljYXRpb24uCisgICAgICAgICAqLworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgSUQgb2YgdGhlIHN0b3JhZ2UgdW5pdCBjb250YWluaW5nIHRoZSBvYmplY3QuCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBTVE9SQUdFX0lEID0gInN0b3JhZ2VfaWQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgb2JqZWN0J3MgZm9ybWF0LiAgQ2FuIGJlIG9uZSBvZiB0aGUgRk9STUFUXyogc3ltYm9scyBiZWxvdywKKyAgICAgICAgICogb3IgYW55IG9mIHRoZSB2YWxpZCBNVFAgb2JqZWN0IGZvcm1hdHMgYXMgZGVmaW5lZCBpbiB0aGUgTVRQIHNwZWNpZmljYXRpb24uCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBGT1JNQVQgPSAiZm9ybWF0IjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIHByb3RlY3Rpb24gc3RhdHVzIG9mIHRoZSBvYmplY3QuICBTZWUgdGhlIFBST1RFQ1RJT05fU1RBVFVTXypzeW1ib2xzIGJlbG93LgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUFJPVEVDVElPTl9TVEFUVVMgPSAicHJvdGVjdGlvbl9zdGF0dXMiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgc2l6ZSBvZiB0aGUgb2JqZWN0IGluIGJ5dGVzLgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU0laRSA9ICJzaXplIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIG9iamVjdCdzIHRodW1ibmFpbCBmb3JtYXQuICBDYW4gYmUgb25lIG9mIHRoZSBGT1JNQVRfKiBzeW1ib2xzIGJlbG93LAorICAgICAgICAgKiBvciBhbnkgb2YgdGhlIHZhbGlkIE1UUCBvYmplY3QgZm9ybWF0cyBhcyBkZWZpbmVkIGluIHRoZSBNVFAgc3BlY2lmaWNhdGlvbi4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFRIVU1CX0ZPUk1BVCA9ICJmb3JtYXQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgc2l6ZSBvZiB0aGUgb2JqZWN0J3MgdGh1bWJuYWlsIGluIGJ5dGVzLgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEhVTUJfU0laRSA9ICJ0aHVtYl9zaXplIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIHdpZHRoIG9mIHRoZSBvYmplY3QncyB0aHVtYm5haWwgaW4gcGl4ZWxzLgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEhVTUJfV0lEVEggPSAidGh1bWJfd2lkdGgiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgaGVpZ2h0IG9mIHRoZSBvYmplY3QncyB0aHVtYm5haWwgaW4gcGl4ZWxzLgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEhVTUJfSEVJR0hUID0gInRodW1iX2hlaWdodCI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBvYmplY3QncyB0aHVtYm5haWwuCisgICAgICAgICAqIDxQPlR5cGU6IEJMT0I8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBUSFVNQiA9ICJ0aHVtYiI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSB3aWR0aCBvZiB0aGUgb2JqZWN0IGluIHBpeGVscy4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIElNQUdFX1dJRFRIID0gImltYWdlX3dpZHRoIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGhlaWdodCBvZiB0aGUgb2JqZWN0IGluIHBpeGVscy4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIElNQUdFX0hFSUdIVCA9ICJpbWFnZV9oZWlnaHQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgZGVwdGggb2YgdGhlIG9iamVjdCBpbiBiaXRzIHBlciBwaXhlbC4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIElNQUdFX0RFUFRIID0gImltYWdlX2RlcHRoIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIElEIG9mIHRoZSBvYmplY3QncyBwYXJlbnQsIG9yIHplcm8gaWYgdGhlIG9iamVjdAorICAgICAgICAgKiBpcyBpbiB0aGUgcm9vdCBvZiBpdHMgc3RvcmFnZSB1bml0LgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUEFSRU5UID0gInBhcmVudCI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBhc3NvY2lhdGlvbiB0eXBlIGZvciBhIGNvbnRhaW5lciBvYmplY3QuCisgICAgICAgICAqIEZvciBmb2xkZXJzIHRoaXMgaXMgdHlwaWNhbGx5IHtAbGluayAjQVNTT0NJQVRJT05fVFlQRV9HRU5FUklDX0ZPTERFUn0KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEFTU09DSUFUSU9OX1RZUEUgPSAiYXNzb2NpYXRpb25fdHlwZSI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIENvbnRhaW5zIGFkZGl0aW9uYWwgaW5mb3JtYXRpb24gYWJvdXQgY29udGFpbmVyIG9iamVjdHMuCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBBU1NPQ0lBVElPTl9ERVNDID0gImFzc29jaWF0aW9uX2Rlc2MiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgc2VxdWVuY2UgbnVtYmVyIG9mIHRoZSBvYmplY3QsIHR5cGljYWxseSB1c2VkIGZvciBhbiBhc3NvY2lhdGlvbgorICAgICAgICAgKiBjb250YWluaW5nIGltYWdlcyB0YWtlbiBpbiBzZXF1ZW5jZS4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFNFUVVFTkNFX05VTUJFUiA9ICJzZXF1ZW5jZV9udW1iZXIiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgbmFtZSBvZiB0aGUgb2JqZWN0LgorICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgTkFNRSA9ICJuYW1lIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGRhdGUgdGhlIG9iamVjdCB3YXMgY3JlYXRlZCwgaW4gc2Vjb25kcyBzaW5jZSBKYW51YXJ5IDEsIDE5NzAuCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBEQVRFX0NSRUFURUQgPSAiZGF0ZV9jcmVhdGVkIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGRhdGUgdGhlIG9iamVjdCB3YXMgbGFzdCBtb2RpZmllZCwgaW4gc2Vjb25kcyBzaW5jZSBKYW51YXJ5IDEsIDE5NzAuCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBEQVRFX01PRElGSUVEID0gImRhdGVfbW9kaWZpZWQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBBIGxpc3Qgb2Yga2V5d29yZHMgYXNzb2NpYXRlZCB3aXRoIGFuIG9iamVjdCwgc2VwYXJhdGVkIGJ5IHNwYWNlcy4KKyAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEtFWVdPUkRTID0gImtleXdvcmRzIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogQ29udGFudHMgZm9yIHtAbGluayAjRk9STUFUfSBhbmQge0BsaW5rICNUSFVNQl9GT1JNQVR9CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfVU5ERUZJTkVEID0gMHgzMDAwOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfQVNTT0NJQVRJT04gPSAweDMwMDE7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9TQ1JJUFQgPSAweDMwMDI7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9FWEVDVVRBQkxFID0gMHgzMDAzOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfVEVYVCA9IDB4MzAwNDsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX0hUTUwgPSAweDMwMDU7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9EUE9GID0gMHgzMDA2OworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfQUlGRiA9IDB4MzAwNzsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX1dBViA9IDB4MzAwODsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX01QMyA9IDB4MzAwOTsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX0FWSSA9IDB4MzAwQTsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX01QRUcgPSAweDMwMEI7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9BU0YgPSAweDMwMEM7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9ERUZJTkVEID0gMHgzODAwOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfRVhJRl9KUEVHID0gMHgzODAxOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfVElGRl9FUCA9IDB4MzgwMjsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX0ZMQVNIUElYID0gMHgzODAzOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfQk1QID0gMHgzODA0OworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfQ0lGRiA9IDB4MzgwNTsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX0dJRiA9IDB4MzgwNzsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX0pGSUYgPSAweDM4MDg7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9DRCA9IDB4MzgwOTsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX1BJQ1QgPSAweDM4MEE7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9QTkcgPSAweDM4MEI7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9USUZGID0gMHgzODBEOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfVElGRl9JVCA9IDB4MzgwRTsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX0pQMiA9IDB4MzgwRjsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX0pQWCA9IDB4MzgxMDsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX1VOREVGSU5FRF9GSVJNV0FSRSA9IDB4QjgwMjsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX1dJTkRPV1NfSU1BR0VfRk9STUFUID0gMHhCODgxOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfVU5ERUZJTkVEX0FVRElPID0gMHhCOTAwOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfV01BID0gMHhCOTAxOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfT0dHID0gMHhCOTAyOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfQUFDID0gMHhCOTAzOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfQVVESUJMRSA9IDB4QjkwNDsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX0ZMQUMgPSAweEI5MDY7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9VTkRFRklORURfVklERU8gPSAweEI5ODA7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9XTVYgPSAweEI5ODE7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9NUDRfQ09OVEFJTkVSID0gMHhCOTgyOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfTVAyID0gMHhCOTgzOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfM0dQX0NPTlRBSU5FUiA9IDB4Qjk4NDsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5h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UFDQVNUID0gMHhCQTBCOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfV1BMX1BMQVlMSVNUID0gMHhCQTEwOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfTTNVX1BMQVlMSVNUID0gMHhCQTExOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfTVBMX1BMQVlMSVNUID0gMHhCQTEyOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfQVNYX1BMQVlMSVNUID0gMHhCQTEzOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfUExTX1BMQVlMSVNUID0gMHhCQTE0OworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfVU5ERUZJTkVEX0RPQ1VNRU5UID0gMHhCQTgwOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfQUJTVFJBQ1RfRE9DVU1FTlQgPSAweEJBODE7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9YTUxfRE9DVU1FTlQgPSAweEJBODI7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9NU19XT1JEX0RPQ1VNRU5UID0gMHhCQTgzOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfTUhUX0NPTVBJTEVEX0hUTUxfRE9DVU1FTlQgPSAweEJBODQ7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9NU19FWENFTF9TUFJFQURTSEVFVCA9IDB4QkE4NTsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX01TX1BPV0VSUE9JTlRfUFJFU0VOVEFUSU9OID0gMHhCQTg2OworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfVU5ERUZJTkVEX01FU1NBR0UgPSAweEJCMDA7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9BQlNUUkFDVF9NRVNTU0FHRSA9IDB4QkIwMTsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX1VOREVGSU5FRF9DT05UQUNUID0gMHhCQjgwOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfQUJTVFJBQ1RfQ09OVEFDVCA9IDB4QkI4MTsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX1ZDQVJEXzIgPSAweEJCODI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIE9iamVjdCBpcyBub3QgcHJvdGVjdGVkLiBJdCBtYXkgYmUgbW9kaWZpZWQgYW5kIGRlbGV0ZWQsIGFuZCBpdHMgcHJvcGVydGllcworICAgICAgICAgKiBtYXkgYmUgbW9kaWZpZWQuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBQUk9URUNUSU9OX1NUQVRVU19OT05FID0gMDsKKworICAgICAgICAvKioKKyAgICAgICAgICogT2JqZWN0IGNhbiBub3QgYmUgbW9kaWZpZWQgb3IgZGVsZXRlZCBhbmQgaXRzIHByb3BlcnRpZXMgY2FuIG5vdCBiZSBtb2RpZmllZC4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFBST1RFQ1RJT05fU1RBVFVTX1JFQURfT05MWSA9IDB4ODAwMTsKKworICAgICAgICAvKioKKyAgICAgICAgICogT2JqZWN0IGNhbiBub3QgYmUgbW9kaWZpZWQgb3IgZGVsZXRlZCBidXQgaXRzIHByb3BlcnRpZXMgYXJlIG1vZGlmaWFibGUuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBQUk9URUNUSU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cmF0aW9uQ2hhbmdlcyhpbnQgY2hhbmdlcykgewogICAgICAgICAgICAgcmV0dXJuIChjaGFuZ2VzJkFjdGl2aXR5SW5mby5DT05GSUdfRk9OVF9TQ0FMRSkgIT0gMDsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBwdWJsaWMgc3RhdGljIGJvb2xlYW4gZ2V0U2hvd0dUYWxrU2VydmljZVN0YXR1cyhDb250ZW50UmVzb2x2ZXIgY3IpIHsKICAgICAgICAgICAgIHJldHVybiBnZXRJbnQoY3IsIFNIT1dfR1RBTEtfU0VSVklDRV9TVEFUVVMsIDApICE9IDA7CiAgICAgICAgIH0KQEAgLTEyMTYsNyArMTIwOCw3IEBACiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIExPQ0tfUEFUVEVSTl9WSVNJQkxFID0gImxvY2tfcGF0dGVybl92aXNpYmxlX3BhdHRlcm4iOwogCiAgICAgICAgIC8qKgotICAgICAgICAgKiBAZGVwcmVjYXRlZCBVc2UgCisgICAgICAgICAqIEBkZXByZWNhdGVkIFVzZQogICAgICAgICAgKiB7QGxpbmsgYW5kcm9pZC5wcm92aWRlci5TZXR0aW5ncy5TZWN1cmUjTE9DS19QQVRURVJOX1RBQ1RJTEVfRkVFREJBQ0tfRU5BQkxFRH0KICAgICAgICAgICogaW5zdGVhZAogICAgICAgICAgKi8KQEAgLTIyOTAsNiArMjI4MiwxNCBAQAogICAgICAgICB9CiAKICAgICAgICAgLyoqCisgICAgICAgICAqIEdldCB0aGUga2V5IHRoYXQgcmV0cmlldmVzIGEgYmx1ZXRvb3RoIElucHV0IERldmljZSdzIHByaW9yaXR5LgorICAgICAgICAgKiBAaGlkZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgZ2V0Qmx1ZXRvb3RoSW5wdXREZXZpY2VQcmlvcml0eUtleShTdHJpbmcgYWRkcmVzcykgeworICAgICAgICAgICAgcmV0dXJuIC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gICAgICogYW5kIG5ldyBTZXR0aW5ncyBhcHBzLgpAQCAtMzU3MywyMCArMzU4MSw4IEBACiAgICAgICAgICAgICAvLyBJZiBhIHNob3J0Y3V0IGlzIHN1cHBsaWVkLCBhbmQgaXQgaXMgYWxyZWFkeSBkZWZpbmVkIGZvcgogICAgICAgICAgICAgLy8gYW5vdGhlciBib29rbWFyaywgdGhlbiByZW1vdmUgdGhlIG9sZCBkZWZpbml0aW9uLgogICAgICAgICAgICAgaWYgKHNob3J0Y3V0ICE9IDApIHsKLSAgICAgICAgICAgICAgICBDdXJzb3IgYyA9IGNyLnF1ZXJ5KENPTlRFTlRfVVJJLAotICAgICAgICAgICAgICAgICAgICAgICAgc1Nob3J0Y3V0UHJvamVjdGlvbiwgc1Nob3J0Y3V0U2VsZWN0aW9uLAotICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFN0cmluZ1tdIHsgU3RyaW5nLnZhbHVlT2YoKGludCkgc2hvcnRjdXQpIH0sIG51bGwpOwotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChjLm1vdmVUb0ZpcnN0KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChjLmdldENvdW50KCkgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFjLmRlbGV0ZVJvdygpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkNvdWxkIG5vdCBkZWxldGUgZXhpc3Rpbmcgc2hvcnRjdXQgcm93Iik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGMgIT0gbnVsbCkgYy5jbG9zZSgpOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB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rpc3QodXVpZCkpICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAhaXNPdGhlclNpbmtJbk5vbkRpc2Nvbm5lY3RpbmdTdGF0ZShhZGRyZXNzKSkgewotICAgICAgICAgICAgQmx1ZXRvb3RoRGV2aWNlIGRldmljZSA9IG1BZGFwdGVyLmdldFJlbW90ZURldmljZShhZGRyZXNzKTsKKyAgICAgICAgaWYgKChCbHVldG9vdGhVdWlkLmlzQXVkaW9Tb3VyY2UodXVpZCkgfHwgQmx1ZXRvb3RoVXVpZC5pc0F2cmNwVGFyZ2V0KHV1aWQpCisgICAgICAgICAgICAgIHx8IEJsdWV0b290aFV1aWQuaXNBZHZBdWRpb0Rpc3QodXVpZCkpICYmCisgICAgICAgICAgICAgICFpc090aGVyU2lua0luTm9uRGlzY29ubmVjdGluZ1N0YXRlKGFkZHJlc3MpKSB7CisgICAgICAgICAgICBCbHVldG9vdGhBMmRwIGEyZHAgPSBuZXcgQmx1ZXRvb3RoQTJkcChtQ29udGV4dCk7CisKICAgICAgICAgICAgIGF1dGhvcml6ZWQgPSBhMmRwLmdldFNpbmtQcmlvcml0eShkZXZpY2UpID4gQmx1ZXRvb3RoQTJkcC5QUklPUklUWV9PRkY7CiAgICAgICAgICAgICBpZiAoYXV0aG9yaXplZCkgewogICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIkFsbG93aW5nIGluY29taW5nIEEyRFAgLyBBVlJDUCBjb25uZWN0aW9uIGZyb20gIiArIGFkZHJlc3MpOwpAQCAtNTk3LDYgKzYxNCwxNSBAQAogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJSZWplY3RpbmcgaW5jb21pbmcgQTJEUCAvIEFWUkNQIGNvbm5lY3Rpb24gZnJvbSAiICsgYWRkcmVzcyk7CiAgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSBpZiAoQmx1ZXRvb3RoVXVpZC5pc0lucHV0RGV2aWNlKHV1aWQpICYmICFpc090aGVySW5wdXREZXZpY2VDb25uZWN0ZWQoYWRkcmVzcykpIHsKKyAgICAgICAgICAgIEJsdWV0b290aElucHV0RGV2aWNlIGlucHV0RGV2aWNlID0gbmV3IEJsdWV0b290aElucHV0RGV2aWNlKG1Db250ZXh0KTsKKyAgICAgICAgICAgIGF1dGhvcml6ZWQgPSBpbnB1dERldmljZS5nZXRJbnB1dERldmljZVByaW9yaXR5KGRldmljZSkgPgorICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aElucHV0RGV2aWNlLlBSSU9SSVRZX09GRjsKKyAgICAgICAgICAgICBpZiAoYXV0aG9yaXplZCkgeworICAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJBbGxvd2luZyBpbmNvbWluZyBISUQgY29ubmVjdGlvbiBmcm9tICIgKyBhZGRyZXNzKTsKKyAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJSZWplY3RpbmcgaW5jb21pbmcgSElEIGNvbm5lY3Rpb24gZnJvbSAiICsgYWRkcmVzcyk7CisgICAgICAgICAgICAgfQogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgTG9nLmkoVEFHLCAiUmVqZWN0aW5nIGluY29taW5nICIgKyBkZXZpY2VVdWlkICsgIiBjb25uZWN0aW9uIGZyb20gIiArIGFkZHJlc3MpOwogICAgICAgICB9CkBAIC02MDQsNyArNjMwLDE5IEBACiAgICAgICAgIHJldHVybiBhdXRob3JpemVkOwogICAgIH0KIAotICAgIGJvb2xlYW4gaXNPdGhlclNpbmtJbk5vbkRpc2Nvbm5lY3RpbmdTdGF0ZShTdHJpbmcgYWRkcmVzcykgeworICAgIHByaXZhdGUgYm9vbGVhbiBpc090aGVySW5wdXREZXZpY2VDb25uZWN0ZWQoU3RyaW5nIGFkZHJlc3MpIHsKKyAgICAgICAgU2V0PEJsdWV0b290aERldmljZT4gZGV2aWNlcyA9CisgICAgICAgICAgICBtQmx1ZXRvb3RoU2VydmljZS5sb29rdXBJbnB1dERldmljZXNNYXRjaGluZ1N0YXRlcyhuZXcgaW50W10geworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoSW5wdXREZXZpY2UuU1RBVEVfQ09OTkVDVElORywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aElucHV0RGV2aWNlLlNUQVRFX0NPTk5FQ1RFRH0pOworCisgICAgICAgIGZvciAoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSA6IGRldmljZXMpIHsKKyAgICAgICAgICAgIGlmICghZGV2aWNlLmdldEFkZHJlc3MoKS5lcXVhbHMoYWRkcmVzcykpIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBwcml2YXRlIGJvb2xlYW4gaXNPdGhlclNpbmtJbk5vbkRpc2Nvbm5lY3RpbmdTdGF0ZShTdHJpbmcgYWRkcmVzcykgewogICAgICAgICBCbHVldG9vdGhBMmRwIGEyZHAgPSBuZXcgQmx1ZXRvb3RoQTJkcChtQ29udGV4dCk7CiAgICAgICAgIFNldDxCbHVldG9vdGhEZXZpY2U+IGRldmljZXMgPSBhMmRwLmdldE5vbkRpc2Nvbm5lY3RlZFNpbmtzKCk7CiAgICAgICAgIGlmIChkZXZpY2VzLnNpemUoKSA9PSAwKSByZXR1cm4gZmFsc2U7CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9zZXJ2ZXIvQmx1ZXRvb3RoU2VydmljZS5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvc2VydmVyL0JsdWV0b290aFNlcnZpY2UuamF2YQppbmRleCAzMWU1YTdiLi5lYzk5YjBkIDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC9zZXJ2ZXIvQmx1ZXRvb3RoU2VydmljZS5qYXZhCisrKyBiL2NvcmUvamF2YS9hbmRyb2lkL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BZGRyZXNzKCkgewpAQCAtMTIyMCw2ICsxMjI4LDEyNyBAQAogICAgICAgICByZXR1cm4gc3AuY29udGFpbnMoU0hBUkVEX1BSRUZFUkVOQ0VfRE9DS19BRERSRVNTICsgYWRkcmVzcyk7CiAgICAgfQogCisgICAgcHVibGljIHN5bmNocm9uaXplZCBib29sZWFuIGNvbm5lY3RJbnB1dERldmljZShCbHVldG9vdGhEZXZpY2UgZGV2aWNlKSB7CisgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbihCTFVFVE9PVEhfQURNSU5fUEVSTSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOZWVkIEJMVUVUT09USF9BRE1JTiBwZXJtaXNzaW9uIik7CisKKyAgICAgICAgU3RyaW5nIG9iamVjdFBhdGggPSBnZXRPYmplY3RQYXRoRnJvbUFkZHJlc3MoZGV2aWNlLmdldEFkZHJlc3MoKSk7CisgICAgICAgIGlmIChvYmplY3RQYXRoID09IG51bGwgfHwgZ2V0Q29ubmVjdGVkSW5wdXREZXZpY2VzKCkubGVuZ3RoICE9IDAgfHwKKyAgICAgICAgICAgIGdldElucHV0RGV2aWNlUHJpb3JpdHkoZGV2aWNlKSA9PSBCbHVldG9vdGhJbnB1dERldmljZS5QUklPUklUWV9PRkYpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICBpZihjb25uZWN0SW5wdXREZXZpY2VOYXRpdmUob2JqZWN0UGF0aCkpIHsKKyAgICAgICAgICAgIGhhbmRsZUlucHV0RGV2aWNlU3RhdGVDaGFuZ2UoZGV2aWNlLCBCbHVldG9vdGhJbnB1dERldmljZS5TVEFURV9DT05ORUNUSU5HKTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIGJvb2xlYW4gZGlzY29ubmVjdElucHV0RGV2aWNlKEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKEJMVUVUT09USF9BRE1JTl9QRVJNLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIk5lZWQgQkxVRVRPT1RIX0FETUlOIHBlcm1pc3Npb24iKTsKKworICAgICAgICBTdHJpbmcgb2JqZWN0UGF0aCA9IGdldE9iamVjdFBhdGhGcm9tQWRkcmVzcyhkZXZpY2UuZ2V0QWRkcmVzcygpKTsKKyAgICAgICAgaWYgKG9iamVjdFBhdGggPT0gbnVsbCB8fCBnZXRDb25uZWN0ZWRJbnB1dERldmljZXMoKS5sZW5ndGggPT0gMCkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICAgIGlmKGRpc2Nvbm5lY3RJbnB1dERldmljZU5hdGl2ZShvYmplY3RQYXRoKSkgeworICAgICAgICAgICAgaGFuZGxlSW5wdXREZXZpY2VTdGF0ZUNoYW5nZShkZXZpY2UsIEJsdWV0b290aElucHV0RGV2aWNlLlNUQVRFX0RJU0NPTk5FQ1RJTkcpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgaW50IGdldElucHV0RGV2aWNlU3RhdGUoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgeworICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oQkxVRVRPT1RIX1BFUk0sICJOZWVkIEJMVUVUT09USCBwZXJtaXNzaW9uIik7CisKKyAgICAgICAgaWYgKG1JbnB1dERldmljZXMuZ2V0KGRldmljZSkgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aElucHV0RGV2aWNlLlNUQVRFX0RJU0NPTk5FQ1RFRDsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbUlucHV0RGV2aWNlcy5nZXQoZGV2aWNlKTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIEJsdWV0b290aERldmljZVtdIGdldENvbm5lY3RlZElucHV0RGV2aWNlcygpIHsKKyAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKEJMVUVUT09USF9QRVJNLCAiTmVlZCBCTFVFVE9PVEggcGVybWlzc2lvbiIpOworICAgICAgICBTZXQ8Qmx1ZXRvb3RoRGV2aWNlPiBkZXZpY2VzID0gbG9va3VwSW5wdXREZXZpY2VzTWF0Y2hpbmdTdGF0ZXMoCisgICAgICAgICAgICBuZXcgaW50W10ge0JsdWV0b290aElucHV0RGV2aWNlLlNUQVRFX0NPTk5FQ1RFRH0pOworICAgICAgICByZXR1cm4gZGV2aWNlcy50b0FycmF5KG5ldyBCbHVldG9vdGhEZXZpY2VbZGV2aWNlcy5zaXplKCldKTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIGludCBnZXRJbnB1dERldmljZVByaW9yaXR5KEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKEJMVUVUT09USF9QRVJNLCAiTmVlZCBCTFVFVE9PVEggcGVybWlzc2lvbiIpOworICAgICAgICByZXR1cm4gU2V0dGluZ3MuU2VjdXJlLmdldEludChtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKKyAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuZ2V0Qmx1ZXRvb3RoSW5wdXREZXZpY2VQcmlvcml0eUtleShkZXZpY2UuZ2V0QWRkcmVzcygpKSwKKyAgICAgICAgICAgICAgICBCbHVldG9vdGhJbnB1dERldmljZS5QUklPUklUWV9VTkRFRklORUQpOworICAgIH0KKworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgYm9vbGVhbiBzZXRJbnB1dERldmljZVByaW9yaXR5KEJsdWV0b290aERldmljZSBkZXZpY2UsIGludCBwcmlvcml0eSkgeworICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oQkxVRVRPT1RIX0FETUlOX1BFUk0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTmVlZCBCTFVFVE9PVEhfQURNSU4gcGVybWlzc2lvbiIpOworICAgICAgICBpZiAoIUJsdWV0b290aEFkYXB0ZXIuY2hlY2tCbHVldG9vdGhBZGRyZXNzKGRldmljZS5nZXRBZGRyZXNzKCkpKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIFNldHRpbmdzLlNlY3VyZS5wdXRJbnQobUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCksCisgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLmdldEJsdWV0b290aElucHV0RGV2aWNlUHJpb3JpdHlLZXkoZGV2aWNlLmdldEFkZHJlc3MoKSksCisgICAgICAgICAgICAgICAgcHJpb3JpdHkpOworICAgIH0KKworICAgIC8qcGFja2FnZSovc3luY2hyb25pemVkIFNldDxCbHVldG9vdGhEZXZpY2U+IGxvb2t1cElucHV0RGV2aWNlc01hdGNoaW5nU3RhdGVzKGludFtdIHN0YXRlcykgeworICAgICAgICBTZXQ8Qmx1ZXRvb3RoRGV2aWNlPiBpbnB1dERldmljZXMgPSBuZXcgSGFzaFNldDxCbHVldG9vdGhEZXZpY2U+KCk7CisgICAgICAgIGlmIChtSW5wdXREZXZpY2VzLmlzRW1wdHkoKSkgeworICAgICAgICAgICAgcmV0dXJuIGlucHV0RGV2aWNlczsKKyAgICAgICAgfQorICAgICAgICBmb3IgKEJsdWV0b290aERldmljZSBkZXZpY2U6IG1JbnB1dERldmljZXMua2V5U2V0KCkpIHsKKyAgICAgICAgICAgIGludCBpbnB1dERldmljZVN0YXRlID0gZ2V0SW5wdXREZXZpY2VTdGF0ZShkZXZpY2UpOworICAgICAgICAgICAgZm9yIChpbnQgc3RhdGUgOiBzdGF0ZXMpIHsKKyAgICAgICAgICAgICAgICBpZiAoc3RhdGUgPT0gaW5wdXREZXZpY2VTdGF0ZSkgeworICAgICAgICAgICAgICAgICAgICBpbnB1dERldmljZXMuYWRkKGRldmljZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gaW5wdXREZXZpY2VzOworICAgIH0KKworICAgIHByaXZhdGUgc3luY2hyb25pemVkIHZvaWQgaGFuZGxlSW5wdXREZXZpY2VTdGF0ZUNoYW5nZShCbHVldG9vdGhEZXZpY2UgZGV2aWNlLCBpbnQgc3RhdGUpIHsKKyAgICAgICAgaW50IHByZXZTdGF0ZTsKKyAgICAgICAgaWYgKG1JbnB1dERldmljZXMuZ2V0KGRldmljZSkgPT0gbnVsbCkgeworICAgICAgICAgICAgcHJldlN0YXRlID0gQmx1ZXRvb3RoSW5wdXREZXZpY2UuU1RBVEVfRElTQ09OTkVDVEVEOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcHJldlN0YXRlID0gbUlucHV0RGV2aWNlcy5nZXQoZGV2aWNlKTsKKyAgICAgICAgfQorICAgICAgICBpZiAocHJldlN0YXRlID09IHN0YXRlKSByZXR1cm47CisKKyAgICAgICAgbUlucHV0RGV2aWNlcy5wdXQoZGV2aWNlLCBzdGF0ZSk7CisKKyAgICAgICAgaWYgKGdldElucHV0RGV2aWNlUHJpb3JpdHkoZGV2aWNlKSA+CisgICAgICAgICAgICAgIEJsdWV0b290aElucHV0RGV2aWNlLlBSSU9SSVRZX09GRi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YXJzIHRoZSBjaGFyYWN0ZXIgYXJyYXkgKHVzZWQgdG8gZGV0ZXJtaW5lIHdoaXRlc3BhY2UpCisgICAgICogQHBhcmFtIGNzdGFydCB0aGUgc3RhcnQgb2YgdGhlIGxpbmUgaW4gdGhlIGNoYXJzIGFycmF5CisgICAgICogQHBhcmFtIGxlbiB0aGUgbGVuZ3RoIG9mIHRoZSBsaW5lCisgICAgICogQHJldHVybiB0aGUgZGlyZWN0aW9ucworICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgRGlyZWN0aW9ucyBkaXJlY3Rpb25zKGludCBkaXIsIGJ5dGVbXSBsZXZlbHMsIGludCBsc3RhcnQsCisgICAgICAgICAgICBjaGFyW10gY2hhcnMsIGludCBjc3RhcnQsIGludCBsZW4pIHsKKworICAgICAgICBpbnQgYmFzZUxldmVsID0gZGlyID09IExheW91dC5ESVJfTEVGVF9UT19SSUdIVCA/IDAgOiAxOworICAgICAgICBpbnQgY3VyTGV2ZWwgPSBsZXZlbHNbbHN0YXJ0XTsKKyAgICAgICAgaW50IG1pbkxldmVsID0gY3VyTGV2ZWw7CisgICAgICAgIGludCBydW5Db3VudCA9IDE7CisgICAgICAgIGZvciAoaW50IGkgPSBsc3RhcnQgKyAxLCBlID0gbHN0YXJ0ICsgbGVuOyBpIDwgZTsgKytpKSB7CisgICAgICAgICAgICBpbnQgbGV2ZWwgPSBsZXZlbHNbaV07CisgICAgICAgICAgICBpZiAobGV2ZWwgIT0gY3VyTGV2ZWwpIHsKKyAgICAgICAgICAgICAgICBjdXJMZXZlbCA9IGxldmVsOworICAgICAgICAgICAgICAgICsrcnVuQ291bnQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBhZGQgZmluYWwgcnVuIGZvciB0cmFpbGluZyBjb3VudGVyLWRpcmVjdGlvbmFsIHdoaXRlc3BhY2UKKyAgICAgICAgaW50IHZpc0xlbiA9IGxlbjsKKyAgICAgICAgaWYgKChjdXJMZXZlbCAmIDEpICE9IChiYXNlTGV2ZWwgJiAxKSkgeworICAgICAgICAgICAgLy8gbG9vayBmb3IgdmlzaWJsZSBlbmQKKyAgICAgICAgICAgIHdoaWxlICgtLXZpc0xlbiA+PSAwKSB7CisgICAgICAgICAgICAgICAgY2hhciBjaCA9IGNoYXJzW2NzdGFydCArIHZpc0xlbl07CisKKyAgICAgICAgICAgICAgICBpZiAoY2ggPT0gJ1xuJykgeworICAgICAgICAgICAgICAgICAgICAtLXZpc0xlbjsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKGNoICE9ICcgJyAmJiBjaCAhPSAnXHQnKSB7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgICsrdmlzTGVuOworICAgICAgICAgICAgaWYgKHZpc0xlbiAhPSBsZW4pIHsKKyAgICAgICAgICAgICAgICArK3J1bkNvdW50OworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKHJ1bkNvdW50ID09IDEgJiYgbWluTGV2ZWwgPT0gYmFzZUxldmVsKSB7CisgICAgICAgICAgICAvLyB3ZSdyZSBkb25lLCBvbmx5IG9uZSBydW4gb24gdGhpcyBsaW5lCisgICAgICAgICAgICBpZiAoKG1pbkxldmVsICYgMSkgIT0gMCkgeworICAgICAgICAgICAgICAgIHJldHVybiBMYXlvdXQuRElSU19BTExfUklHSFRfVE9fTEVGVDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBMYXlvdXQuRElSU19BTExfTEVGVF9UT19SSUdIVDsKKyAgICAgICAgfQorCisgICAgICAgIGludFtdIGxkID0gbmV3IGludFtydW5Db3VudCAqIDJdOworICAgICAgICBpbnQgbWF4TGV2ZWwgPSBtaW5MZXZlbDsKKyAgICAgICAgaW50IGxldmVsQml0cyA9IG1pbkxldmVsIDw8IExheW91dC5SVU5fTEVWRUxfU0hJRlQ7CisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIFN0YXJ0IG9mIGZpcnN0IHBhaXIgaXMgYWx3YXlzIDAsIHdlIHdyaXRlCisgICAgICAgICAgICAvLyBsZW5ndGggdGhlbiBzdGFydCBhdCBlYWNoIG5ldyBydW4sIGFuZCB0aGUKKyAgICAgICAgICAgIC8vIGxhc3QgcnVuIGxlbmd0aCBhZnRlciB3ZSdyZSBkb25lLgorICAgICAgICAgICAgaW50IG4gPSAxOworICAgICAgICAgICAgaW50IHByZXYgPSBsc3RhcnQ7CisgICAgICAgICAgICBjdXJMZXZlbCA9IG1pbkxldmVsOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IGxzdGFydCwgZSA9IGxzdGFydCArIHZpc0xlbjsgaSA8IGU7ICsraSkgeworICAgICAgICAgICAgICAgIGludCBsZXZlbCA9IGxldmVsc1tpXTsKKyAgICAgICAgICAgICAgICBpZiAobGV2ZWwgIT0gY3VyTGV2ZWwpIHsKKyAgICAgICAgICAgICAgICAgICAgY3VyTGV2ZWwgPSBsZXZlbDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGxldmVsID4gbWF4TGV2ZWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1heExldmVsID0gbGV2ZWw7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobGV2ZWwgPCBtaW5MZXZlbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbWluTGV2ZWwgPSBsZXZlbDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvLyBYWFggaWdub3JlIHJ1biBsZW5ndGggbGltaXQgb2YgMl5SVU5fTEVWRUxfU0hJRlQKKyAgICAgICAgICAgICAgICAgICAgbGRbbisrXSA9IChpIC0gcHJldikgfCBsZXZlbEJpdHM7CisgICAgICAgICAgICAgICAgICAgIGxkW24rK10gPSBpIC0gbHN0YXJ0OworICAgICAgICAgICAgICAgICAgICBsZXZlbEJpdHMgPSBjdXJMZXZlbCA8PCBMYXlvdXQuUlVOX0xFVkVMX1NISUZUOworICAgICAgICAgICAgICAgICAgICBwcmV2ID0gaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBsZFtuXSA9IChsc3RhcnQgKyB2aXNMZW4gLSBwcmV2KSB8IGxldmVsQml0czsKKyAgICAgICAgICAgIGlmICh2aXNMZW4gPCBsZW4pIHsKKyAgICAgICAgICAgICAgICBsZFsrK25dID0gdmlzTGVuOworICAgICAgICAgICAgICAgIGxkWysrbl0gPSAobGVuIC0gdmlzTGVuKSB8IChiYXNlTGV2ZWwgPDwgTGF5b3V0LlJVTl9MRVZFTF9TSElGVCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBTZWUgaWYgd2UgbmVlZCB0byBzd2FwIGFueSBydW5zLgorICAgICAgICAvLyBJZiB0aGUgbWluIGxldmVsIHJ1biBkaXJlY3Rpb24gZG9lc24ndCBtYXRjaCB0aGUgYmFzZQorICAgICAgICAvLyBkaXJlY3Rpb24sIHdlIGFsd2F5cyBuZWVkIHRvIHN3YXAgKGF0IHRoaXMgcG9pbnQKKyAgICAgICAgLy8gd2UgaGF2ZSBtb3JlIHRoYW4gb25lIHJ1bikuCisgICAgICAgIC8vIE90aGVyd2lzZSwgd2UgZG9uJ3QgbmVlZCB0byBzd2FwIHRoZSBsb3dlc3QgbGV2ZWwuCisgICAgICAgIC8vIFNpbmNlIHRoZXJlIGFyZSBubyBsb2dpY2FsbHkgYWRqYWNlbnQgcnVucyBhdCB0aGUgc2FtZQorICAgICAgICAvLyBsZXZlbCwgaWYgdGhlIG1heCBsZXZlbCBpcyB0aGUgc2FtZSBhcyB0aGUgKG5ldykgbWluCisgICAgICAgIC8vIGxldmVsLCB3ZSBoYXZlIGEgc2VyaWVzIG9mIGFsdGVybmF0aW5nIGxldmVscyB0aGF0CisgICAgICAgIC8vIGlzIGFscmVhZHkgaW4gb3JkZXIsIHNvIHRoZXJlJ3Mgbm8gbW9yZSB0byBkby4KKyAgICAgICAgLy8KKyAgICAgICAgYm9vbGVhbiBzd2FwOworICAgICAgICBpZiAoKG1pbkxldmVsICYgMSkgPT0gYmFzZUxldmVsKSB7CisgICAgICAgICAgICBtaW5MZXZlbCArPSAxOworICAgICAgICAgICAgc3dhcCA9IG1heExldmVsID4gbWluTGV2ZWw7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBzd2FwID0gcnVuQ291bnQgPiAxOworICAgICAgICB9CisgICAgICAgIGlmIChzd2FwKSB7CisgICAgICAgICAgICBmb3IgKGludCBsZXZlbCA9IG1heExldmVsIC0gMTsgbGV2ZWwgPj0gbWluTGV2ZWw7IC0tbGV2ZWwpIHsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxkLmxlbmd0aDsgaSArPSAyKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChsZXZlbHNbbGRbaV1dID49IGxldmVsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZSA9IGkgKyAyOworICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGUgPCBsZC5sZW5ndGggJiYgbGV2ZWxzW2xkW2VdXSA+PSBsZXZlbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgKz0gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGxvdyA9IGksIGhpID0gZSAtIDI7IGxvdyA8IGhpOyBsb3cgKz0gMiwgaGkgLT0gMikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB4ID0gbGRbbG93XTsgbGRbbG93XSA9IGxkW2hpXTsgbGRbaGldID0geDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gbGRbbG93KzFdOyBsZFtsb3crMV0gPSBsZFtoaSsxXTsgbGRbaGkrMV0gPSB4OworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGUgKyAyOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBuZXcgRGlyZWN0aW9ucyhsZCk7CisgICAgfQorCiAgICAgcHJpdmF0ZSBuYXRpdmUgc3RhdGljIGludCBydW5CaWRpKGludCBkaXIsIGNoYXJbXSBjaHMsIGJ5dGVbXSBjaEluZm8sIGludCBuLCBib29sZWFuIGhhdmVJbmZvKTsKIH0KXCBObyBuZXdsaW5lIGF0IGVuZCBvZiBmaWxlCmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC90ZXh0L0JvcmluZ0xheW91dC5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvdGV4dC9Cb3JpbmdMYXlvdXQuamF2YQppbmRleCA5NDRmNzM1Li45MzA5YjA1IDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC90ZXh0L0JvcmluZ0xheW91dC5qYXZhCisrKyBiL2NvcmUvamF2YS9hbmRyb2lkL3RleHQvQm9yaW5nTGF5b3V0LmphdmEKQEAgLTIwOCwxMSArMjA4LDExIEBACiAgICAgICAgICAgICAgKiB3aWR0aCBiZWNhdXNlIHRoZSB3aWR0aCB0aGF0IHdhcyBwYXNzZWQgaW4gd2FzIGZvciB0aGUKICAgICAgICAgICAgICAqIGZ1bGwgdGV4dCwgbm90IHRoZSBlbGxpcHNpemVkIGZvcm0uCiAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHN5bmNocm9uaXplZCAoc1RlbXApIHsKLSAgICAgICAgICAgICAgICBtTWF4ID0gKGludCkgKEZsb2F0TWF0aC5jZWlsKFN0eWxlZC5tZWFzdXJlVGV4dChwYWludCwgc1RlbXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2UsIDAsIHNvdXJjZS5sZW5ndGgoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwpKSk7Ci0gICAgICAgICAgICB9CisgICAgICAgICAgICBUZXh0TGluZSBsaW5lID0gVGV4dExpbmUub2J0YWluKCk7CisgICAgICAgICAgICBsaW5lLnNldChwYWludCwgc291cmNlLCAwLCBzb3VyY2UubGVuZ3RoKCksIExheW91dC5ESVJfTEVGVF9UT19SSUdIVCwKKyAgICAgICAgICAgICAgICAgICAgTGF5b3V0LkRJUlNfQUxMX0xFRlRfVE9fUklHSFQsIGZhbHNlLCBudWxsKTsKKyAgICAgICAgICAgIG1NYXggPSAoaW50KSBGbG9hdE1hdGguY2VpbChsaW5lLm1ldHJpY3MobnVsbCkpOworICAgICAgICAgICAgVGV4dExpbmUucmVjeWNsZShsaW5lKTsKICAgICAgICAgfQogCiAgICAgICAgIGlmIChpbmNsdWRlcGFkKSB7CkBAIC0yNzYsMTQgKzI3NiwxMyBAQAogICAgICAgICAgICAgaWYgKGZtID09IG51bGwpIHsKICAgICAgICAgICAgICAgICBmbSA9IG5ldyBNZXRyaWNzKCk7CiAgICAgICAgICAgICB9Ci0gICAgCi0gICAgICAgICAgICBpbnQgd2lkOwogCi0gICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHNUZW1wKSB7Ci0gICAgICAgICAgICAgICAgd2lkID0gKGludCkgKEZsb2F0TWF0aC5jZWlsKFN0eWxlZC5tZWFzdXJlVGV4dChwYWludCwgc1RlbXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0LCAwLCB0ZXh0Lmxlbmd0aCgpLCBmbSkpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGZtLndpZHRoID0gd2lkOworICAgICAgICAgICAgVGV4dExpbmUgbGluZSA9IFRleHRMaW5lLm9idGFpbigpOworICAgICAgICAgICAgbGluZS5zZXQocGFpbnQsIHRleHQsIDAsIHRleHQubGVuZ3RoKCksIExheW91dC5ESVJfTEVGVF9UT19SSUdIVCwKKyAgICAgICAgICAgICAgICAgICAgTGF5b3V0LkRJUlNfQUxMX0xFRlRfVE9fUklHSFQsIGZhbHNlLCBudWxsKTsKKyAgICAgICAgICAgIGZtLndpZHRoID0gKGludCkgRmxvYXRNYXRoLmNlaWwobGluZS5tZXRyaWNzKGZtKSk7CisgICAgICAgICAgICBUZXh0TGluZS5yZWN5Y2xlKGxpbmUpOworCiAgICAgICAgICAgICByZXR1cm4gZm07CiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICByZXR1cm4gbnVsbDsKQEAgLTM4OSw3ICszODgsNyBAQAogCiAgICAgcHVibGljIHN0YXRpYyBjbGFzcyBNZXRyaWNzIGV4dGVuZHMgUGFpbnQuRm9udE1ldHJpY3NJbnQgewogICAgICAgICBwdWJsaWMgaW50IHdpZHRoOwotICAgICAgICAKKwogICAgICAgICBAT3ZlcnJpZGUgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKICAgICAgICAgICAgIHJldHVybiBzdXBlci50b1N0cmluZygpICsgIiB3aWR0aD0iICsgd2lkdGg7CiAgICAgICAgIH0KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL3RleHQvRHluYW1pY0xheW91dC5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvdGV4dC9EeW5hbWljTGF5b3V0LmphdmEKaW5kZXggMTRlNTY1NS4uYjZhYTAzYSAxMDA2NDQKLS0tIGEvY29yZS9qYXZhL2FuZHJvaWQvdGV4dC9EeW5hbWljTGF5b3V0LmphdmEKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvdGV4dC9EeW5hbWljTGF5b3V0LmphdmEKQEAgLTMxMCw3ICszMTAsNiBAQAogCiAgICAgICAgIERpcmVjdGlvbnNbXSBvYmplY3RzID0gbmV3IERpcmVjdGlvbnNbMV07CiAKLQogICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykgewogICAgICAgICAgICAgaW50c1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SkkgPSAtMTsKICAgICAgICAgfQotICAgIH07Ci0KLSAgICBwcml2YXRlIFJlY3RGIG1FbW9qaVJlY3Q7CisgICAgfQogCiAgICAgLyoqCiAgICAgICogUmV0dXJuIGhvdyB3aWRlIGEgbGF5b3V0IG11c3QgYmUgaW4gb3JkZXIgdG8gZGlzcGxheSB0aGUKQEAgLTY2LDcgKzY4LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0UGFpbnQgcGFpbnQpIHsKICAgICAgICAgcmV0dXJuIGdldERlc2lyZWRXaWR0aChzb3VyY2UsIDAsIHNvdXJjZS5sZW5ndGgoKSwgcGFpbnQpOwogICAgIH0KLSAgICAKKwogICAgIC8qKgogICAgICAqIFJldHVybiBob3cgd2lkZSBhIGxheW91dCBtdXN0IGJlIGluIG9yZGVyIHRvIGRpc3BsYXkgdGhlCiAgICAgICogc3BlY2lmaWVkIHRleHQgc2xpY2Ugd2l0aCBvbmUgbGluZSBwZXIgcGFyYWdyYXBoLgpAQCAtODUsOCArODcsNyBAQAogICAgICAgICAgICAgICAgIG5leHQgPSBlbmQ7CiAKICAgICAgICAgICAgIC8vIG5vdGUsIG9taXRzIHRyYWlsaW5nIHBhcmFncmFwaCBjaGFyCi0gICAgICAgICAgICBmbG9hdCB3ID0gbWVhc3VyZVRleHQocGFpbnQsIHdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2UsIGksIG5leHQsIG51bGwsIHRydWUsIG51bGwpOworICAgICAgICAgICAgZmxvYXQgdyA9IG1lYXN1cmVQYXJhKHBhaW50LCB3b3JrUGFpbnQsIHNvdXJjZSwgaSwgbmV4dCk7CiAKICAgICAgICAgICAgIGlmICh3ID4gbmVlZCkKICAgICAgICAgICAgICAgICBuZWVkID0gdzsKQEAgLTExNiw2ICsxMTcsMTUgQEAKICAgICAgICAgaWYgKHdpZHRoIDwgMCkKICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkxheW91dDogIiArIHdpZHRoICsgIiA8IDAiKTsKIAorICAgICAgICAvLyBFbnN1cmUgcGFpbnQgZG9lc24ndCBoYXZlIGJhc2VsaW5lU2hpZnQgc2V0LgorICAgICAgICAvLyBXaGlsZSBub3JtYWxseSB3ZSBkb24ndCBtb2RpZnkgdGhlIHBhaW50IHRoZSB1c2VyIHBhc3NlZCBpbiwKKyAgICAgICAgLy8gd2Ugd2VyZSBhbHJlYWR5IGRvaW5nIHRoaXMgaW4gU3R5bGVkLmRyYXdVbmlmb3JtUnVuIHdpdGggYm90aAorICAgICAgICAvLyBiYXNlbGluZVNoaWZ0IGFuZCBiZ0NvbG9yLiAgV2UgcHJvYmFibHkgc2hvdWxkIHJlZXZhbHVhdGUgYmdDb2xvci4KKyAgICAgICAgaWYgKHBhaW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgIHBhaW50LmJnQ29sb3IgPSAwOworICAgICAgICAgICAgcGFpbnQuYmFzZWxpbmVTaGlmdCA9IDA7CisgICAgICAgIH0KKwogICAgICAgICBtVGV4dCA9IHRleHQ7CiAgICAgICAgIG1QYWludCA9IHBhaW50OwogICAgICAgICBtV29ya1BhaW50ID0gbmV3IFRleHRQYWludCgpOwpAQCAtMTc1LDcgKzE4NSw2IEBACiAgICAgICAgICAgICBkYm90dG9tID0gc1RlbXBSZWN0LmJvdHRvbTsKICAgICAgICAgfQogCi0KICAgICAgICAgaW50IHRvcCA9IDA7CiAgICAgICAgIGludCBib3R0b20gPSBnZXRMaW5lVG9wKGdldExpbmVDb3VudCgpKTsKIApAQCAtMTg1LDI2ICsxOTQsMjggQEAKICAgICAgICAgaWYgKGRib3R0b20gPCBib3R0b20pIHsKICAgICAgICAgICAgIGJvdHRvbSA9IGRib3R0b207CiAgICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIGludCBmaXJzdCA9IGdldExpbmVGb3JWZXJ0aWNhbCh0b3ApOyAKKworICAgICAgICBpbnQgZmlyc3QgPSBnZXRMaW5lRm9yVmVydGljYWwodG9wKTsKICAgICAgICAgaW50IGxhc3QgPSBnZXRMaW5lRm9yVmVydGljYWwoYm90dG9tKTsKLSAgICAgICAgCisKICAgICAgICAgaW50IHByZXZpb3VzTGluZUJvdHRvbSA9IGdldExpbmVUb3AoZmlyc3QpOwogICAgICAgICBpbnQgcHJldmlvdXNMaW5lRW5kID0gZ2V0TGluZVN0YXJ0KGZpcnN0KTsKLSAgICAgICAgCisKICAgICAgICAgVGV4dFBhaW50IHBhaW50ID0gbVBhaW50OwogICAgICAgICBDaGFyU2VxdWVuY2UgYnVmID0gbVRleHQ7CiAgICAgICAgIGludCB3aWR0aCA9IG1XaWR0aDsKICAgICAgICAgYm9vbGVhbiBzcGFubmVkVGV4dCA9IG1TcGFubmVkVGV4dDsKIAogICAgICAgICBQYXJhZ3JhcGhTdHlsZVtdIHNwYW5zID0gTk9fUEFSQV9TUEFOUzsKLSAgICAgICAgaW50IHNwYW5lbmQgPSAwOworICAgICAgICBpbnQgc3BhbkVuZCA9IDA7CiAgICAgICAgIGludCB0ZXh0TGVuZ3RoID0gMDsKIAogICAgICAgICAvLyBGaXJzdCwgZHJhdyBMaW5lQmFja2dyb3VuZFNwYW5zLgotICAgICAgICAvLyBMaW5lQmFja2dyb3VuZFNwYW5zIGtub3cgbm90aGluZyBhYm91dCB0aGUgYWxpZ25tZW50IG9yIGRpcmVjdGlvbiBvZgotICAgICAgICAvLyB0aGUgbGF5b3V0IG9yIGxpbmUuICBYWFg6IFNob3VsZCB0aGV5PworICAgICAgICAvLyBMaW5lQmFja2dyb3VuZFNwYW5zIGtub3cgbm90aGluZyBhYm91dCB0aGUgYWxpZ25tZW50LCBtYXJnaW5zLCBvcgorICAgICAgICAvLyBkaXJlY3Rpb24gb2YgdGhlIGxheW91dCBvciBsaW5lLiAgWFhYOiBTaG91bGQgdGhleT8KKyAgICAgICAgLy8gVGhleSBhcmUgZXZhbHVhdGVkIGF0IGVhY2ggbGluZS4KICAgICAgICAgaWYgKHNwYW5uZWRUZXh0KSB7CisgICAgICAgICAgICBTcGFubmVkIHNwID0gKFNwYW5uZWQpIGJ1ZjsKICAgICAgICAgICAgIHRleHRMZW5ndGggPSBidWYubGVuZ3RoKCk7CiAgICAgICAgICAgICBmb3IgKGludCBpID0gZmlyc3Q7IGkgPD0gbGFzdDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgaW50IHN0YXJ0ID0gcHJldmlvdXNMaW5lRW5kOwpAQCAtMjE2LDEyICsyMjcsMTQgQEAKICAgICAgICAgICAgICAgICBwcmV2aW91c0xpbmVCb3R0b20gPSBsYm90dG9tOwogICAgICAgICAgICAgICAgIGludCBsYmFzZWxpbmUgPSBsYm90dG9tIC0gZ2V0TGluZURlc2NlbnQoaSk7CiAKLSAgICAgICAgICAgICAgICBpZiAoc3RhcnQgPj0gc3BhbmVuZCkgewotICAgICAgICAgICAgICAgICAgIFNwYW5uZWQgc3AgPSAoU3Bhbm5lZCkgYnVmOwotICAgICAgICAgICAgICAgICAgIHNwYW5lbmQgPSBzcC5uZXh0U3BhblRyYW5zaXRpb24oc3RhcnQsIHRleHRMZW5ndGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMaW5lQmFja2dyb3VuZFNwYW4uY2xhc3MpOwotICAgICAgICAgICAgICAgICAgIHNwYW5zID0gc3AuZ2V0U3BhbnMoc3RhcnQsIHNwYW5lbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMaW5lQmFja2dyb3VuZFNwYW4uY2xhc3MpOworICAgICAgICAgICAgICAgIGlmIChzdGFydCA+PSBzcGFuRW5kKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFRoZXNlIHNob3VsZCBiZSBpbmZyZXF1ZW50LCBzbyB3ZSdsbCB1c2UgdGhpcyBzbyB0aGF0CisgICAgICAgICAgICAgICAgICAgIC8vIHdlIGRvbid0IGhhdmUgdG8gY2hlY2sgYXMgb2Z0ZW4uCisgICAgICAgICAgICAgICAgICAgIHNwYW5FbmQgPSBzcC5uZXh0U3BhblRyYW5zaXRpb24oc3RhcnQsIHRleHRMZW5ndGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGluZUJhY2tncm91bmRTcGFuLmNsYXNzKTsKKyAgICAgICAgICAgICAgICAgICAgLy8gQWxsIExpbmVCYWNrZ3JvdW5kU3BhbnMgb24gYSBsaW5lIGNvbnRyaWJ1dGUgdG8gaXRzCisgICAgICAgICAgICAgICAgICAgIC8vIGJhY2tncm91bmQuCisgICAgICAgICAgICAgICAgICAgc3BhbnMgPSBzcC5nZXRTcGFucyhzdGFydCwgZW5kLCBMaW5lQmFja2dyb3VuZFNwYW4uY2xhc3MpOwogICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgIGZvciAoaW50IG4gPSAwOyBuIDwgc3BhbnMubGVuZ3RoOyBuKyspIHsKQEAgLTIzNCwxMSArMjQ3LDExIEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICAgICAgLy8gcmVzZXQgdG8gdGhlaXIgb3JpZ2luYWwgdmFsdWVzCi0gICAgICAgICAgICBzcGFuZW5kID0gMDsKKyAgICAgICAgICAgIHNwYW5FbmQgPSAwOwogICAgICAgICAgICAgcHJldmlvdXNMaW5lQm90dG9tID0gZ2V0TGluZVRvcChmaXJzdCk7CiAgICAgICAgICAgICBwcmV2aW91c0xpbmVFbmQgPSBnZXRMaW5lU3RhcnQoZmlyc3QpOwogICAgICAgICAgICAgc3BhbnMgPSBOT19QQVJBX1NQQU5TOwotICAgICAgICB9IAorICAgICAgICB9CiAKICAgICAgICAgLy8gVGhlcmUgY2FuIGJlIGEgaGlnaGxpZ2h0IGV2ZW4gd2l0aG91dCBzcGFucyBpZiB3ZSBhcmUgZHJhd2luZwogICAgICAgICAvLyBhIG5vbi1zcGFubmVkIHRyYW5zZm9ybWF0aW9uIG9mIGEgc3Bhbm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otICAgICAgICAgICAgICAgIGlmIChzdGFydCA+PSBzcGFuZW5kKSB7Ci0gICAgICAgICAgICAgICAgICAgIFNwYW5uZWQgc3AgPSAoU3Bhbm5lZCkgYnVmOwotICAgICAgICAgICAgICAgICAgICBzcGFuZW5kID0gc3AubmV4dFNwYW5UcmFuc2l0aW9uKHN0YXJ0LCB0ZXh0TGVuZ3RoLAorICAgICAgICAgICAgaW50IGRpciA9IGdldFBhcmFncmFwaERpcmVjdGlvbihpKTsKKyAgICAgICAgICAgIGludCBsZWZ0ID0gMDsKKyAgICAgICAgICAgIGludCByaWdodCA9IG1XaWR0aDsKKworICAgICAgICAgICAgaWYgKHNwYW5uZWRUZXh0KSB7CisgICAgICAgICAgICAgICAgU3Bhbm5lZCBzcCA9IChTcGFubmVkKSBidWY7CisgICAgICAgICAgICAgICAgYm9vbGVhbiBpc0ZpcnN0UGFyYUxpbmUgPSAoc3RhcnQgPT0gMCB8fAorICAgICAgICAgICAgICAgICAgICAgICAgYnVmLmNoYXJBdChzdGFydCAtIDEpID09ICdcbicpOworCisgICAgICAgICAgICAgICAgLy8gTmV3IGJhdGNoIG9mIHBhcmFncmFwaCBzdHlsZXMsIGNvbGxlY3QgaW50byBzcGFucyBhcnJheS4KKyAgICAgICAgICAgICAgICAvLyBDb21wdXRlIHRoZSBhbGlnbm1lbnQsIGxhc3QgYWxpZ25tZW50IHN0eWxlIHdpbnMuCisgICAgICAgICAgICAgICAgLy8gUmVzZXQgdGFiU3RvcHMsIHdlJ2xsIHJlYnVpbGQgaWYgd2UgZW5jb3VudGVyIGEgbGluZSB3aXRoCisgICAgICAgICAgICAgICAgLy8gdGFicy4KKyAgICAgICAgICAgICAgICAvLyBXZSBleHBlY3QgcGFyYWdyYXBoIHNwYW5zIHRvIGJlIHJlbGF0aXZlbHkgaW5mcmVxdWVudCwgdXNlCisgICAgICAgICAgICAgICAgLy8gc3BhbkVuZCBzbyB0aGF0IHdlIGNhbiBjaGVjayBsZXNzIGZyZXF1ZW50bHkuICBTaW5jZQorICAgICAgICAgICAgICAgIC8vIHBhcmFncmFwaCBzdHlsZXMgb3VnaHQgdG8gYXBwbHkgdG8gZW50aXJlIHBhcmFncmFwaHMsIHdlIGNhbgorICAgICAgICAgICAgICAgIC8vIGp1c3QgY29sbGVjdCB0aGUgb25lcyBwcmVzZW50IGF0IHRoZSBzdGFydCBvZiB0aGUgcGFyYWdyYXBoLgorICAgICAgICAgICAgICAgIC8vIElmIHNwYW5FbmQgaXMgYmVmb3JlIHRoZSBlbmQgb2YgdGhlIHBhcmFncmFwaCwgdGhhdCdzIG5vdAorICAgICAgICAgICAgICAgIC8vIG91ciBwcm9ibGVtLgorICAgICAgICAgICAgICAgIGlmIChzdGFydCA+PSBzcGFuRW5kICYmIChpID09IGZpcnN0IHx8IGlzRmlyc3RQYXJhTGluZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgc3BhbkVuZCA9IHNwLm5leHRTcGFuVHJhbnNpdGlvbihzdGFydCwgdGV4dExlbmd0aCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYXJhZ3JhcGhTdHlsZS5jbGFzcyk7Ci0gICAgICAgICAgICAgICAgICAgIHNwYW5zID0gc3AuZ2V0U3BhbnMoc3RhcnQsIHNwYW5lbmQsIFBhcmFncmFwaFN0eWxlLmNsYXNzKTsKLSAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIHNwYW5zID0gc3AuZ2V0U3BhbnMoc3RhcnQsIHNwYW5FbmQsIFBhcmFncmFwaFN0eWxlLmNsYXNzKTsKKwogICAgICAgICAgICAgICAgICAgICBhbGlnbiA9IG1BbGlnbm1lbnQ7CiAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IG4gPSBzcGFucy5sZW5ndGgtMTsgbiA+PSAwOyBuLS0pIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzcGFuc1tuXSBpbnN0YW5jZW9mIEFsaWdubWVudFNwYW4pIHsKQEAgLTI5MCw0NSArMzE4LDQ5IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIGludCBkaXIgPSBnZXRQYXJhZ3JhcGhEaXJlY3Rpb24oaSk7Ci0gICAgICAgICAgICBpbnQgbGVmdCA9IDA7Ci0gICAgICAgICAgICBpbnQgcmlnaHQgPSBtV2lkdGg7CiAKLSAgICAgICAgICAgIC8vIERyYXcgYWxsIGxlYWRpbmcgbWFyZ2luIHNwYW5zLiAgQWRqdXN0IGxlZnQgb3IgcmlnaHQgYWNjb3JkaW5nCi0gICAgICAgICAgICAvLyB0byB0aGUgcGFyYWdyYXBoIGRpcmVjdGlvbiBvZiB0aGUgbGluZS4KLSAgICAgICAgICAgIGlmIChzcGFubmVkVGV4dCkgeworICAgICAgICAgICAgICAgICAgICB0YWJTdG9wc0lzSW5pdGlhbGl6ZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBEcmF3IGFsbCBsZWFkaW5nIG1hcmdpbiBzcGFucy4gIEFkanVzdCBsZWZ0IG9yIHJpZ2h0IGFjY29yZGluZworICAgICAgICAgICAgICAgIC8vIHRvIHRoZSBwYXJhZ3JhcGggZGlyZWN0aW9uIG9mIHRoZSBsaW5lLgogICAgICAgICAgICAgICAgIGZpbmFsIGludCBsZW5ndGggPSBzcGFucy5sZW5ndGg7CiAgICAgICAgICAgICAgICAgZm9yIChpbnQgbiA9IDA7IG4gPCBsZW5ndGg7IG4rKykgewogICAgICAgICAgICAgICAgICAgICBpZiAoc3BhbnNbbl0gaW5zdGFuY2VvZiBMZWFkaW5nTWFyZ2luU3BhbikgewogICAgICAgICAgICAgICAgICAgICAgICAgTGVhZGluZ01hcmdpblNwYW4gbWFyZ2luID0gKExlYWRpbmdNYXJnaW5TcGFuKSBzcGFuc1tuXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gdXNlRmlyc3RMaW5lTWFyZ2luID0gaXNGaXJzdFBhcmFMaW5lOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1hcmdpbiBpbnN0YW5jZW9mIExlYWRpbmdNYXJnaW5TcGFuMikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjb3VudCA9ICgoTGVhZGluZ01hcmdpblNwYW4yKSBtYXJnaW4pLmdldExlYWRpbmdNYXJnaW5MaW5lQ291bnQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc3RhcnRMaW5lID0gZ2V0TGluZUZvck9mZnNldChzcC5nZXRTcGFuU3RhcnQobWFyZ2luKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNlRmlyc3RMaW5lTWFyZ2luID0gaSA8IHN0YXJ0TGluZSArIGNvdW50OworICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGlyID09IERJUl9SSUdIVF9UT19MRUZUKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFyZ2luLmRyYXdMZWFkaW5nTWFyZ2luKGMsIHBhaW50LCByaWdodCwgZGlyLCBsdG9wLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYmFzZWxpbmUsIGxib3R0b20sIGJ1ZiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQsIGVuZCwgaXNGaXJzdFBhcmFMaW5lLCB0aGlzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmlnaHQgLT0gbWFyZ2luLmdldExlYWRpbmdNYXJnaW4oaXNGaXJzdFBhcmFMaW5lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByaWdodCAtPSBtYXJnaW4uZ2V0TGVhZGluZ01hcmdpbih1c2VGaXJzdExpbmVNYXJnaW4pOwogICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXJnaW4uZHJhd0xlYWRpbmdNYXJnaW4oYywgcGFpbnQsIGxlZnQsIGRpciwgbHRvcCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGJhc2VsaW5lLCBsYm90dG9tLCBidWYsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0LCBlbmQsIGlzRmlyc3RQYXJhTGluZSwgdGhpcyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sZWFuIHVzZU1hcmdpbiA9IGlzRmlyc3RQYXJhTGluZTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWFyZ2luIGluc3RhbmNlb2YgTGVhZGluZ01hcmdpblNwYW4uTGVhZGluZ01hcmdpblNwYW4yKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjb3VudCA9ICgoTGVhZGluZ01hcmdpblNwYW4uTGVhZGluZ01hcmdpblNwYW4yKW1hcmdpbikuZ2V0TGVhZGluZ01hcmdpbkxpbmVDb3VudCgpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VNYXJnaW4gPSBjb3VudCA+IGk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQgKz0gbWFyZ2luLmdldExlYWRpbmdNYXJnaW4odXNlTWFyZ2luKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0ICs9IG1hcmdpbi5nZXRMZWFkaW5nTWFyZ2luKHVzZUZpcnN0TGluZU1hcmdpbik7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIC8vIEFkanVzdCB0aGUgcG9pbnQgYXQgd2hpY2ggdG8gc3RhcnQgcmVuZGVyaW5nIGRlcGVuZGluZyBvbiB0aGUKLSAgICAgICAgICAgIC8vIGFsaWdubWVudCBvZiB0aGUgcGFyYWdyYXBoLgorICAgICAgICAgICAgYm9vbGVhbiBoYXNUYWJPckVtb2ppID0gZ2V0TGluZUNvbnRhaW5zVGFiKGkpOworICAgICAgICAgICAgLy8gQ2FuJ3QgdGVsbCBpZiB3ZSBoYXZlIHRhYnMgZm9yIHN1cmUsIGN1cnJlbnRseQorICAgICAgICAgICAgaWYgKGhhc1RhYk9yRW1vamkgJiYgIXRhYlN0b3BzSXNJbml0aWFsaXplZCkgeworICAgICAgICAgICAgICAgIGlmICh0YWJTdG9wcyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHRhYlN0b3BzID0gbmV3IFRhYlN0b3BzKFRBQl9JTkNSRU1FTlQsIHNwYW5zKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICB0YWJTdG9wcy5yZXNldChUQUJfSU5DUkVNRU5ULCBzcGFucyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHRhYlN0b3BzSXNJbml0aWFsaXplZCA9IHRydWU7CisgICAgICAgICAgICB9CisKICAgICAgICAgICAgIGludCB4OwogICAgICAgICAgICAgaWYgKGFsaWduID09IEFsaWdubWVudC5BTElHTl9OT1JNQUwpIHsKICAgICAgICAgICAgICAgICBpZiAoZGlyID09IERJUl9MRUZUX1RPX1JJR0hUKSB7CkBAIC0zMzcsNDEgKzM2OSw4MCBAQAogICAgICAgICAgICAgICAgICAgICB4ID0gcmlnaHQ7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBpbnQgbWF4ID0gKGludClnZXRMaW5lTWF4KGksIHNwYW5zLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgaW50IG1heCA9IChpbnQpZ2V0TGluZUV4dGVudChpLCB0YWJTdG9wcywgZmFsc2UpOwogICAgICAgICAgICAgICAgIGlmIChhbGlnbiA9PSBBbGlnbm1lbnQuQUxJR05fT1BQT1NJVEUpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGRpciA9PSBESVJfUklHSFRfVE9fTEVGVCkgewotICAgICAgICAgICAgICAgICAgICAgICAgeCA9IGxlZnQgKyBtYXg7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChkaXIgPT0gRElSX0xFRlRfVE9fUklHSFQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHggPSByaWdodCAtIG1heDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIEFsaWdubWVudC5BTElHTl9DRU5URVIKLSAgICAgICAgICAgICAgICAgICAgbWF4ID0gbWF4ICYgfjE7Ci0gICAgICAgICAgICAgICAgICAgIGludCBoYWxmID0gKHJpZ2h0IC0gbGVmdCAtIG1heCkgPj4gMTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGRpciA9PSBESVJfUklHSFRfVE9fTEVGVCkgewotICAgICAgICAgICAgICAgICAgICAgICAgeCA9IHJpZ2h0IC0gaGFsZjsKICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHggPSBsZWZ0ICsgaGFsZjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHggPSBsZWZ0IC0gbWF4OwogICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsgLy8gQWxpZ25tZW50LkFMSUdOX0NFTlRFUgorICAgICAgICAgICAgICAgICAgICBtYXggPSBtYXggJiB+MTsKKyAgICAgICAgICAgICAgICAgICAgeCA9IChyaWdodCArIGxlZnQgLSBtYXgpID4+IDE7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBEaXJlY3Rpb25zIGRpcmVjdGlvbnMgPSBnZXRMaW5lRGlyZWN0aW9ucyhpKTsKLSAgICAgICAgICAgIGJvb2xlYW4gaGFzVGFiID0gZ2V0TGluZUNvbnRhaW5zVGFiKGkpOwogICAgICAgICAgICAgaWYgKGRpcmVjdGlvbnMgPT0gRElSU19BTExfTEVGVF9UT19SSUdIVCAmJgotICAgICAgICAgICAgICAgICAgICAhc3Bhbm5lZFRleHQgJiYgIWhhc1RhYikgewotICAgICAgICAgICAgICAgIGlmIChERUJVRykgewotICAgICAgICAgICAgICAgICAgICBBc3NlcnQuYXNzZXJ0VHJ1ZShkaXIgPT0gRElSX0xFRlRfVE9fUklHSFQpOwotICAgICAgICAgICAgICAgICAgICBBc3NlcnQuYXNzZXJ0Tm90TnVsbChjKTsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICFzcGFubmVkVGV4dCAmJiAhaGFzVGFiT3JFbW9qaSkgewogICAgICAgICAgICAgICAgIC8vIFhYWDogYXNzdW1lcyB0aGVyZSdzIG5vdGhpbmcgYWRkaXRpb25hbCB0byBiZSBkb25lCiAgICAgICAgICAgICAgICAgYy5kcmF3VGV4dChidWYsIHN0YXJ0LCBlbmQsIHgsIGxiYXNlbGluZSwgcGFpbnQpOwogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBkcmF3VGV4dChjLCBidWYsIHN0YXJ0LCBlbmQsIGRpciwgZGlyZWN0aW9ucywKLSAgICAgICAgICAgICAgICAgICAgeCwgbHRvcCwgbGJhc2VsaW5lLCBsYm90dG9tLCBwYWludCwgbVdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgaGFzVGFiLC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nbm1lbnQobGluZSk7CisgICAgICAgIGludCBkaXIgPSBnZXRQYXJhZ3JhcGhEaXJlY3Rpb24obGluZSk7CisKKyAgICAgICAgaW50IHg7CisgICAgICAgIGlmIChhbGlnbiA9PSBBbGlnbm1lbnQuQUxJR05fTk9STUFMKSB7CisgICAgICAgICAgICBpZiAoZGlyID09IERJUl9MRUZUX1RPX1JJR0hUKSB7CisgICAgICAgICAgICAgICAgeCA9IGxlZnQ7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHggPSByaWdodDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIFRhYlN0b3BzIHRhYlN0b3BzID0gbnVsbDsKKyAgICAgICAgICAgIGlmIChtU3Bhbm5lZFRleHQgJiYgZ2V0TGluZUNvbnRhaW5zVGFiKGxpbmUpKSB7CisgICAgICAgICAgICAgICAgU3Bhbm5lZCBzcGFubmVkID0gKFNwYW5uZWQpIG1UZXh0OworICAgICAgICAgICAgICAgIGludCBzdGFydCA9IGdldExpbmVTdGFydChsaW5lKTsKKyAgICAgICAgICAgICAgICBpbnQgc3BhbkVuZCA9IHNwYW5uZWQubmV4dFNwYW5UcmFuc2l0aW9uKHN0YXJ0LCBzcGFubmVkLmxlbmd0aCgpLAorICAgICAgICAgICAgICAgICAgICAgICAgVGFiU3RvcFNwYW4uY2xhc3MpOworICAgICAgICAgICAgICAgIFRhYlN0b3BTcGFuW10gdGFiU3BhbnMgPSBzcGFubmVkLmdldFNwYW5zKHN0YXJ0LCBzcGFuRW5kLCBUYWJTdG9wU3Bhbi5jbGFzcyk7CisgICAgICAgICAgICAgICAgaWYgKHRhYlNwYW5zLmxlbmd0aCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgdGFiU3RvcHMgPSBuZXcgVGFiU3RvcHMoVEFCX0lOQ1JFTUVOVCwgdGFiU3BhbnMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGludCBtYXggPSAoaW50KWdldExpbmVFeHRlbnQobGluZSwgdGFiU3RvcHMsIGZhbHNlKTsKKyAgICAgICAgICAgIGlmIChhbGlnbiA9PSBBbGlnbm1lbnQuQUxJR05fT1BQT1NJVEUpIHsKKyAgICAgICAgICAgICAgICBpZiAoZGlyID09IERJUl9MRUZUX1RPX1JJR0hUKSB7CisgICAgICAgICAgICAgICAgICAgIHggPSByaWdodCAtIG1heDsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICB4ID0gbGVmdCAtIG1heDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeyAvLyBBbGlnbm1lbnQuQUxJR05fQ0VOVEVSCisgICAgICAgICAgICAgICAgbWF4ID0gbWF4ICYgfjE7CisgICAgICAgICAgICAgICAgeCA9IChsZWZ0ICsgcmlnaHQgLSBtYXgpID4+IDE7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHg7CiAgICAgfQogCiAgICAgLyoqCkBAIC00MTcsNyArNDg4LDcgQEAKIAogICAgICAgICBtV2lkdGggPSB3aWQ7CiAgICAgfQotICAgIAorCiAgICAgLyoqCiAgICAgICogUmV0dXJuIHRoZSB0b3RhbCBoZWlnaHQgb2YgdGhpcyBsYXlvdXQuCiAgICAgICovCkBAIC00NTAsNyArNTIxLDcgQEAKICAgICAgKiBSZXR1cm4gdGhlIG51bWJlciBvZiBsaW5lcyBvZiB0ZXh0IGluIHRoaXMgbGF5b3V0LgogICAgICAqLwogICAgIHB1YmxpYyBhYnN0cmFjdCBpbnQgZ2V0TGluZUNvdW50KCk7Ci0gICAgCisKICAgICAvKioKICAgICAgKiBSZXR1cm4gdGhlIGJhc2VsaW5lIGZvciB0aGUgc3BlY2lmaWVkIGxpbmUgKDAmaGVsbGlwO2dldExpbmVDb3VudCgpIC0gMSkKICAgICAgKiBJZiBib3VuZHMgaXMgbm90IG51bGwsIHJldHVybiB0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YXJhZ3JhcGhEaXJlY3Rpb24obGluZSkgPT0gMSA/IDAgOiAxOworICAgICAgICAgICAgaW50IHJ1bkluZGV4ID0gb2Zmc2V0ID09IGxpbmVTdGFydCA/IDAgOiBydW5zLmxlbmd0aCAtIDI7CisgICAgICAgICAgICByZXR1cm4gKChydW5zW3J1bkluZGV4ICsgMV0gPj4+IFJVTl9MRVZFTF9TSElGVCkgJiBSVU5fTEVWRUxfTUFTSykgIT0gcGFyYUxldmVsOworICAgICAgICB9CisKKyAgICAgICAgb2Zmc2V0IC09IGxpbmVTdGFydDsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBydW5zLmxlbmd0aDsgaSArPSAyKSB7CisgICAgICAgICAgICBpZiAob2Zmc2V0ID09IHJ1bnNbaV0pIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIHByaW1hcnlJc1RyYWlsaW5nUHJldmlvdXMoaW50IG9mZnNldCkgeworICAgICAgICBpbnQgbGluZSA9IGdldExpbmVGb3JPZmZzZXQob2Zmc2V0KTsKKyAgICAgICAgaW50IGxpbmVTdGFydCA9IGdldExpbmVTdGFydChsaW5lKTsKKyAgICAgICAgaW50IGxpbmVFbmQgPSBnZXRMaW5lRW5kKGxpbmUpOworICAgICAgICBpbnRbXSBydW5zID0gZ2V0TGluZURpcmVjdGlvbnMobGluZSkubURpcmVjdGlvbnM7CisKKyAgICAgICAgaW50IGxldmVsQXQgPSAtMTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBydW5zLmxlbmd0aDsgaSArPSAyKSB7CisgICAgICAgICAgICBpbnQgc3RhcnQgPSBsaW5lU3RhcnQgKyBydW5zW2ldOworICAgICAgICAgICAgaW50IGxpbWl0ID0gc3RhcnQgKyAocnVuc1tpKzFdICYgUlVOX0xFTkdUSF9NQVNLKTsKKyAgICAgICAgICAgIGlmIChsaW1pdCA+IGxpbmVFbmQpIHsKKyAgICAgICAgICAgICAgICBsaW1pdCA9IGxpbmVFbmQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAob2Zmc2V0ID49IHN0YXJ0ICYmIG9mZnNldCA8IGxpbWl0KSB7CisgICAgICAgICAgICAgICAgaWYgKG9mZnNldCA+IHN0YXJ0KSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFByZXZpb3VzIGNoYXJhY3RlciBpcyBhdCBzYW1lIGxldmVsLCBzbyBkb24ndCB1c2UgdHJhaWxpbmcuCisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbGV2ZWxBdCA9IChydW5zW2krMV0gPj4+IFJVTl9MRVZFTF9TSElGVCkgJiBSVU5fTEVWRUxfTUFTSzsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAobGV2ZWxBdCA9PSAtMSkgeworICAgICAgICAgICAgLy8gT2Zmc2V0IHdhcyBsaW1pdCBvZiBsaW5lLgorICAgICAgICAgICAgbGV2ZWxBdCA9IGdldFBhcmFncmFwaERpcmVjdGlvbihsaW5lKSA9PSAxID8gMCA6IDE7CisgICAgICAgIH0KKworICAgICAgICAvLyBBdCBsZXZlbCBib3VuZGFyeSwgY2hlY2sgcHJldmlvdXMgbGV2ZWwuCisgICAgICAgIGludCBsZXZlbEJlZm9yZSA9IC0xOworICAgICAgICBpZiAob2Zmc2V0ID09IGxpbmVTdGFydCkgeworICAgICAgICAgICAgbGV2ZWxCZWZvcmUgPSBnZXRQYXJhZ3JhcGhEaXJlY3Rpb24obGluZSkgPT0gMSA/IDAgOiAxOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgb2Zmc2V0IC09IDE7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHJ1bnMubGVuZ3RoOyBpICs9IDIpIHsKKyAgICAgICAgICAgICAgICBpbnQgc3RhcnQgPSBsaW5lU3RhcnQgKyBydW5zW2ldOworICAgICAgICAgICAgICAgIGludCBsaW1pdCA9IHN0YXJ0ICsgKHJ1bnNbaSsxXSAmIFJVTl9MRU5HVEhfTUFTSyk7CisgICAgICAgICAgICAgICAgaWYgKGxpbWl0ID4gbGluZUVuZCkgeworICAgICAgICAgICAgICAgICAgICBsaW1pdCA9IGxpbmVFbmQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChvZmZzZXQgPj0gc3RhcnQgJiYgb2Zmc2V0IDwgbGltaXQpIHsKKyAgICAgICAgICAgICAgICAgICAgbGV2ZWxCZWZvcmUgPSAocnVuc1tpKzFdID4+PiBSVU5fTEVWRUxfU0hJRlQpICYgUlVOX0xFVkVMX01BU0s7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBsZXZlbEJlZm9yZSA8IGxldmVsQXQ7CisgICAgfQorCiAgICAgLyoqCiAgICAgICogR2V0IHRoZSBwcmltYXJ5IGhvcml6b250YWwgcG9zaXRpb24gZm9yIHRoZSBzcGVjaWZpZWQgdGV4dCBvZmZzZXQuCiAgICAgICogVGhpcyBpcyB0aGUgbG9jYXRpb24gd2hlcmUgYSBuZXcgY2hhcmFjdGVyIHdvdWxkIGJlIGluc2VydGVkIGluCiAgICAgICogdGhlIHBhcmFncmFwaCdzIHByaW1hcnkgZGlyZWN0aW9uLgogICAgICAqLwogICAgIHB1YmxpYyBmbG9hdCBnZXRQcmltYXJ5SG9yaXpvbnRhbChpbnQgb2Zmc2V0KSB7Ci0gICAgICAgIHJldHVybiBnZXRIb3Jpem9udGFsKG9mZnNldCwgZmFsc2UsIHRydWUpOworICAgICAgICBib29sZWFuIHRyYWlsaW5nID0gcHJpbWFyeUlzVHJha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3BhbltdIHRhYnMgPSAoKFNwYW5uZWQpIG1UZXh0KS5nZXRTcGFucyhzdGFydCwgZW5kLCBUYWJTdG9wU3Bhbi5jbGFzcyk7CisgICAgICAgICAgICBpZiAodGFicy5sZW5ndGggPiAwKSB7CisgICAgICAgICAgICAgICAgdGFiU3RvcHMgPSBuZXcgVGFiU3RvcHMoVEFCX0lOQ1JFTUVOVCwgdGFicyk7IC8vIFhYWCBzaG91bGQgcmV1c2UKKyAgICAgICAgICAgIH0KICAgICAgICAgfQogCi0gICAgICAgIGZsb2F0IHdpZCA9IG1lYXN1cmVUZXh0KG1QYWludCwgbVdvcmtQYWludCwgbVRleHQsIHN0YXJ0LCBvZmZzZXQsIGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlyLCBkaXJlY3Rpb25zLCB0cmFpbGluZywgYWx0LCB0YWIsIHRhYnMpOworICAgICAgICBUZXh0TGluZSB0bCA9IFRleHRMaW5lLm9idGFpbigpOworICAgICAgICB0bC5zZXQobVBhaW50LCBtVGV4dCwgc3RhcnQsIGVuZCwgZGlyLCBkaXJlY3Rpb25zLCBoYXNUYWJPckVtb2ppLCB0YWJTdG9wcyk7CisgICAgICAgIGZsb2F0IHdpZCA9IHRsLm1lYXN1cmUob2Zmc2V0IC0gc3RhcnQsIHRyYWlsaW5nLCBudWxsKTsKKyAgICAgICAgVGV4dExpbmUucmVjeWNsZSh0bCk7CiAKLSAgICAgICAgaWYgKG9mZnNldCA+IGVuZCkgewotICAgICAgICAgICAgaWYgKGRpciA9PSBESVJfUklHSFRfVE9fTEVGVCkKLSAgICAgICAgICAgICAgICB3aWQgLT0gbWVhc3VyZVRleHQobVBhaW50LCBtV29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVGV4dCwgZW5kLCBvZmZzZXQsIG51bGwsIHRhYiwgdGFicyk7Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgd2lkICs9IG1lYXN1cmVUZXh0KG1QYWludCwgbVdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRleHQsIGVuZCwgb2Zmc2V0LCBudWxsLCB0YWIsIHRhYnMpOwotICAgICAgICB9Ci0KLSAgICAgICAgQWxpZ25tZW50IGFsaWduID0gZ2V0UGFyYWdyYXBoQWxpZ25tZW50KGxpbmUpOwogICAgICAgICBpbnQgbGVmdCA9IGdldFBhcmFncmFwaExlZnQobGluZSk7CiAgICAgICAgIGludCByaWdodCA9IGdldFBhcmFncmFwaFJpZ2h0KGxpbmUpOwogCi0gICAgICAgIGlmIChhbGlnbiA9PSBBbGlnbm1lbnQuQUxJR05fTk9STUFMKSB7Ci0gICAgICAgICAgICBpZiAoZGlyID09IERJUl9SSUdIVF9UT19MRUZUKQotICAgICAgICAgICAgICAgIHJldHVybiByaWdodCArIHdpZDsKLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICByZXR1cm4gbGVmdCArIHdpZDsKLSAgICAgICAgfQotCi0gICAgICAgIGZsb2F0IG1heCA9IGdldExpbmVNYXgobGluZSk7Ci0KLSAgICAgICAgaWYgKGFsaWduID09IEFsaWdubWVudC5BTElHTl9PUFBPU0lURSkgewotICAgICAgICAgICAgaWYgKGRpciA9PSBESVJfUklHSFRfVE9fTEVGVCkKLSAgICAgICAgICAgICAgICByZXR1cm4gbGVmdCArIG1heCArIHdpZDsKLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICByZXR1cm4gcmlnaHQgLSBtYXggKyB3aWQ7Ci0gICAgICAgIH0gZWxzZSB7IC8qIGFsaWduID09IEFsaWdubWVudC5BTElHTl9DRU5URVIgKi8KLSAgICAgICAgICAgIGludCBpbWF4ID0gKChpbnQpIG1heCkgJiB+MTsKLQotICAgICAgICAgICAgaWYgKGRpciA9PSBESVJfUklHSFRfVE9fTEVGVCkKLSAgICAgICAgICAgICAgICByZXR1cm4gcmlnaHQgLSAoKChyaWdodCAtIGxl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ZSBmbG9hdCBnZXRMaW5lRXh0ZW50KGludCBsaW5lLCBib29sZWFuIGZ1bGwpIHsKICAgICAgICAgaW50IHN0YXJ0ID0gZ2V0TGluZVN0YXJ0KGxpbmUpOwotICAgICAgICBpbnQgZW5kOworICAgICAgICBpbnQgZW5kID0gZnVsbCA/IGdldExpbmVFbmQobGluZSkgOiBnZXRMaW5lVmlzaWJsZUVuZChsaW5lKTsKIAotICAgICAgICBpZiAoZnVsbCkgewotICAgICAgICAgICAgZW5kID0gZ2V0TGluZUVuZChsaW5lKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGVuZCA9IGdldExpbmVWaXNpYmxlRW5kKGxpbmUpOwotICAgICAgICB9IAotICAgICAgICBib29sZWFuIHRhYiA9IGdldExpbmVDb250YWluc1RhYihsaW5lKTsKLQotICAgICAgICBpZiAodGFicyA9PSBudWxsICYmIHRhYiAmJiBtVGV4dCBpbnN0YW5jZW9mIFNwYW5uZWQpIHsKLSAgICAgICAgICAgIHRhYnMgPSAoKFNwYW5uZWQpIG1UZXh0KS5nZXRTcGFucyhzdGFydCwgZW5kLCBUYWJTdG9wU3Bhbi5jbGFzcyk7CisgICAgICAgIGJvb2xlYW4gaGFzVGFic09yRW1vamkgPSBnZXRMaW5lQ29udGFpbnNUYWIobGluZSk7CisgICAgICAgIFRhYlN0b3BzIHRhYlN0b3BzID0gbnVsbDsKKyAgICAgICAgaWYgKGhhc1RhYnNPckVtb2ppICYmIG1UZXh0IGluc3RhbmNlb2YgU3Bhbm5lZCkgeworICAgICAgICAgICAgLy8gSnVzdCBjaGVja2luZyB0aGlzIGxpbmUgc2hvdWxkIGJlIGdvb2QgZW5vdWdoLCB0YWJzIHNob3VsZCBiZQorICAgICAgICAgICAgLy8gY29uc2lzdGVudCBhY3Jvc3MgYWxsIGxpbmVzIGluIGEgcGFyYWdyYXBoLgorICAgICAgICAgICAgVGFiU3RvcFNwYW5bXSB0YWJzID0gKChTcGFubmVkKSBtVGV4dCkuZ2V0U3BhbnMoc3RhcnQsIGVuZCwgVGFiU3RvcFNwYW4uY2xhc3MpOworICAgICAgICAgICAgaWYgKHRhYnMubGVuZ3RoID4gMCkgeworICAgICAgICAgICAgICAgIHRhYlN0b3BzID0gbmV3IFRhYlN0b3BzKFRBQl9JTkNSRU1FTlQsIHRhYnMpOyAvLyBYWFggc2hvdWxkIHJldXNlCisgICAgICAgICAgICB9CiAgICAgICAgIH0KKyAgICAgICAgRGlyZWN0aW9ucyBkaXJlY3Rpb25zID0gZ2V0TGluZURpcmVjdGlvbnMobGluZSk7CisgICAgICAgIGludCBkaXIgPSBnZXRQYXJhZ3JhcGhEaXJlY3Rpb24obGluZSk7CiAKLSAgICAgICAgcmV0dXJuIG1lYXN1cmVUZXh0KG1QYWludCwgbVdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UZXh0LCBzdGFydCwgZW5kLCBudWxsLCB0YWIsIHRhYnMpOworICAgICAgICBUZXh0TGluZSB0bCA9IFRleHRMaW5lLm9idGFpbigpOworICAgICAgICB0bC5zZXQobVBhaW50LCBtVGV4dCwgc3RhcnQsIGVuZCwgZGlyLCBkaXJlY3Rpb25zLCBoYXNUYWJzT3JFbW9qaSwgdGFiU3RvcHMpOworICAgICAgICBmbG9hdCB3aWR0aCA9IHRsLm1ldHJpY3MobnVsbCk7CisgICAgICAgIFRleHRMaW5lLnJlY3ljbGUodGwpOworICAgICAgICByZXR1cm4gd2lkdGg7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgc2lnbmVkIGhvcml6b250YWwgZXh0ZW50IG9mIHRoZSBzcGVjaWZpZWQgbGluZSwgZXhjbHVkaW5nCisgICAgICogbGVhZGluZyBtYXJnaW4uICBJZiBmdWxsIGlzIGZhbHNlLCBleGNsdWRlcyB0cmFpbGluZyB3aGl0ZXNwYWNlLgorICAgICAqIEBwYXJhbSBsaW5lIHRoZSBpbmRleCBvZiB0aGUgbGluZQorICAgICAqIEBwYXJhbSB0YWJTdG9wcyB0aGUgdGFiIHN0b3BzLCBjYW4gYmUgbnVsbCBpZiB3ZSBrbm93IHRoZXkncmUgbm90IHVzZWQuCisgICAgICogQHBhcmFtIGZ1bGwgd2hldGhlciB0byBpbmNsdWRlIHRyYWlsaW5nIHdoaXRlc3BhY2UKKyAgICAgKiBAcmV0dXJuIHRoZSBleHRlbnQgb2YgdGhlIHRleHQgb24gdGhpcyBsaW5lCisgICAgICovCisgICAgcHJpdmF0ZSBmbG9hdCBnZXRMaW5lRXh0ZW50KGludCBsaW5lLCBUYWJTdG9wcyB0YWJTdG9wcywgYm9vbGVhbiBmdWxsKSB7CisgICAgICAgIGludCBzdGFydCA9IGdldExpbmVTdGFydChsaW5lKTsKKyAgICAgICAgaW50IGVuZCA9IGZ1bGwgPyBnZXRMaW5lRW5kKGxpbmUpIDogZ2V0TGluZVZpc2libGVFbmQobGluZSk7CisgICAgICAgIGJvb2xlYW4gaGFzVGFic09yRW1vamkgPSBnZXRMaW5lQ29udGFpbnNUYWIobGluZSk7CisgICAgICAgIERpcmVjdGlvbnMgZGlyZWN0aW9ucyA9IGdldExpbmVEaXJlY3Rpb25zKGxpbmUpOworICAgICAgICBpbnQgZGlyID0gZ2V0UGFyYWdyYXBoRGlyZWN0aW9uKGxpbmUpOworCisgICAgICAgIFRleHRMaW5lIHRsID0gVGV4dExpbmUub2J0YWluKCk7CisgICAgICAgIHRsLnNldChtUGFpbnQsIG1UZXh0LCBzdGFydCwgZW5kLCBkaXIsIGRpcmVjdGlvbnMsIGhhc1RhYnNPckVtb2ppLCB0YWJTdG9wcyk7CisgICAgICAgIGZsb2F0IHdpZHRoID0gdGwubWV0cmljcyhudWxsKTsKKyAgICAgICAgVGV4dExpbmUucmVjeWNsZSh0bCk7CisgICAgICAgIHJldHVybiB3aWR0aDsKICAgICB9CiAKICAgICAvKioKQEAgLTczOCw3ICs5MDUsNyBAQAogICAgIH0KIAogICAgIC8qKgotICAgICAqIEdldCB0aGUgY2hhc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ICAgICBpZiAodGhlcmUgPiBtYXgpCiAgICAgICAgICAgICAgICAgdGhlcmUgPSBtYXg7Ci0KICAgICAgICAgICAgIGludCBoaWdoID0gdGhlcmUgLSAxICsgMSwgbG93ID0gaGVyZSArIDEgLSAxLCBndWVzczsKIAogICAgICAgICAgICAgd2hpbGUgKGhpZ2ggLSBsb3cgPiAxKSB7CkBAIC03OTIsNyArOTU4LDcgQEAKIAogICAgICAgICAgICAgICAgIGlmIChkaXN0IDwgYmVzdGRpc3QpIHsKICAgICAgICAgICAgICAgICAgICAgYmVzdGRpc3QgPSBkaXN0OwotICAgICAgICAgICAgICAgICAgICBiZXN0ID0gbG93OyAgIAorICAgICAgICAgICAgICAgICAgICBiZXN0ID0gbG93OwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KIApAQCAtODAyLDggKzk2OCw2IEBACiAgICAgICAgICAgICAgICAgYmVzdGRpc3QgPSBkaXN0OwogICAgICAgICAgICAgICAgIGJlc3QgPSBoZXJlOwogICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBoZXJlID0gdGhlcmU7CiAgICAgICAgIH0KIAogICAgICAgICBmbG9hdCBkaXN0ID0gTWF0aC5hYnMoZ2V0UHJpbWFyeUhvcml6b250YWwobWF4KSAtIGhvcml6KTsKQEAgLTgyMywxOSArOTg3LDE1IEBACiAgICAgICAgIHJldHVybiBnZXRMaW5lU3RhcnQobGluZSArIDEpOwogICAgIH0KIAotICAgIC8qKiAKKyAgICAvKioKICAgICAgKiBSZXR1cm4gdGhlIHRleHQgb2Zmc2V0IGFmdGVyIHRoZSBsYXN0IHZpc2libGUgY2hhcmFjdGVyIChzbyB3aGl0ZXNwYWNlCiAgICAgICogaXMgbm90IGNvdW50ZWQpIG9uIHRoZSBzcGVjaWZpZWQgbGluZS4KICAgICAgKi8KICAgICBwdWJsaWMgaW50IGdldExpbmVWaXNpYmxlRW5kKGludCBsaW5lKSB7CiAgICAgICAgIHJldHVybiBnZXRMaW5lVmlzaWJsZUVuZChsaW5lLCBnZXRMaW5lU3RhcnQobGluZSksIGdldExpbmVTdGFydChsaW5lKzEpKTsKICAgICB9Ci0gICAgCi0gICAgcHJpdmF0ZSBpbnQgZ2V0TGluZVZpc2libGVFbmQoaW50IGxpbmUsIGludCBzdGFydCwgaW50IGVuZCkgewotICAgICAgICBpZiAoREVCVUcpIHsKLSAgICAgICAgICAgIEFzc2VydC5hc3NlcnRUcnVlKGdldExpbmVTdGFydChsaW5lKSA9PSBzdGFydCAmJiBnZXRMaW5lU3RhcnQobGluZSsxKSA9PSBlbmQpOwotICAgICAgICB9CiAKKyAgICBwcml2YXRlIGludCBnZXRMaW5lVmlzaWJsZUVuZChpbnQgbGluZSwgaW50IHN0YXJ0LCBpbnQgZW5kKSB7CiAgICAgICAgIENoYXJTZXF1ZW5jZSB0ZXh0ID0gbVRleHQ7CiAgICAgICAgIGNoYXIgY2g7CiAgICAgICAgIGlmIChsaW5lID09IGdldExpbmVDb3VudCgpIC0gMSkgewpAQCAtODgyLDIwNyArMTA0Miw2MiBAQAogICAgICAgICByZXR1cm4gZ2V0TGluZVRvcChsaW5lKSAtIChnZXRMaW5lVG9wKGxpbmUrMSkgLSBnZXRMaW5lRGVzY2VudChsaW5lKSk7CiAgICAgfQogCi0gICAgLyoqCi0gICAgICogUmV0dXJuIHRoZSB0ZXh0IG9mZnNldCB0aGF0IHdvdWxkIGJlIHJlYWNoZWQgYnkgbW92aW5nIGxlZnQKLSAgICAgKiAocG9zc2libHkgb250byBhbm90aGVyIGxpbmUpIGZyb20gdGhlIHNwZWNpZmllZCBvZmZzZXQuCi0gICAgICovCiAgICAgcHVibGljIGludCBnZXRPZmZzZXRUb0xlZnRPZihpbnQgb2Zmc2V0KSB7Ci0gICAgICAgIGludCBsaW5lID0gZ2V0TGluZUZvck9mZnNldChvZmZzZXQpOwotICAgICAgICBpbnQgc3RhcnQgPSBnZXRMaW5lU3RhcnQobGluZSk7Ci0gICAgICAgIGludCBlbmQgPSBnZXRMaW5lR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RlOwotICAgICAgICAgICAgICAgIGJlc3RoID0gaDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGludCBoZXJlID0gc3RhcnQ7Ci0gICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgZGlycy5tRGlyZWN0aW9ucy5sZW5ndGg7IGkrKykgewotICAgICAgICAgICAgaW50IHRoZXJlID0gaGVyZSArIGRpcnMubURpcmVjdGlvbnNbaV07Ci0gICAgICAgICAgICBpZiAodGhlcmUgPiBlbmQpCi0gICAgICAgICAgICAgICAgdGhlcmUgPSBlbmQ7Ci0KLSAgICAgICAgICAgIGZsb2F0IGggPSBnZXRQcmltYXJ5SG9yaXpvbnRhbChoZXJlKTsKLQotICAgICAgICAgICAgaWYgKGggPCBob3JpeiAmJiBoID4gYmVzdGgpIHsKLSAgICAgICAgICAgICAgICBiZXN0ID0gaGVyZTsKLSAgICAgICAgICAgICAgICBiZXN0aCA9IGg7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhbmRpZGF0ZSA9IFRleHRVdGlscy5nZXRPZmZzZXRBZnRlcihtVGV4dCwgaGVyZSk7Ci0gICAgICAgICAgICBpZiAoY2FuZGlkYXRlID49IHN0YXJ0ICYmIGNhbmRpZGF0ZSA8PSBlbmQpIHsKLSAgICAgICAgICAgICAgICBoID0gZ2V0UHJpbWFyeUhvcml6b250YWwoY2FuZGlkYXRlKTsKLQotICAgICAgICAgICAgICAgIGlmIChoIDwgaG9yaXogJiYgaCA+IGJlc3RoKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJlc3QgPSBjYW5kaWRhdGU7Ci0gICAgICAgICAgICAgICAgICAgIGJlc3RoID0gaDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhbmRpZGF0ZSA9IFRleHRVdGlscy5nZXRPZmZzZXRCZWZvcmUobVRleHQsIHRoZXJlKTsKLSAgICAgICAgICAgIGlmIChjYW5kaWRhdGUgPj0gc3RhcnQgJiYgY2FuZGlkYXRlIDw9IGVuZCkgewotICAgICAgICAgICAgICAgIGggPSBnZXRQcmltYXJ5SG9yaXpvbnRhbChjYW5kaWRhdGUpOwotCi0gICAgICAgICAgICAgICAgaWYgKGggPCBob3JpeiAmJiBoID4gYmVzdGgpIHsKLSAgICAgICAgICAgICAgICAgICAgYmVzdCA9IGNhbmRpZGF0ZTsKLSAgICAgICAgICAgICAgICAgICAgYmVzdGggPSBoOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaGVyZSA9IHRoZXJlOwotICAgICAgICB9Ci0KLSAgICAgICAgZmxvYXQgaCA9IGdldFByaW1hcnlIb3Jpem9udGFsKGVuZCk7Ci0KLSAgICAgICAgaWYgKGggPCBob3JpeiAmJiBoID4gYmVzdGgpIHsKLSAgICAgICAgICAgIGJlc3QgPSBlbmQ7Ci0gICAgICAgICAgICBiZXN0aCA9IGg7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoYmVzdCAhPSBvZmZzZXQpCi0gICAgICAgICAgICByZXR1cm4gYmVzdDsKLQotICAgICAgICBpbnQgZGlyID0gZ2V0UGFyYWdyYXBoRGlyZWN0aW9uKGxpbmUpOwotCi0gICAgICAgIGlmIChkaXIgPiAwKSB7Ci0gICAgICAgICAgICBpZiAobGluZSA9PSAwKQotICAgICAgICAgICAgICAgIHJldHVybiBiZXN0OwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHJldHVybiBnZXRPZmZzZXRGb3JIb3Jpem9udGFsKGxpbmUgLSAxLCAxMDAwMCk7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAobGluZSA9PSBnZXRMaW5lQ291bnQoKSAtIDEpCi0gICAgICAgICAgICAgICAgcmV0dXJuIGJlc3Q7Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgcmV0dXJuIGdldE9mZnNldEZvckhvcml6b250YWwobGluZSArIDEsIDEwMDAwKTsKLSAgICAgICAgfQorICAgICAgICByZXR1cm4gZ2V0T2Zmc2V0VG9MZWZ0UmlnaHRPZihvZmZzZXQsIHRydWUpOwogICAgIH0KIAotICAgIC8qKgotICAgICAqIFJldHVybiB0aGUgdGV4dCBvZmZzZXQgdGhhdCB3b3VsZCBiZSByZWFjaGVkIGJ5IG1vdmluZyByaWdodAotICAgICAqIChwb3NzaWJseSBvbnRvIGFub3RoZXIgbGluZSkgZnJvbSB0aGUgc3BlY2lmaWVkIG9mZnNldC4KLSAgICAgKi8KICAgICBwdWJsaWMgaW50IGdldE9mZnNldFRvUmlnaHRPZihpbnQgb2Zmc2V0KSB7Ci0gICAgICAgIGludCBsaW5lID0gZ2V0TGluZUZvck9mZnNldChvZmZzZXQpOwotICAgICAgICBpbnQgc3RhcnQgPSBnZXRMaW5lU3RhcnQobGluZSk7Ci0gICAgICAgIGludCBlbmQgPSBnZXRMaW5lRW5kKGxpbmUpOwotICAgICAgICBEaXJlY3Rpb25zIGRpcnMgPSBnZXRMaW5lRGlyZWN0aW9ucyhsaW5lKTsKKyAgICAgICAgcmV0dXJuIGdldE9mZnNldFRvTGVmdFJpZ2h0T2Yob2Zmc2V0LCBmYWxzZSk7CisgICAgfQogCi0gICAgICAgIGlmIChsaW5lICE9IGdldExpbmVDb3VudCgpIC0gMSkKLSAgICAgICAgICAgIGVuZC0tOworICAgIHByaXZhdGUgaW50IGdldE9mZnNldFRvTGVmdFJpZ2h0T2YoaW50IGNhcmV0LCBib29sZWFuIHRvTGVmdCkgeworICAgICAgICBpbnQgbGluZSA9IGdldExpbmVGb3JPZmZzZXQoY2FyZXQpOworICAgICAgICBpbnQgbGluZVN0YXJ0ID0gZ2V0TGluZVN0YXJ0KGxpbmUpOworICAgICAgICBpbnQgbGluZUVuZCA9IGdldExpbmVFbmQobGluZSk7CisgICAgICAgIGludCBsaW5lRGlyID0gZ2V0UGFyYWdyYXBoRGlyZWN0aW9uKGxpbmUpOwogCi0gICA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d0aDsgaSsrKSB7Ci0gICAgICAgICAgICBpbnQgdGhlcmUgPSBoZXJlICsgZGlycy5tRGlyZWN0aW9uc1tpXTsKLSAgICAgICAgICAgIGlmICh0aGVyZSA+IGVuZCkKLSAgICAgICAgICAgICAgICB0aGVyZSA9IGVuZDsKLQotICAgICAgICAgICAgZmxvYXQgaCA9IGdldFByaW1hcnlIb3Jpem9udGFsKGhlcmUpOwotCi0gICAgICAgICAgICBpZiAoaCA+IGhvcml6ICYmIGggPCBiZXN0aCkgewotICAgICAgICAgICAgICAgIGJlc3QgPSBoZXJlOwotICAgICAgICAgICAgICAgIGJlc3RoID0gaDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FuZGlkYXRlID0gVGV4dFV0aWxzLmdldE9mZnNldEFmdGVyKG1UZXh0LCBoZXJlKTsKLSAgICAgICAgICAgIGlmIChjYW5kaWRhdGUgPj0gc3RhcnQgJiYgY2FuZGlkYXRlIDw9IGVuZCkgewotICAgICAgICAgICAgICAgIGggPSBnZXRQcmltYXJ5SG9yaXpvbnRhbChjYW5kaWRhdGUpOwotCi0gICAgICAgICAgICAgICAgaWYgKGggPiBob3JpeiAmJiBoIDwgYmVzdGgpIHsKLSAgICAgICAgICAgICAgICAgICAgYmVzdCA9IGNhbmRpZGF0ZTsKLSAgICAgICAgICAgICAgICAgICAgYmVzdGggPSBoOworICAgICAgICBib29sZWFuIGFkdmFuY2UgPSB0b0xlZnQgPT0gKGxpbmVEaXIgPT0gRElSX1JJR0hUX1RPX0xFRlQpOworICAgICAgICBpZiAoY2FyZXQgPT0gKGFkdmFuY2UgPyBsaW5lRW5kIDogbGluZVN0YXJ0KSkgeworICAgICAgICAgICAgLy8gd2Fsa2luZyBvZmYgbGluZSwgc28gbG9vayBhdCB0aGUgbGluZSB3ZSdyZSBoZWFkZWQgdG8KKyAgICAgICAgICAgIGlmIChjYXJldCA9PSBsaW5lU3RhcnQpIHsKKyAgICAgICAgICAgICAgICBpZiAobGluZSA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgLS1saW5lOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBjYXJldDsgLy8gYXQgdmVyeSBzdGFydCwgZG9uJ3QgbW92ZQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgaWYgKGxpbmUgPCBnZXRMaW5lQ291bnQoKSAtIDEpIHsKKyAgICAgICAgICAgICAgICAgICAgKytsaW5lOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBjYXJldDsgLy8gYXQgdmVyeSBlbmQsIGRvbid0IG1vdmUKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIGNhbmRpZGF0ZSA9IFRleHRVdGlscy5nZXRPZmZzZXRCZWZvcmUobVRleHQsIHRoZXJlKTsKLSAgICAgICAgICAgIGlmIChjYW5kaWRhdGUgPj0gc3RhcnQgJiYgY2FuZGlkYXRlIDw9IGVuZCkgewotICAgICAgICAgICAgICAgIGggPSBnZXRQcmltYXJ5SG9yaXpvbnRhbChjYW5kaWRhdGUpOwotCi0gICAgICAgICAgICAgICAgaWYgKGggPiBob3JpeiAmJiBoIDwgYmVzdGgpIHsKLSAgICAgICAgICAgICAgICAgICAgYmVzdCA9IGNhbmRpZGF0ZTsKLSAgICAgICAgICAgICAgICAgICAgYmVzdGggPSBoOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGxpbmVTdGFydCA9IGdldExpbmVTdGFydChsaW5lKTsKKyAgICAgICAgICAgIGxpbmVFbmQgPSBnZXRMaW5lRW5kKGxpbmUpOworICAgICAgICAgICAgaW50IG5ld0RpciA9IGdldFBhcmFncmFwaERpcmVjdGlvbihsaW5lKTsKKyAgICAgICAgICAgIGlmIChuZXdEaXIgIT0gbGluZURpcikgeworICAgICAgICAgICAgICAgIC8vIHVudXN1YWwgY2FzZS4gIHdlIHdhbnQgdG8gd2FsayBvbnRvIHRoZSBsaW5lLCBidXQgaXQgcnVucworICAgICAgICAgICAgICAgIC8vIGluIGEgZGlmZmVyZW50IGRpcmVjdGlvbiB0aGFuIHRoaXMgb25lLCBzbyB3ZSBmYWtlIG1vdmVtZW50CisgICAgICAgICAgICAgICAgLy8gaW4gdGhlIG9wcG9zaXRlIGRpcmVjdGlvbi4KKyAgICAgICAgICAgICAgICB0b0xlZnQgPSAhdG9MZWZ0OworICAgICAgICAgICAgICAgIGxpbmVEaXIgPSBuZXdEaXI7CiAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGhlcmUgPSB0aGVyZTsKICAgICAgICAgfQogCi0gICAgICAgIGZsb2F0IGggPSBnZXRQcmltYXJ5SG9yaXpvbnRhbChlbmQpOworICAgICAgICBEaXJlY3Rpb25zIGRpcmVjdGlvbnMgPSBnZXRMaW5lRGlyZWN0aW9ucyhsaW5lKTsKIAotICAgICAgICBpZiAoaCA+IGhvcml6ICYmIGggPCBiZXN0aCkgewotICAgICAgICAgICAgYmVzdCA9IGVuZDsKLSAgICAgICAgICAgIGJlc3RoID0gaDsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChiZXN0ICE9IG9mZnNldCkKLSAgICAgICAgICAgIHJldHVybiBiZXN0OwotCi0gICAgICAgIGludCBkaXIgPSBnZXRQYXJhZ3JhcGhEaXJlY3Rpb24obGluZSk7Ci0KLSAgICAgICAgaWYgKGRpciA+IDApIHsKLSAgICAgICAgICAgIGlmIChsaW5lID09IGdldExpbmVDb3VudCgpIC0gMSkKLSAgICAgICAgICAgICAgICByZXR1cm4gYmVzdDsKLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICByZXR1cm4gZ2V0T2Zmc2V0Rm9ySG9yaXpvbnRhbChsaW5lICsgMSwgLTEwMDAwKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGlmIChsaW5lID09IDApCi0gICAgICAgICAgICAgICAgcmV0dXJuIGJlc3Q7Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgcmV0dXJuIGdldE9mZnNldEZvckhvcml6b250YWwobGluZSAtIDEsIC0xMDAwMCk7Ci0gICAgICAgIH0KKyAgICAgICAgVGV4dExpbmUgdGwgPSBUZXh0TGluZS5vYnRhaW4oKTsKKyAgICAgICAgLy8gWFhYOiB3ZSBkb24ndCBjYXJlIGFib3V0IHRhYnMKKyAgICAgICAgdGwuc2V0KG1QYWludCwgbVRleHQsIGxpbmVTdGFydCwgbGluZUVuZCwgbGluZURpciwgZGlyZWN0aW9ucywgZmFsc2UsIG51bGwpOworICAgICAgICBjYXJldCA9IGxpbmVTdGFydCArIHRsLmdldE9mZnNldFRvTGVmdFJpZ2h0T2YoY2FyZXQgLSBsaW5lU3RhcnQsIHRvTGVmdCk7CisgICAgICAgIHRsID0gVGV4dExpbmUucmVjeWNsZSh0bCk7CisgICAgICAgIHJldHVybiBjYXJldDsKICAgICB9CiAKICAgICBwcml2YXRlIGludCBnZXRPZmZzZXRBdFN0YXJ0T2YoaW50IG9mZnNldCkgeworICAgICAgICAvLyBYWFggdGhpcyBwcm9iYWJseSBzaG91bGQgc2tpcCBsb2NhbCByZW9yZGVyaW5ncyBhbmQKKyAgICAgICAgLy8gemVyby13aWR0aCBjaGFyYWN0ZXJzLCBsb29rIGF0IGNhbGxlcnMKICAgICAgICAgaWYgKG9mZnNldCA9PSAwKQogICAgICAgICAgICAgcmV0dXJuIDA7CiAKQEAgLTExMTUsNyArMTEzMCw3IEBACiAgICAgLyoqCiAgICAgICogRmlsbHMgaW4gdGhlIHNwZWNpZmllZCBQYXRoIHdpdGggYSByZXByZXNlbnRhdGlvbiBvZiBhIGN1cnNvcgogICAgICAqIGF0IHRoZSBzcGVjaWZpZWQgb2Zmc2V0LiAgVGhpcyB3aWxsIG9mdGVuIGJlIGEgdmVydGljYWwgbGluZQotICAgICAqIGJ1dCBjYW4gYmUgbXVsdGlwbGUgZGlzY29udGlub3VzIGxpbmVzIGluIHRleHQgd2l0aCBtdWx0aXBsZQorICAgICAqIGJ1dCBjYW4gYmUgbXVsdGlwbGUgZGlzY29udGludW91cyBsaW5lcyBpbiB0ZXh0IHdpdGggbXVsdGlwbGUKICAgICAgKiBkaXJlY3Rpb25hbGl0aWVzLgogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIGdldEN1cnNvclBhdGgoaW50IHBvaW50LCBQYXRoIGRlc3QsCkBAIC0xMTI3LDcgKzExNDIsOCBAQAogICAgICAgICBpbnQgYm90dG9tID0gZ2V0TGluZVRvcChsaW5lKzEpOwogCiAgICAgICAgIGZsb2F0IGgxID0gZ2V0UHJpbWFyeUhvcml6b250YWwocG9pbnQpIC0gMC41ZjsKLSAgICAgICAgZmxvYXQgaDIgPSBnZXRTZWNvbmRhcnlIb3Jpem9udGFsKHBvaW50KSAtIDAuNWY7CisgICAgICAgIGZsb2F0IGgyID0gaXNMZXZlbEJvdW5kYXJ5KHBvaW50KSA/CisgICAgICAgICAgICAgICAgICAgIGdldFNlY29uZGFyeUhvcml6b250YWwocG9pbnQpIC0gMC41ZiA6IGgxOwogCiAgICAgICAgIGludCBjYXBzID0gVGV4dEtleUxpc3RlbmVyLmdldE1ldGFTdGF0ZShlZGl0aW5nQnVmZmVyLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgS2V5RXZlbnQuTUVUQV9TSElGVF9PTikgfApAQCAtMTIwNCw5ICsxMjIwLDEwIEBACiAgICAgICAgIGlmIChsaW5lZW5kID4gbGluZXN0YXJ0ICYmIG1UZXh0LmNoYXJBdChsaW5lZW5kIC0gMSkgPT0gJ1xuJykKICAgICAgICAgICAgIGxpbmVlbmQtLTsKIAotICAgICAgICBpbnQgaGVyZSA9IGxpbmVzdGFydDsKLSAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBkaXJzLm1EaXJlY3Rpb25zLmxlbmd0aDsgaSsrKSB7Ci0gICAgICAgICAgICBpbnQgdGhlcmUgPSBoZXJlICsgZGlycy5tRGlyZWN0aW9uc1tpXTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBkaXJzLm1EaXJlY3Rpb25zLmxlbmd0aDsgaSArPSAyKSB7CisgICAgICAgICAgICBpbnQgaGVyZSA9IGxpbmVzdGFydCArIGRpcnMubURpcmVjdGlvbnNbaV07CisgICAgICAgICAgICBpbnQgdGhlcmUgPSBoZXJlICsgKGRpcnMubURpcmVjdGlvbnNbaSsxXSAmIFJVTl9MRU5HVEhfTUFTSyk7CisKICAgICAgICAgICAgIGlmICh0aGVyZSA+IGxpbmVlbmQpCiAgICAgICAgICAgICAgICAgdGhlcmUgPSBsaW5lZW5kOwogCkBAIC0xMjE1LDE0ICsxMjMyLDEyIEBACiAgICAgICAgICAgICAgICAgaW50IGVuID0gTWF0aC5taW4oZW5kLCB0aGVyZSk7CiAKICAgICAgICAgICAgICAgICBpZiAoc3QgIT0gZW4pIHsKLSAgICAgICAgICAgICAgICAgICAgZmxvYXQgaDEgPSBnZXRIb3Jpem9udGFsKHN0LCBmYWxzZSwgZmFsc2UsIGxpbmUpOwotICAgICAgICAgICAgICAgICAgICBmbG9hdCBoMiA9IGdldEhvcml6b250YWwoZW4sIHRydWUsIGZhbHNlLCBsaW5lKTsKKyAgICAgICAgICAgICAgICAgICAgZmxvYXQgaDEgPSBnZXRIb3Jpem9udGFsKHN0LCBmYWxzZSwgbGluZSk7CisgICAgICAgICAgICAgICAgICAgIGZsb2F0IGgyID0gZ2V0SG9yaXpvbnRhbChlbiwgdHJ1ZSwgbGluZSk7CiAKICAgICAgICAgICAgICAgICAgICAgZGVzdC5hZGRSZWN0KGgxLCB0b3AsIGgyLCBib3R0b20sIFBhdGguRGlyZWN0aW9uLkNXKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGhlcmUgPSB0aGVyZTsKICAgICAgICAgfQogICAgIH0KIApAQCAtMTI1Nyw3ICsxMjcyLDcgQEAKIAogICAgICAgICAgICAgYWRkU2VsZWN0aW9uKHN0YXJ0bGluZSwgc3RhcnQsIGdldExpbmVFbmQoc3RhcnRsaW5lKSwKICAgICAgICAgICAgICAgICAgICAgICAgICB0b3AsIGdldExpbmVCb3R0b20oc3RhcnRsaW5lKSwgZGVzdCk7Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgaWYgKGdldFBhcmFncmFwaERpcmVjdGlvbihzdGFydGxpbmUpID09IERJUl9SSUdIVF9UT19MRUZUKQogICAgICAgICAgICAgICAgIGRlc3QuYWRkUmVjdChnZXRMaW5lTGVmdChzdGFydGxpbmUpLCB0b3AsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCBnZXRMaW5lQm90dG9tKHN0YXJ0bGluZSksIFBhdGguRGlyZWN0aW9uLkNXKTsKQEAgLTEzMTAsNDIyICsxMzI1LDE3MyBAQAogICAgICAqIEdldCB0aGUgbGVmdCBlZGdlIG9mIHRoZSBzcGVjaWZpZWQgcGFyYWdyYXBoLCBpbnNldCBieSBsZWZ0IG1hcmdpbnMuCiAgICAgICovCiAgICAgcHVibGljIGZpbmFsIGludCBnZXRQYXJhZ3JhcGhMZWZ0KGludCBsaW5lKSB7Ci0gICAgICAgIGludCBkaXIgPSBnZXRQYXJhZ3JhcGhEaXJlY3Rpb24obGluZSk7Ci0KICAgICAgICAgaW50IGxlZnQgPSAwOwotCi0gICAgICAgIGJvb2xlYW4gcGFyID0gZmFsc2U7Ci0gICAgICAgIGludCBvZmYgPSBnZXRMaW5lU3RhcnQobGluZSk7Ci0gICAgICAgIGlmIChvZmYgPT0gMCB8fCBtVGV4dC5jaGFyQXQob2ZmIC0gMSkgPT0gJ1xuJykKLSAgICAgICAgICAgIHBhciA9IHRydWU7Ci0KLSAgICAgICAgaWYgKGRpciA9PSBESVJfTEVGVF9UT19SSUdIVCkgewotICAgICAgICAgICAgaWYgKG1TcGFubmVkVGV4dCkgewotICAgICAgICAgICAgICAgIFNwYW5uZWQgc3AgPSAoU3Bhbm5lZCkgbVRleHQ7Ci0gICAgICAgICAgICAgICAgTGVhZGluZ01hcmdpblNwYW5bXSBzcGFucyA9IHNwLmdldFNwYW5zKGdldExpbmVTdGFydChsaW5lKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0TGluZUVuZChsaW5lKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGVhZGluZ01hcmdpblNwYW4uY2xhc3MpOwotCi0gICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzcGFucy5sZW5ndGg7IGkrKykgewotICAgICAgICAgICAgICAgICAgICBib29sZWFuIG1hcmdpbiA9IHBhcjsKLSAgICAgICAgICAgICAgICAgICAgTGVhZGluZ01hcmdpblNwYW4gc3BhbiA9IHNwYW5zW2ldOwotICAgICAgICAgICAgICAgICAgICBpZiAoc3BhbiBpbnN0YW5jZW9mIExlYWRpbmdNYXJnaW5TcGFuLkxlYWRpbmdNYXJnaW5TcGFuMikgewotICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNvdW50ID0gKChMZWFkaW5nTWFyZ2luU3Bhbi5MZWFkaW5nTWFyZ2luU3BhbjIpc3BhbikuZ2V0TGVhZGluZ01hcmdpbkxpbmVDb3VudCgpOwotICAgICAgICAgICAgICAgICAgICAgICAgbWFyZ2luID0gY291bnQgPj0gbGluZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBsZWZ0ICs9IHNwYW4uZ2V0TGVhZGluZ01hcmdpbihtYXJnaW4pOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KKyAgICAgICAgaW50IGRpciA9IGdldFBhcmFncmFwaERpcmVjdGlvbihsaW5lKTsKKyAgICAgICAgaWYgKGRpciA9PSBESVJfUklHSFRfVE9fTEVGVCB8fCAhbVNwYW5uZWRUZXh0KSB7CisgICAgICAgICAgICByZXR1cm4gbGVmdDsgLy8gbGVhZGluZyBtYXJnaW4gaGFzIG5vIGltcGFjdCwgb3Igbm8gc3R5bGVzCiAgICAgICAgIH0KLQotICAgICAgICByZXR1cm4gbGVmdDsKKyAgICAgICAgcmV0dXJuIGdldFBhcmFncmFwaExlYWRpbmdNYXJnaW4obGluZSk7CiAgICAgfQogCiAgICAgLyoqCiAgICAgICogR2V0IHRoZSByaWdodCBlZGdlIG9mIHRoZSBzcGVjaWZpZWQgcGFyYWdyYXBoLCBpbnNldCBieSByaWdodCBtYXJnaW5zLgogICAgICAqLwogICAgIHB1YmxpYyBmaW5hbCBpbnQgZ2V0UGFyYWdyYXBoUmlnaHQoaW50IGxpbmUpIHsKLSAgICAgICAgaW50IGRpciA9IGdldFBhcmFncmFwaERpcmVjdGlvbihsaW5lKTsKLQogICAgICAgICBpbnQgcmlnaHQgPSBtV2lkdGg7Ci0KLSAgICAgICAgYm9vbGVhbiBwYXIgPSBmYWxzZTsKLSAgICAgICAgaW50IG9mZiA9IGdldExpbmVTdGFydChsaW5lKTsKLSAgICAgICAgaWYgKG9mZiA9PSAwIHx8IG1UZXh0LmNoYXJBdChvZmYgLSAxKSA9PSAnXG4nKQotICAgICAgICAgICAgcGFyID0gdHJ1ZTsKLQotCi0gICAgICAgIGlmIChkaXIgPT0gRElSX1JJR0hUX1RPX0xFRlQpIHsKLSAgICAgICAgICAgIGlmIChtU3Bhbm5lZFRleHQpIHsKLSAgICAgICAgICAgICAgICBTcGFubmVkIHNwID0gKFNwYW5uZWQpIG1UZXh0OwotICAgICAgICAgICAgICAgIExlYWRpbmdNYXJnaW5TcGFuW10gc3BhbnMgPSBzcC5nZXRTcGFucyhnZXRMaW5lU3RhcnQobGluZSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldExpbmVFbmQobGluZSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExlYWRpbmdNYXJnaW5TcGFuLmNsYXNzKTsKLQotICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgc3BhbnMubGVuZ3RoOyBpKyspIHsKLSAgICAgICAgICAgICAgICAgICAgcmlnaHQgLT0gc3BhbnNbaV0uZ2V0TGVhZGluZ01hcmdpbihwYXIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KKyAgICAgICAgaW50IGRpciA9IGdldFBhcmFncmFwaERpcmVjdGlvbihsaW5lKTsKKyAgICAgICAgaWYgKGRpciA9PSBESVJfTEVGVF9UT19SSUdIVCB8fCAhbVNwYW5uZWRUZXh0KSB7CisgICAgICAgICAgICByZXR1cm4gcmlnaHQ7IC8vIGxlYWRpbmcgbWFyZ2luIGhhcyBubyBpbXBhY3QsIG9yIG5vIHN0eWxlcwogICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIHJpZ2h0OwotICAgIH0KLQotICAgIHByaXZhdGUgdm9pZCBkcmF3VGV4dChDYW52YXMgY2FudmFzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2hhclNlcXVlbmNlIHRleHQsIGludCBzdGFydCwgaW50IGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBkaXIsIERpcmVjdGlvbnMgZGlyZWN0aW9ucywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHgsIGludCB0b3AsIGludCB5LCBpbnQgYm90dG9tLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGV4dFBhaW50IHBhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGV4dFBhaW50IHdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gaGFzVGFicywgT2JqZWN0W10gcGFyc3BhbnMpIHsKLSAgICAgICAgY2hhcltdIGJ1ZjsKLSAgICAgICAgaWYgKCFoYXNUYWJzKSB7Ci0gICAgICAgICAgICBpZiAoZGlyZWN0aW9ucyA9PSBESVJTX0FMTF9MRUZUX1RPX1JJR0hUKSB7Ci0gICAgICAgICAgICAgICAgaWYgKERFQlVHKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFzc2VydC5hc3NlcnRUcnVlKERJUl9MRUZUX1RPX1JJR0hUID09IGRpcik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIFN0eWxlZC5kcmF3VGV4dChjYW52YXMsIHRleHQsIHN0YXJ0LCBlbmQsIGRpciwgZmFsc2UsIHgsIHRvcCwgeSwgYm90dG9tLCBwYWludCwgd29ya1BhaW50LCBmYWxzZSk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnVmID0gbnVsbDsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGJ1ZiA9IFRleHRVdGlscy5vYnRhaW4oZW5kIC0gc3RhcnQpOwotICAgICAgICAgICAgVGV4dFV0aWxzLmdldENoYXJzKHRleHQsIHN0YXJ0LCBlbmQsIGJ1ZiwgMCk7Ci0gICAgICAgIH0KLQotICAgICAgICBmbG9hdCBoID0gMDsKLQotICAgICAgICBpbnQgaGVyZSA9IDA7Ci0gICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgZGlyZWN0aW9ucy5tRGlyZWN0aW9ucy5sZW5ndGg7IGkrKykgewotICAgICAgICAgICAgaW50IHRoZXJlID0gaGVyZSArIGRpcmVjdGlvbnMubURpcmVjdGlvbnNbaV07Ci0gICAgICAgICAgICBpZiAodGhlcmUgPiBlbmQgLSBzdGFydCkKLSAgICAgICAgICAgICAgICB0aGVyZSA9IGVuZCAtIHN0YXJ0OwotCi0gICAgICAgICAgICBpbnQgc2Vnc3RhcnQgPSBoZXJlOwotICAgICAgICAgICAgZm9yIChpbnQgaiA9IGhhc1RhYnMgPyBoZXJlIDogdGhlcmU7IGogPD0gdGhlcmU7IGorKykgewotICAgICAgICAgICAgICAgIGlmIChqID09IHRoZXJlIHx8IGJ1ZltqXSA9PSAnXHQnKSB7Ci0gICAgICAgICAgICAgICAgICAgIGggKz0gU3R5bGVkLmRyYXdUZXh0KGNhbnZhcywgdGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgKyBzZWdzdGFydCwgc3RhcnQgKyBqLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXIsIChpICYgMSkgIT0gMCwgeCArIGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvcCwgeSwgYm90dG9tLCBwYWludCwgd29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydCArIGogIT0gZW5kKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoaiAhPSB0aGVyZSAmJiBidWZbal0gPT0gJ1x0JykKLSAgICAgICAgICAgICAgICAgICAgICAgIGggPSBkaXIgKiBuZXh0VGFiKHRleHQsIHN0YXJ0LCBlbmQsIGggKiBkaXIsIHBhcnNwYW5zKTsKLQotICAgICAgICAgICAgICAgICAgICBzZWdzdGFydCA9IGogKyAxOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaGFzVGFicyAmJiBidWZbal0gPj0gMHhEODAwICYmIGJ1ZltqXSA8PSAweERGRkYgJiYgaiArIDEgPCB0aGVyZSkgewotICAgICAgICAgICAgICAgICAgICBpbnQgZW1vamkgPSBDaGFyYWN0ZXIuY29kZVBvaW50QXQoYnVmLCBqKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoZW1vamkgPj0gTUlOX0VNT0pJICYmIGVtb2ppIDw9IE1BWF9FTU9KSSkgewotICAgICAgICAgICAgICAgICAgICAgICAgQml0bWFwIGJtID0gRU1PSklfRkFDVE9SWS4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXRCaXRtYXBGcm9tQW5kcm9pZFB1YShlbW9qaSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChibSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCArPSBTdHlsZWQuZHJhd1RleHQoY2FudmFzLCB0ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0ICsgc2Vnc3RhcnQsIHN0YXJ0ICsgaiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXIsIChpICYgMSkgIT0gMCwgeCArIGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9wLCB5LCBib3R0b20sIHBhaW50LCB3b3JrUGFpbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgKyBqICE9IGVuZCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUVtb2ppUmVjdCA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1FbW9qaVJlY3QgPSBuZXcgUmVjdEYoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB3b3JrUGFpbnQuc2V0KHBhaW50KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHlsZWQubWVhc3VyZVRleHQocGFpbnQsIHdvcmtQYWludCwgdGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgKyBqLCBzdGFydCArIGogKyAxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCBiaXRtYXBIZWlnaHQgPSBibS5nZXRIZWlnaHQoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB0ZXh0SGVpZ2h0ID0gLXdvcmtQYWludC5hc2NlbnQoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCBzY2FsZSA9IHRleHRIZWlnaHQgLyBiaXRtYXBIZWlnaHQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgd2lkdGggPSBibS5nZXRXaWR0aCgpICogc2NhbGU7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRW1vamlSZWN0LnNldCh4ICsgaCwgeSAtIHRleHRIZWlnaHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeCArIGggKyB3aWR0aCwgeSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMuZHJhd0JpdG1hcChibSwgbnVsbCwgbUVtb2ppUmVjdCwgcGFpbnQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggKz0gd2lkdGg7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBqKys7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vnc3RhcnQgPSBqICsgMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaGVyZSA9IHRoZXJlOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGhhc1RhYnMpCi0gICAgICAgICAgICBUZXh0VXRpbHMucmVjeWNsZShidWYpOwotICAgIH0KLQotICAgIHByaXZhdGUgc3RhdGljIGZsb2F0IG1lYXN1cmVUZXh0KFRleHRQYWludCBwYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0UGFpbnQgd29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENoYXJTZXF1ZW5jZSB0ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzdGFydCwgaW50IG9mZnNldCwgaW50IGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZGlyLCBEaXJlY3Rpb25zIGRpcmVjdGlvbnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiB0cmFpbGluZywgYm9vbGVhbiBhbHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBoYXNUYWJzLCBPYmplY3RbXSB0YWJzKSB7Ci0gICAgICAgIGNoYXJbXSBidWYgPSBudWxsOwotCi0gICAgICAgIGlmIChoYXNUYWJzKSB7Ci0gICAgICAgICAgICBidWYgPSBUZXh0VXRpbHMub2J0YWluKGVuZCAtIHN0YXJ0KTsKLSAgICAgICAgICAgIFRleHRVdGlscy5nZXRDaGFycyh0ZXh0LCBzdGFydCwgZW5kLCBidWYsIDApOwotICAgICAgICB9Ci0KLSAgICAgICAgZmxvYXQgaCA9IDA7Ci0KLSAgICAgICAgaWYgKGFsdCkgewotICAgICAgICAgICAgaWYgKGRpciA9PSBESVJfUklHSFRfVE9fTEVGVCkKLSAgICAgICAgICAgICAgICB0cmFpbGluZyA9ICF0cmFpbGluZzsKLSAgICAgICAgfQotCi0gICAgICAgIGludCBoZXJlID0gMDsKLSAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBkaXJlY3Rpb25zLm1EaXJlY3Rpb25zLmxlbmd0aDsgaSsrKSB7Ci0gICAgICAgICAgICBpZiAoYWx0KQotICAgICAgICAgICAgICAgIHRyYWlsaW5nID0gIXRyYWlsaW5nOwotCi0gICAgICAgICAgICBpbnQgdGhlcmUgPSBoZXJlICsgZGlyZWN0aW9ucy5tRGlyZWN0aW9uc1tpXTsKLSAgICAgICAgICAgIGlmICh0aGVyZSA+IGVuZCAtIHN0YXJ0KQotICAgICAgICAgICAgICAgIHRoZXJlID0gZW5kIC0gc3RhcnQ7Ci0KLSAgICAgICAgICAgIGludCBzZWdzdGFydCA9IGhlcmU7Ci0gICAgICAgICAgICBmb3IgKGludCBqID0gaGFzVGFicyA/IGhlcmUgOiB0aGVyZTsgaiA8PSB0aGVyZTsgaisrKSB7Ci0gICAgICAgICAgICAgICAgaW50IGNvZGVwdCA9IDA7Ci0gICAgICAgICAgICAgICAgQml0bWFwIGJtID0gbnVsbDsKLQotICAgICAgICAgICAgICAgIGlmIChoYXNUYWJzICYmIGogPCB0aGVyZSkgewotICAgICAgICAgICAgICAgICAgICBjb2RlcHQgPSBidWZbal07Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKGNvZGVwdCA+PSAweEQ4MDAgJiYgY29kZXB0IDw9IDB4REZGRiAmJiBqICsgMSA8IHRoZXJlKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvZGVwdCA9IENoYXJhY3Rlci5jb2RlUG9pbnRBdChidWYsIGopOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChjb2RlcHQgPj0gTUlOX0VNT0pJICYmIGNvZGVwdCA8PSBNQVhfRU1PSkkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJtID0gRU1PSklfRkFDVE9SWS5nZXRCaXRtYXBGcm9tQW5kcm9pZFB1YShjb2RlcHQpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKGogPT0gdGhlcmUgfHwgY29kZXB0ID09ICdcdCcgfHwgYm0gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBmbG9hdCBzZWd3OwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChvZmZzZXQgPCBzdGFydCArIGogfHwKLSAgICAgICAgICAgICAgICAgICAgICAgKHRyYWlsaW5nICYmIG9mZnNldCA8PSBzdGFydCArIGopKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGlyID09IERJUl9MRUZUX1RPX1JJR0hUICYmIChpICYgMSkgPT0gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggKz0gU3R5bGVkLm1lYXN1cmVUZXh0KHBhaW50LCB3b3JrUGFpbnQsIHRleHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgKyBzZWdzdGFydCwgb2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBoOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGlyID09IERJUl9SSUdIVF9UT19MRUZUICYmIChpICYgMSkgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggLT0gU3R5bGVkLm1lYXN1cmVUZXh0KHBhaW50LCB3b3JrUGFpbnQsIHRleHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgKyBzZWdzdGFydCwgb2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBoOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgc2VndyA9IFN0eWxlZC5tZWFzdXJlVGV4dChwYWludCwgd29ya1BhaW50LCB0ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0ICsgc2Vnc3RhcnQsIHN0YXJ0ICsgaiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAob2Zmc2V0IDwgc3RhcnQgKyBqIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAodHJhaWxpbmcgJiYgb2Zmc2V0IDw9IHN0YXJ0ICsgaikpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkaXIgPT0gRElSX0xFRlRfVE9fUklHSFQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBoICs9IHNlZ3cgLSBTdHlsZWQubWVhc3VyZVRleHQocGFpbnQsIHdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgKyBzZWdzdGFydCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0LCBudWxsKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRpciA9PSBESVJfUklHSFRfVE9fTEVGVCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggLT0gc2VndyAtIFN0eWxlZC5tZWFzdXJlVGV4dChwYWludCwgd29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydCArIHNlZ3N0YXJ0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQsIG51bGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBoOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGRpciA9PSBESVJfUklHSFRfVE9fTEVGVCkKLSAgICAgICAgICAgICAgICAgICAgICAgIGggLT0gc2VndzsKLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgaCArPSBzZWd3OwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChqICE9IHRoZXJlICYmIGJ1ZltqXSA9PSAnXHQnKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAob2Zmc2V0ID09IHN0YXJ0ICsgaikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaDsKLQotICAgICAgICAgICAgICAgICAgICAgICAgaCA9IGRpciAqIG5leHRUYWIodGV4dCwgc3RhcnQsIGVuZCwgaCAqIGRpciwgdGFicyk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBpZiAoYm0gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgd29ya1BhaW50LnNldChwYWludCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBTdHlsZWQubWVhc3VyZVRleHQocGFpbnQsIHdvcmtQYWludCwgdGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqLCBqICsgMiwgbnVsbCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHdpZCA9IChmbG9hdCkgYm0uZ2V0V2lkdGgoKSAqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtd29ya1BhaW50LmFzY2VudCgpIC8gYm0uZ2V0SGVpZ2h0KCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkaXIgPT0gRElSX1JJR0hUX1RPX0xFRlQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBoIC09IHdpZDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCArPSB3aWQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGorKzsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIHNlZ3N0YXJ0ID0gaiArIDE7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBoZXJlID0gdGhlcmU7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoaGFzVGFicykKLSAgICAgICAgICAgIFRleHRVdGlscy5yZWN5Y2xlKGJ1Zik7Ci0KLSAgICAgICAgcmV0dXJuIGg7CisgICAgICAgIHJldHVybiByaWdodCAtIGdldFBhcmFncmFwaExlYWRpbmdNYXJnaW4obGluZSk7CiAgICAgfQogCiAgICAgLyoqCi0gICAgICogTWVhc3VyZSB3aWR0aCBvZiBhIHJ1biBvZiB0ZXh0IG9uIGEgc2luZ2xlIGxpbmUgdGhhdCBpcyBrbm93biB0byBhbGwgYmUKLSAgICAgKiBpbiB0aGUgc2FtZSBkaXJlY3Rpb24gYXMgdGhlIHBhcmFncmFwaCBiYXNlIGRpcmVjdGlvbi4gUmV0dXJucyB0aGUgd2lkdGgsCi0gICAgICogYW5kIHRoZSBsaW5lIG1ldHJpY3MgaW4gZm0gaWYgZm0gaXMgbm90IG51bGwuCi0gICAgICoKLSAgICAgKiBAcGFyYW0gcGFpbnQgdGhlIHBhaW50IGZvciB0aGUgdGV4dDsgd2lsbCBub3QgYmUgbW9kaWZpZWQKLSAgICAgKiBAcGFyYW0gd29ya1BhaW50IHBhaW50IGF2YWlsYWJsZSBmb3IgbW9kaWZpY2F0aW9uCi0gICAgICogQHBhcmFtIHRleHQgdGV4dAotICAgICAqIEBwYXJhbSBzdGFydCBzdGFydCBvZiB0aGUgbGluZQotICAgICAqIEBwYXJhbSBlbmQgbGltaXQgb2YgdGhlIGxpbmUKLSAgICAgKiBAcGFyYW0gZm0gb2JqZWN0IHRvIHJldHVybiBpbnRlZ2VyIG1ldHJpY3MgaW4sIGNhbiBiZSBudWxsCi0gICAgICogQHBhcmFtIGhhc1RhYnMgdHJ1ZSBpZiBpdCBpcyBrbm93biB0aGF0IHRoZSBsaW5lIGhhcyB0YWJzCi0gICAgICogQHBhcmFtIHRhYnMgdGFiIHBvc2l0aW9uIGluZm9ybWF0aW9uCi0gICAgICogQHJldHVybiB0aGUgd2lkdGggb2YgdGhlIHRleHQgZnJvbSBzdGFydCB0byBlbmQKKyAgICAgKiBSZXR1cm5zIHRoZSBlZmZlY3RpdmUgbGVhZGluZyBtYXJnaW4gKHVuc2lnbmVkKSBmb3IgdGhpcyBsaW5lLAorICAgICAqIHRha2luZyBpbnRvIGFjY291bnQgTGVhZGluZ01hcmdpblNwYW4gYW5kIExlYWRpbmdNYXJnaW5TcGFuMi4KKyAgICAgKiBAcGFyYW0gbGluZSB0aGUgbGluZSBpbmRleAorICAgICAqIEByZXR1cm4gdGhlIGxlYWRpbmcgbWFyZ2luIG9mIHRoaXMgbGluZQogICAgICAqLwotICAgIC8qIHBhY2thZ2UgKi8gc3RhdGljIGZsb2F0IG1lYXN1cmVUZXh0KFRleHRQYWludCBwYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0UGFpbnQgd29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENoYXJTZXF1ZW5jZSB0ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzdGFydCwgaW50IGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYWludC5Gb250TWV0cmljc0ludCBmbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sZWFuIGhhc1RhYnMsIE9iamVjdFtdIHRhYnMpIHsKLSAgICAgICAgY2hhcltdIGJ1ZiA9IG51bGw7Ci0gIAotICAgICAgICBpZiAoaGFzVGFicykgewotICAgICAgICAgICAgYnVmID0gVGV4dFV0aWxzLm9idGFpbihlbmQgLSBzdGFydCk7Ci0gICAgICAgICAgICBUZXh0VXRpbHMuZ2V0Q2hhcnModGV4dCwgc3RhcnQsIGVuZCwgYnVmLCAwKTsKKyAgICBwcml2YXRlIGludCBnZXRQYXJhZ3JhcGhMZWFkaW5nTWFyZ2luKGludCBsaW5lKSB7CisgICAgICAgIGlmICghbVNwYW5uZWRUZXh0KSB7CisgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorICAgICAgICBTcGFubmVkIHNwYW5uZWQgPSAoU3Bhbm5lZCkgbVRleHQ7CisKKyAgICAgICAgaW50IGxpbmVTdGFydCA9IGdldExpbmVTdGFydChsaW5lKTsKKyAgICAgICAgaW50IGxpbmVFbmQgPSBnZXRMaW5lRW5kKGxpbmUpOworICAgICAgICBpbnQgc3BhbkVuZCA9IHNwYW5uZWQubmV4dFNwYW5UcmFuc2l0aW9uKGxpbmVTdGFydCwgbGluZUVuZCwKKyAgICAgICAgICAgICAgICBMZWFkaW5nTWFyZ2luU3Bhbi5jbGFzcyk7CisgICAgICAgIExlYWRpbmdNYXJnaW5TcGFuW10gc3BhbnMgPSBzcGFubmVkLmdldFNwYW5zKGxpbmVTdGFydCwgc3BhbkVuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExlYWRpbmdNYXJnaW5TcGFuLmNsYXNzKTsKKyAgICAgICAgaWYgKHNwYW5zLmxlbmd0aCA9PSAwKSB7CisgICAgICAgICAgICByZXR1cm4gMDsgLy8gbm8gbGVhZGluZyBtYXJnaW4gc3BhbjsKICAgICAgICAgfQogCi0gICAgICAgIGludCBsZW4gPSBlbmQgLSBzdGFydDsKKyAgICAgICAgaW50IG1hcmdpbiA9IDA7CiAKLSAgICAgICAgaW50IGxhc3RQb3MgPSAwOwotICAgICAgICBmbG9hdCB3aWR0aCA9IDA7Ci0gICAgICAgIGludCBhc2NlbnQgPSAwLCBkZXNjZW50ID0gMCwgdG9wID0gMCwgYm90dG9tID0gMDsKKyAgICAgICAgYm9vbGVhbiBpc0ZpcnN0UGFyYUxpbmUgPSBsaW5lU3RhcnQgPT0gMCB8fAorICAgICAgICAgICAgc3Bhbm5lZC5jaGFyQXQobGluZVN0YXJ0IC0gMSkgPT0gJ1xuJzsKIAotICAgICAgICBpZiAoZm0gIT0gbnVsbCkgewotICAgICAgICAgICAgZm0uYXNjZW50ID0gMDsKLSAgICAgICAgICAgIGZtLmRlc2NlbnQgPSAwOwotICAgICAgICB9Ci0KLSAgICAgICAgZm9yIChpbnQgcG9zID0gaGFzVGFicyA/IDAgOiBsZW47IHBvcyA8PSBsZW47IHBvcysrKSB7Ci0gICAgICAgICAgICBpbnQgY29kZXB0ID0gMDsKLSAgICAgICAgICAgIEJpdG1hcCBibSA9IG51bGw7Ci0KLSAgICAgICAgICAgIGlmIChoYXNUYWJzICYmIHBvcyA8IGxlbikgewotICAgICAgICAgICAgICAgIGNvZGVwdCA9IGJ1Zltwb3NdOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHNwYW5zLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICBMZWFkaW5nTWFyZ2luU3BhbiBzcGFuID0gc3BhbnNbaV07CisgICAgICAgICAgICBib29sZWFuIHVzZUZpcnN0TGluZU1hcmdpbiA9IGlzRmlyc3RQYXJhTGluZTsKKyAgICAgICAgICAgIGlmIChzcGFuIGluc3RhbmNlb2YgTGVhZGluZ01hcmdpblNwYW4yKSB7CisgICAgICAgICAgICAgICAgaW50IHNwU3RhcnQgPSBzcGFubmVkLmdldFNwYW5TdGFydChzcGFuKTsKKyAgICAgICAgICAgICAgICBpbnQgc3BhbkxpbmUgPSBnZXRMaW5lRm9yT2Zmc2V0KHNwU3RhcnQpOworICAgICAgICAgICAgICAgIGludCBjb3VudCA9ICgoTGVhZGluZ01hcmdpblNwYW4yKXNwYW4pLmdldExlYWRpbmdNYXJnaW5MaW5lQ291bnQoKTsKKyAgICAgICAgICAgICAgICB1c2VGaXJzdExpbmVNYXJnaW4gPSBsaW5lIDwgc3BhbkxpbmUgKyBjb3VudDsKICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1hcmdpbiArPSBzcGFuLmdldExlYWRpbmdNYXJnaW4odXNlRmlyc3RMaW5lTWFyZ2luKTsKKyAgICAgICAgfQogCi0gICAgICAgICAgICBpZiAoY29kZXB0ID49IDB4RDgwMCAmJiBjb2RlcHQgPD0gMHhERkZGICYmIHBvcyA8IGxlbikgewotICAgICAgICAgICAgICAgIGNvZGVwdCA9IENoYXJhY3Rlci5jb2RlUG9pbnRBdChidWYsIHBvcyk7CisgICAgICAgIHJldHVybiBtYXJnaW47CisgICAgfQogCi0gICAgICAgICAgICAgICAgaWYgKGNvZGVwdCA+PSBNSU5fRU1PSkkgJiYgY29kZXB0IDw9IE1BWF9FTU9KSSkgewotICAgICAgICAgICAgICAgICAgICBibSA9IEVNT0pJX0ZBQ1RPUlkuZ2V0Qml0bWFwRnJvbUFuZHJvaWRQdWEoY29kZXB0KTsKKyAgICAvKiBwYWNrYWdlICovCisgICAgc3RhdGljIGZsb2F0IG1lYXN1cmVQYXJhKFRleHRQYWludCBwYWludCwgVGV4dFBhaW50IHdvcmtQYWludCwKKyAgICAgICAgICAgIENoYXJTZXF1ZW5jZSB0ZXh0LCBpbnQgc3RhcnQsIGludCBlbmQpIHsKKworICAgICAgICBNZWFzdXJlZFRleHQgbXQgPSBNZWFzdXJlZFRleHQub2J0YWluKCk7CisgICAgICAgIFRleHRMaW5lIHRsID0gVGV4dExpbmUub2J0YWluKCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBtdC5zZXRQYXJhKHRleHQsIHN0YXJ0LCBlbmQsIERJUl9SRVFVRVNUX0xUUik7CisgICAgICAgICAgICBEaXJlY3Rpb25zIGRpcmVjdGlvbnM7CisgICAgICAgICAgICBpbnQgZGlyOworICAgICAgICAgICAgaWYgKG10Lm1FYXN5KSB7CisgICAgICAgICAgICAgICAgZGlyZWN0aW9ucyA9IERJUlNfQUxMX0xFRlRfVE9fUklHSFQ7CisgICAgICAgICAgICAgICAgZGlyID0gTGF5b3V0LkRJUl9MRUZUX1RPX1JJR0hUOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBkaXJlY3Rpb25zID0gQW5kcm9pZEJpZGkuZGlyZWN0aW9ucyhtdC5tRGlyLCBtdC5tTGV2ZWxzLAorICAgICAgICAgICAgICAgICAgICAwLCBtdC5tQ2hhcnMsIDAsIG10Lm1MZW4pOworICAgICAgICAgICAgICAgIGRpciA9IG10Lm1EaXI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjaGFyW10gY2hhcnMgPSBtdC5tQ2hhcnM7CisgICAgICAgICAgICBpbnQgbGVuID0gbXQubUxlbjsKKyAgICAgICAgICAgIGJvb2xlYW4gaGFzVGFicyA9IGZhbHNlOworICAgICAgICAgICAgVGFiU3RvcHMgdGFiU3RvcHMgPSBudWxsOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW47ICsraSkgeworICAgICAgICAgICAgICAgIGlmIChjaGFyc1tpXSA9PSAnXHQnKSB7CisgICAgICAgICAgICAgICAgICAgIGhhc1RhYnMgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBpZiAodGV4dCBpbnN0YW5jZW9mIFNwYW5uZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFNwYW5uZWQgc3Bhbm5lZCA9IChTcGFubmVkKSB0ZXh0OworICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNwYW5FbmQgPSBzcGFubmVkLm5leHRTcGFuVHJhbnNpdGlvbihzdGFydCwgZW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUYWJTdG9wU3Bhbi5jbGFzcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBUYWJTdG9wU3BhbltdIHNwYW5zID0gc3Bhbm5lZC5nZXRTcGFucyhzdGFydCwgc3BhbkVuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGFiU3RvcFNwYW4uY2xhc3MpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNwYW5zLmxlbmd0aCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YWJTdG9wcyA9IG5ldyBUYWJTdG9wcyhUQUJfSU5DUkVNRU5ULCBzcGFucyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQorICAgICAgICAgICAgdGwuc2V0KHBhaW50LCB0ZXh0LCBzdGFydCwgZW5kLCBkaXIsIGRpcmVjdGlvbnMsIGhhc1RhYnMsIHRhYlN0b3BzKTsKKyAgICAgICAgICAgIHJldHVybiB0bC5tZXRyaWNzKG51bGwpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgVGV4dExpbmUucmVjeWNsZSh0bCk7CisgICAgICAgICAgICBNZWFzdXJlZFRleHQucmVjeWNsZShtdCk7CisgICAgICAgIH0KKyAgICB9CiAKLSAgICAgICAgICAgIGlmIChwb3MgPT0gbGVuIHx8IGNvZGVwdCA9PSAnXHQnIHx8IGJtICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICB3b3JrUGFpbnQuYmFzZWxpbmVTaGlmdCA9IDA7CisgICAgLyoqCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICAvKiBwYWNrYWdlICovIHN0YXRpYyBjbGFzcyBUYWJTdG9wcyB7CisgICAgICAgIHByaXZhdGUgaW50W10gbVN0b3BzOworICAgICAgICBwcml2YXRlIGludCBtTnVtU3RvcHM7CisgICAgICAgIHByaXZhdGUgaW50IG1JbmNyZW1lbnQ7CiAKLSAgICAgICAgICAgICAgICB3aWR0aCArPSBTdHlsZWQubWVhc3VyZVRleHQocGFpbnQsIHdvcmtQYWludCwgdGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydCArIGxhc3RQb3MsIHN0YXJ0ICsgcG9zLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZtKTsKKyAgICAgICAgVGFiU3RvcHMoaW50IGluY3JlbWVudCwgT2JqZWN0W10gc3BhbnMpIHsKKyAgICAgICAgICAgIHJlc2V0KGluY3JlbWVudCwgc3BhbnMpOworICAgICAgICB9CiAKLSAgICAgICAgICAgICAgICBpZiAoZm0gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBpZiAod29ya1BhaW50LmJhc2VsaW5lU2hpZnQgPCAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmbS5hc2NlbnQgKz0gd29ya1BhaW50LmJhc2VsaW5lU2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmbS50b3AgKz0gd29ya1BhaW50LmJhc2VsaW5lU2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmbS5kZXNjZW50ICs9IHdvcmtQYWludC5iYXNlbGluZVNoaWZ0OwotICAgICAgICAgICAgICAgICAgICAgICAgZm0uYm90dG9tICs9IHdvcmtQYWludC5iYXNlbGluZVNoaWZ0OworICAgICAgICB2b2lkIHJlc2V0KGludCBpbmNyZW1lbnQsIE9iamVjdFtdIHNwYW5zKSB7CisgICAgICAgICAgICB0aGlzLm1JbmNyZW1lbnQgPSBpbmNyZW1lbnQ7CisKKyAgICAgICAgICAgIGludCBucyA9IDA7CisgICAgICAgICAgICBpZiAoc3BhbnMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGludFtdIHN0b3BzID0gdGhpcy5tU3RvcHM7CisgICAgICAgICAgICAgICAgZm9yIChPYmplY3QgbyA6IHNwYW5zKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChvIGluc3RhbmNlb2YgVGFiU3RvcFNwYW4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdG9wcyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcHMgPSBuZXcgaW50WzEwXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobnMgPT0gc3RvcHMubGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50W10gbnN0b3BzID0gbmV3IGludFtucyAqIDJdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbnM7ICsraSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuc3RvcHNbaV0gPSBzdG9wc1tpXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcHMgPSBuc3RvcHM7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBzdG9wc1tucysrXSA9ICgoVGFiU3RvcFNwYW4pIG8pLmdldFRhYlN0b3AoKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChwb3MgIT0gbGVuKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChibSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBubyBlbW9qaSwgbXVzdCBoYXZlIGhpdCBhIHRhYgotICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGggPSBuZXh0VGFiKHRleHQsIHN0YXJ0LCBlbmQsIHdpZHRoLCB0YWJzKTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoaXMgc2V0cyB1cCB3b3JrUGFpbnQgd2l0aCB0aGUgZm9udCBvbiB0aGUgZW1vamkKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRleHQsIHNvIHRoYXQgd2UgY2FuIGV4dHJhY3QgdGhlIGFzY2VudCBhbmQgc2NhbGUuCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIFdlIGNhbid0IHVzZSB0aGUgcmVzdWx0IG9mIHRoZSBwcmV2aW91cyBjYWxsIHRvCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBtZWFzdXJlVGV4dCBiZWNhdXNlIHRoZSBlbW9qaSBtaWdodCBoYXZlIGl0cyBvd24gc3R5bGUuCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBoYXZlIHRvIGluaXRpYWxpemUgd29ya1BhaW50IGhlcmUgYmVjYXVzZSBpZiB0aGUKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRleHQgaXMgdW5zdHlsZWQgbWVhc3VyZVRleHQgbWlnaHQgbm90IHVzZSB3b3JrUGFpbnQKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGF0IGFsbC4KLSAgICAgICAgICAgICAgICAgICAgICAgIHdvcmtQYWludC5zZXQocGFpbnQpOwotICAgICAgICAgICAgICAgICAgICAgICAgU3R5bGVkLm1lYXN1cmVUZXh0KHBhaW50LCB3b3JrUGFpbnQsIHRleHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgKyBwb3MsIHN0YXJ0ICsgcG9zICsgMSwgbnVsbCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoICs9IChmbG9hdCkgYm0uZ2V0V2lkdGgoKSAqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtd29ya1BhaW50LmFzY2VudCgpIC8gYm0uZ2V0SGVpZ2h0KCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNpbmNlIHdlIGhhZCBhbiBlbW9qaSwgd2UgYnVtcCBwYXN0IHRoZSBzZWNvbmQgaGFsZgotICAgICAgICAgICAgICAgICAgICAgICAgLy8gb2YgdGhlIHN1cnJvZ2F0ZSBwYWlyLgotICAgICAgICAgICAgICAgICAgICAgICAgcG9zKys7Ci0gICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAobnMgPiAxKSB7CisgICAgICAgICAgICAgICAgICAgIEFycmF5cy5zb3J0KHN0b3BzLCAwLCBucyk7CiAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKGZtICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGZtLmFzY2VudCA8IGFzY2VudCkgewotICAgICAgICAgICAgICAgICAgICAgICAgYXNjZW50ID0gZm0uYXNjZW50OwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGlmIChmbS5kZXNjZW50ID4gZGVzY2VudCkgewotICAgICAgICAgICAgICAgICAgICAgICAgZGVzY2VudCA9IGZtLmRlc2NlbnQ7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBpZiAoZm0udG9wIDwgdG9wKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0b3AgPSBmbS50b3A7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGZtLmJvdHRvbSA+IGJvdHRvbSkgewotICAgICAgICAgICAgICAgICAgICAgICAgYm90dG9tID0gZm0uYm90dG9tOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgLy8gTm8gbmVlZCB0byB0YWtlIGJpdG1hcCBoZWlnaHQgaW50byBhY2NvdW50IGhlcmUsCi0gICAgICAgICAgICAgICAgICAgIC8vIHNpbmNlIGl0IGlzIHNjYWxlZCB0byBtYXRjaCB0aGUgdGV4dCBoZWlnaHQuCisgICAgICAgICAgICAgICAgaWYgKHN0b3BzICE9IHRoaXMubVN0b3BzKSB7CisgICAgICAgICAgICAgICAgICAgIHRoaXMubVN0b3BzID0gc3RvcHM7CiAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgbGFzdFBvcyA9IHBvcyArIDE7CiAgICAgICAgICAgICB9CisgICAgICAgICAgICB0aGlzLm1OdW1TdG9wcyA9IG5zOwogICAgICAgICB9CiAKLSAgICAgICAgaWYgKGZtICE9IG51bGwpIHsKLSAgICAgICAgICAgIGZtLmFzY2VudCA9IGFzY2VudDsKLSAgICAgICAgICAgIGZtLmRlc2NlbnQgPSBkZXNjZW50OwotICAgICAgICAgICAgZm0udG9wID0gdG9wOwotICAgICAgICAgICAgZm0uYm90dG9tID0gYm90dG9tOworICAgICAgICBmbG9hdCBuZXh0VGFiKGZsb2F0IGgpIHsKKyAgICAgICAgICAgIGludCBucyA9IHRoaXMubU51bVN0b3BzOworICAgICAgICAgICAgaWYgKG5zID4gMCkgeworICAgICAgICAgICAgICAgIGludFtdIHN0b3BzID0gdGhpcy5tU3RvcHM7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuczsgKytpKSB7CisgICAgICAgICAgICAgICAgICAgIGludCBzdG9wID0gc3RvcHNbaV07CisgICAgICAgICAgICAgICAgICAgIGlmIChzdG9wID4gaCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0b3A7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gbmV4dERlZmF1bHRTdG9wKGgsIG1JbmNyZW1lbnQpOwogICAgICAgICB9CiAKLSAgICAgICAgaWYgKGhhc1RhYnMpCi0gICAgICAgICAgICBUZXh0VXRpbHMucmVjeWNsZShidWYpOwotCi0gICAgICAgIHJldHVybiB3aWR0aDsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmbG9hdCBuZXh0RGVmYXVsdFN0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B7CisgICAgLyogcGFja2FnZSAqLyBDaGFyU2VxdWVuY2UgbVRleHQ7CisgICAgLyogcGFja2FnZSAqLyBpbnQgbVRleHRTdGFydDsKKyAgICAvKiBwYWNrYWdlICovIGZsb2F0W10gbVdpZHRoczsKKyAgICAvKiBwYWNrYWdlICovIGNoYXJbXSBtQ2hhcnM7CisgICAgLyogcGFja2FnZSAqLyBieXRlW10gbUxldmVsczsKKyAgICAvKiBwYWNrYWdlICovIGludCBtRGlyOworICAgIC8qIHBhY2thZ2UgKi8gYm9vbGVhbiBtRWFzeTsKKyAgICAvKiBwYWNrYWdlICovIGludCBtTGVuOworICAgIHByaXZhdGUgaW50IG1Qb3M7CisgICAgcHJpdmF0ZSBUZXh0UGFpbnQgbVdvcmtQYWludDsKKworICAgIHByaXZhdGUgTWVhc3VyZWRUZXh0KCkgeworICAgICAgICBtV29ya1BhaW50ID0gbmV3IFRleHRQYWludCgpOworICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIE1lYXN1cmVkVGV4dFtdIGNhY2hlZCA9IG5ldyBNZWFzdXJlZFRleHRbM107CisKKyAgICAvKiBwYWNrYWdlICovCisgICAgc3RhdGljIE1lYXN1cmVkVGV4dCBvYnRhaW4oKSB7CisgICAgICAgIE1lYXN1cmVkVGV4dCBtdDsKKyAgICAgICAgc3luY2hyb25pemVkIChjYWNoZWQpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSBjYWNoZWQubGVuZ3RoOyAtLWkgPj0gMDspIHsKKyAgICAgICAgICAgICAgICBpZiAoY2FjaGVkW2ldICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbXQgPSBjYWNoZWRbaV07CisgICAgICAgICAgICAgICAgICAgIGNhY2hlZFtpXSA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBtdDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgbXQgPSBuZXcgTWVhc3VyZWRUZXh0KCk7CisgICAgICAgIExvZy5lKCJNRUFTIiwgIm5ldzogIiArIG10KTsKKyAgICAgICAgcmV0dXJuIG10OworICAgIH0KKworICAgIC8qIHBhY2thZ2UgKi8KKyAgICBzdGF0aWMgTWVhc3VyZWRUZXh0IHJlY3ljbGUoTWVhc3VyZWRUZXh0IG10KSB7CisgICAgICAgIG10Lm1UZXh0ID0gbnVsbDsKKyAgICAgICAgaWYgKG10Lm1MZW4gPCAxMDAwKSB7CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQoY2FjaGVkKSB7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjYWNoZWQubGVuZ3RoOyArK2kpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNhY2hlZFtpXSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjYWNoZWRbaV0gPSBtdDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIC8qKgorICAgICAqIEFuYWx5emVzIHRleHQgZm9yIGJpZGlyZWN0aW9uYWwgcnVucy4gIEFsbG9jYXRlcyB3b3JraW5nIGJ1ZmZlcnMuCisgICAgICovCisgICAgLyogcGFja2FnZSAqLworICAgIHZvaWQgc2V0UGFyYShDaGFyU2VxdWVuY2UgdGV4dCwgaW50IHN0YXJ0LCBpbnQgZW5kLCBpbnQgYmlkaVJlcXVlc3QpIHsKKyAgICAgICAgbVRleHQgPSB0ZXh0OworICAgICAgICBtVGV4dFN0YXJ0ID0gc3RhcnQ7CisKKyAgICAgICAgaW50IGxlbiA9IGVuZCAtIHN0YXJ0OworICAgICAgICBtTGVuID0gbGVuOworICAgICAgICBtUG9zID0gMDsKKworICAgICAgICBpZiAobVdpZHRocyA9PSBudWxsIHx8IG1XaWR0aHMubGVuZ3RoIDwgbGVuKSB7CisgICAgICAgICAgICBtV2lkdGhzID0gbmV3IGZsb2F0W0FycmF5VXRpbHMuaWRlYWxGbG9hdEFycmF5U2l6ZShsZW4pXTsKKyAgICAgICAgfQorICAgICAgICBpZiAobUNoYXJzID09IG51bGwgfHwgbUNoYXJzLmxlbmd0aCA8IGxlbikgeworICAgICAgICAgICAgbUNoYXJzID0gbmV3IGNoYXJbQXJyYXlVdGlscy5pZGVhbENoYXJBcnJheVNpemUobGVuKV07CisgICAgICAgIH0KKyAgICAgICAgVGV4dFV0aWxzLmdldENoYXJzKHRleHQsIHN0YXJ0LCBlbmQsIG1DaGFycywgMCk7CisKKyAgICAgICAgaWYgKHRleHQgaW5zdGFuY2VvZiBTcGFubmVkKSB7CisgICAgICAgICAgICBTcGFubmVkIHNwYW5uZWQgPSAoU3Bhbm5lZCkgdGV4dDsKKyAgICAgICAgICAgIFJlcGxhY2VtZW50U3BhbltdIHNwYW5zID0gc3Bhbm5lZC5nZXRTcGFucyhzdGFydCwgZW5kLAorICAgICAgICAgICAgICAgICAgICBSZXBsYWNlbWVudFNwYW4uY2xhc3MpOworCisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHNwYW5zLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgaW50IHN0YXJ0SW5QYXJhID0gc3Bhbm5lZC5nZXRTcGFuU3RhcnQoc3BhbnNbaV0pIC0gc3RhcnQ7CisgICAgICAgICAgICAgICAgaW50IGVuZEluUGFyYSA9IHNwYW5uZWQuZ2V0U3BhbkVuZChzcGFuc1tpXSkgLSBzdGFydDsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBqID0gc3RhcnRJblBhcmE7IGogPCBlbmRJblBhcmE7IGorKykgeworICAgICAgICAgICAgICAgICAgICBtQ2hhcnNbal0gPSAnXHVGRkZDJzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoVGV4dFV0aWxzLmRvZXNOb3ROZWVkQmlkaShtQ2hhcnMsIDAsIGxlbikpIHsKKyAgICAgICAgICAgIG1EaXIgPSBMYXlvdXQuRElSX0xFRlRfVE9fUklHSFQ7CisgICAgICAgICAgICBtRWFzeSA9IHRydWU7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpZiAobUxldmVscyA9PSBudWxsIHx8IG1MZXZlbHMubGVuZ3RoIDwgbGVuKSB7CisgICAgICAgICAgICAgICAgbUxldmVscyA9IG5ldyBieXRlW0FycmF5VXRpbHMuaWRlYWxCeXRlQXJyYXlTaXplKGxlbildOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbURpciA9IEFuZHJvaWRCaWRpLmJpZGkoYmlkaVJlcXVlc3QsIG1DaGFycywgbUxldmVscywgbGVuLCBmYWxzZSk7CisgICAgICAgICAgICBtRWFzeSA9IGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgZmxvYXQgYWRkU3R5bGVSdW4oVGV4dFBhaW50IHBhaW50LCBpbnQgbGVuLCBQYWludC5Gb250TWV0cmljc0ludCBmbSkgeworICAgICAgICBpZiAoZm0gIT0gbnVsbCkgeworICAgICAgICAgICAgcGFpbnQuZ2V0Rm9udE1ldHJpY3NJbnQoZm0pOworICAgICAgICB9CisKKyAgICAgICAgaW50IHAgPSBtUG9zOworICAgICAgICBtUG9zID0gcCArIGxlbjsKKworICAgICAgICBpZiAobUVhc3kpIHsKKyAgICAgICAgICAgIGludCBmbGFncyA9IG1EaXIgPT0gTGF5b3V0LkRJUl9MRUZUX1RPX1JJR0hUCisgICAgICAgICAgICAgICAgPyBDYW52YXMuRElSRUNUSU9OX0xUUiA6IENhbnZhcy5ESVJFQ1RJT05fUlRMOworICAgICAgICAgICAgcmV0dXJuIHBhaW50LmdldFRleHRSdW5BZHZhbmNlcyhtQ2hhcnMsIHAsIGxlbiwgcCwgbGVuLCBmbGFncywgbVdpZHRocywgcCk7CisgICAgICAgIH0KKworICAgICAgICBmbG9hdCB0b3RhbEFkdmFuY2UgPSAwOworICAgICAgICBpbnQgbGV2ZWwgPSBtTGV2ZWxzW3BdOworICAgICAgICBmb3IgKGludCBxID0gcCwgaSA9IHAgKyAxLCBlID0gcCArIGxlbjs7ICsraSkgeworICAgICAgICAgICAgaWYgKGkgPT0gZSB8fCBtTGV2ZWxzW2ldICE9IGxldmVsKSB7CisgICAgICAgICAgICAgICAgaW50IGZsYWdzID0gKGxldmVsICYgMHgxKSA9PSAwID8gQ2FudmFzLkRJUkVDVElPTl9MVFIgOiBDYW52YXMuRElSRUNUSU9OX1JUTDsKKyAgICAgICAgICAgICAgICB0b3RhbEFkdmFuY2UgKz0KKyAgICAgICAgICAgICAgICAgICAgICAgIHBhaW50LmdldFRleHRSdW5BZHZhbmNlcyhtQ2hhcnMsIHEsIGkgLSBxLCBxLCBpIC0gcSwgZmxhZ3MsIG1XaWR0aHMsIHEpOworICAgICAgICAgICAgICAgIGlmIChpID09IGUpIHsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHEgPSBpOworICAgICAgICAgICAgICAgIGxldmVsID0gbUxldmVsc1tpXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gdG90YWxBZHZhbmNlOworICAgIH0KKworICAgIGZsb2F0IGFkZFN0eWxlUnVuKFRleHRQYWludCBwYWludCwgTWV0cmljQWZmZWN0aW5nU3BhbltdIHNwYW5zLCBpbnQgbGVuLAorICAgICAgICAgICAgUGFpbnQuRm9udE1ldHJpY3NJbnQgZm0pIHsKKworICAgICAgICBUZXh0UGFpbnQgd29ya1BhaW50ID0gbVdvcmtQYWludDsKKyAgICAgICAgd29ya1BhaW50LnNldChwYWludCk7CisgICAgICAgIC8vIFhYWCBwYWludCBzaG91bGQgbm90IGhhdmUgYSBiYXNlbGluZSBzaGlmdCwgYnV0Li4uCisgICAgICAgIHdvcmtQYWludC5iYXNlbGluZVNoaWZ0ID0gMDsKKworICAgICAgICBSZXBsYWNlbWVudFNwYW4gcmVwbGFjZW1lbnQgPSBudWxsOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHNwYW5zLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICBNZXRyaWNBZmZlY3RpbmdTcGFuIHNwYW4gPSBzcGFuc1tpXTsKKyAgICAgICAgICAgIGlmIChzcGFuIGluc3RhbmNlb2YgUmVwbGFjZW1lbnRTcGFuKSB7CisgICAgICAgICAgICAgICAgcmVwbGFjZW1lbnQgPSAoUmVwbGFjZW1lbnRTcGFuKXNwYW47CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHNwYW4udXBkYXRlTWVhc3VyZVN0YXRlKHdvcmtQYWludCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBmbG9hdCB3aWQ7CisgICAgICAgIGlmIChyZXBsYWNlbWVudCA9PSBudWxsKSB7CisgICAgICAgICAgICB3aWQgPSBhZGRTdHlsZVJ1bih3b3JrUGFpbnQsIGxlbiwgZm0pOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gVXNlIG9yaWdpbmFsIHRleHQuICBTaG91bGRuJ3QgbWF0dGVyLgorICAgICAgICAgICAgd2lkID0gcmVwbGFjZW1lbnQuZ2V0U2l6ZSh3b3JrUGFpbnQsIG1UZXh0LCBtVGV4dFN0YXJ0ICsgbVBvcywKKyAgICAgICAgICAgICAgICAgICAgbVRleHRTdGFydCArIG1Qb3MgKyBsZW4sIGZtKTsKKyAgICAgICAgICAgIGZsb2F0W10gdyA9IG1XaWR0aHM7CisgICAgICAgICAgICB3W21Qb3NdID0gd2lkOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IG1Qb3MgKyAxLCBlID0gbVBvcyArIGxlbjsgaSA8IGU7IGkrKykKKyAgICAgICAgICAgICAgICB3W2ldID0gMDsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChmbSAhPSBudWxsKSB7CisgICAgICAgICAgICBpZiAod29ya1BhaW50LmJhc2VsaW5lU2hpZnQgPCAwKSB7CisgICAgICAgICAgICAgICAgZm0uYXNjZW50ICs9IHdvcmtQYWludC5iYXNlbGluZVNoaWZ0OworICAgICAgICAgICAgICAgIGZtLnRvcCArPSB3b3JrUGFpbnQuYmFzZWxpbmVTaGlmdDsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgZm0uZGVzY2VudCArPSB3b3JrUGFpbnQuYmFzZWxpbmVTaGlmdDsKKyAgICAgICAgICAgICAgICBmbS5ib3R0b20gKz0gd29ya1BhaW50LmJhc2VsaW5lU2hpZnQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gd2lkOworICAgIH0KKworICAgIGludCBicmVha1RleHQoaW50IHN0YXJ0LCBpbnQgbGltaXQsIGJvb2xlYW4gZm9yd2FyZHMsIGZsb2F0IHdpZHRoKSB7CisgICAgICAgIGZsb2F0W10gdyA9IG1XaWR0aHM7CisgICAgICAgIGlmIChmb3J3YXJkcykgeworICAgICAgICAgICAgZm9yIChpbnQgaSA9IHN0YXJ0OyBpIDwgbGltaXQ7ICsraSkgeworICAgICAgICAgICAgICAgIGlmICgod2lkdGggLT0gd1tpXSkgPCAwKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBpIC0gc3RhcnQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZm9yIChpbnQgaSA9IGxpbWl0OyAtLWkgPj0gc3RhcnQ7KSB7CisgICAgICAgICAgICAgICAgaWYgKCh3aWR0aCAtPSB3W2ldKSA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxpbWl0IC0gaSAtMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gbGltaXQgLSBzdGFydDsKKyAgICB9CisKKyAgICBmbG9hdCBtZ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JyYXkoa2luZCk7CisgICAgICAgICAgICByZXR1cm4gQXJyYXlVdGlscy5lbXB0eUFycmF5KGtpbmQpOwogICAgICAgICB9CiAgICAgICAgIGlmIChjb3VudCA9PSAxKSB7CiAgICAgICAgICAgICByZXQgPSAoT2JqZWN0W10pIEFycmF5Lm5ld0luc3RhbmNlKGtpbmQsIDEpOwpAQCAtMTA1NCw3ICsxMDU1LDMyIEBACiAgICAgICAgIH0KICAgICB9CiAKKwogICAgIC8qKgorICAgICAqIERvbid0IGNhbGwgdGhpcyB5b3Vyc2VsZiAtLSBleGlzdHMgZm9yIENhbnZhcyB0byB1c2UgaW50ZXJuYWxseS4KKyAgICAgKiB7QGhpZGV9CisgICAgICovCisgICAgcHVibGljIHZvaWQgZHJhd1RleHRSdW4oQ2FudmFzIGMsIGludCBzdGFydCwgaW50IGVuZCwKKyAgICAgICAgICAgIGludCBjb250ZXh0U3RhcnQsIGludCBjb250ZXh0RW5kLAorICAgICAgICAgICAgZmxvYXQgeCwgZmxvYXQgeSwgaW50IGZsYWdzLCBQYWludCBwKSB7CisgICAgICAgIGNoZWNrUmFuZ2UoImRyYXdUZXh0UnVuIiwgc3RhcnQsIGVuZCk7CisKKyAgICAgICAgaW50IGNvbnRleHRMZW4gPSBjb250ZXh0RW5kIC0gY29udGV4dFN0YXJ0OworICAgICAgICBpbnQgbGVuID0gZW5kIC0gc3RhcnQ7CisgICAgICAgIGlmIChjb250ZXh0RW5kIDw9IG1HYXBTdGFydCkgeworICAgICAgICAgICAgYy5kcmF3VGV4dFJ1bihtVGV4dCwgc3RhcnQsIGxlbiwgY29udGV4dFN0YXJ0LCBjb250ZXh0TGVuLCB4LCB5LCBmbGFncywgcCk7CisgICAgICAgIH0gZWxzZSBpZiAoY29udGV4dFN0YXJ0ID49IG1HYXBTdGFydCkgeworICAgICAgICAgICAgYy5kcmF3VGV4dFJ1bihtVGV4dCwgc3RhcnQgKyBtR2FwTGVuZ3RoLCBsZW4sIGNvbnRleHRTdGFydCArIG1HYXBMZW5ndGgsCisgICAgICAgICAgICAgICAgICAgIGNvbnRleHRMZW4sIHgsIHksIGZsYWdzLCBwKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGNoYXJbXSBidWYgPSBUZXh0VXRpbHMub2J0YWluKGNvbnRleHRMZW4pOworICAgICAgICAgICAgZ2V0Q2hhcnMoY29udGV4dFN0YXJ0LCBjb250ZXh0RW5kLCBidWYsIDApOworICAgICAgICAgICAgYy5kcmF3VGV4dFJ1bihidWYsIHN0YXJ0IC0gY29udGV4dFN0YXJ0LCBsZW4sIDAsIGNvbnRleHRMZW4sIHgsIHksIGZsYWdzLCBwKTsKKyAgICAgICAgICAgIFRleHRVdGlscy5yZWN5Y2xlKGJ1Zik7CisgICAgICAgIH0KKyAgICB9CisKKyAgIC8qKgogICAgICAqIERvbid0IGNhbGwgdGhpcyB5b3Vyc2VsZiAtLSBleGlzdHMgZm9yIFBhaW50IHRvIHVzZSBpbnRlcm5hbGx5LgogICAgICAqIHtAaGlkZX0KICAgICAgKi8KQEAgLTExMDMsNiArMTEyOSw1OCBAQAogICAgICAgICByZXR1cm4gcmV0OwogICAgIH0KIAorICAgIC8qKgorICAgICAqIERvbid0IGNhbGwgdGhpcyB5b3Vyc2VsZiAtLSBleGlzdHMgZm9yIFBhaW50IHRvIHVzZSBpbnRlcm5hbGx5LgorICAgICAqIHtAaGlkZX0KKyAgICAgKi8KKyAgICBwdWJsaWMgZmxvYXQgZ2V0VGV4dFJ1bkFkdmFuY2VzKGludCBzdGFydCwgaW50IGVuZCwgaW50IGNvbnRleHRTdGFydCwgaW50IGNvbnRleHRFbmQsIGludCBmbGFncywKKyAgICAgICAgICAgIGZsb2F0W10gYWR2YW5jZXMsIGludCBhZHZhbmNlc1BvcywgUGFpbnQgcCkgeworCisgICAgICAgIGZsb2F0IHJldDsKKworICAgICAgICBpbnQgY29udGV4dExlbiA9IGNvbnRleHRFbmQgLSBjb250ZXh0U3RhcnQ7CisgICAgICAgIGludCBsZW4gPSBlbmQgLSBzdGFydDsKKworICAgICAgICBpZiAoZW5kIDw9IG1HYXBTdGFydCkgeworICAgICAgICAgICAgcmV0ID0gcC5nZXRUZXh0UnVuQWR2YW5jZXMobVRleHQsIHN0YXJ0LCBsZW4sIGNvbnRleHRTdGFydCwgY29udGV4dExlbiwKKyAgICAgICAgICAgICAgICAgICAgZmxhZ3MsIGFkdmFuY2VzLCBhZHZhbmNlc1Bvcyk7CisgICAgICAgIH0gZWxzZSBpZiAoc3RhcnQgPj0gbUdhcFN0YXJ0KSB7CisgICAgICAgICAgICByZXQgPSBwLmdldFRleHRSdW5BZHZhbmNlcyhtVGV4dCwgc3RhcnQgKyBtR2FwTGVuZ3RoLCBsZW4sCisgICAgICAgICAgICAgICAgICAgIGNvbnRleHRTdGFydCArIG1HYXBMZW5ndGgsIGNvbnRleHRMZW4sIGZsYWdzLCBhZHZhbmNlcywgYWR2YW5jZXNQb3MpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgY2hhcltdIGJ1ZiA9IFRleHRVdGlscy5vYnRhaW4oY29udGV4dExlbik7CisgICAgICAgICAgICBnZXRDaGFycyhjb250ZXh0U3RhcnQsIGNvbnRleHRFbmQsIGJ1ZiwgMCk7CisgICAgICAgICAgICByZXQgPSBwLmdldFRleHRSdW5BZHZhbmNlcyhidWYsIHN0YXJ0IC0gY29udGV4dFN0YXJ0LCBsZW4sCisgICAgICAgICAgICAgICAgICAgIDAsIGNvbnRleHRMZW4sIGZsYWdzLCBhZHZhbmNlcywgYWR2YW5jZXNQb3MpOworICAgICAgICAgICAgVGV4dFV0aWxzLnJlY3ljbGUoYnVmKTsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiByZXQ7CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRUZXh0UnVuQ3Vyc29yKGludCBjb250ZXh0U3RhcnQsIGludCBjb250ZXh0RW5kLCBpbnQgZmxhZ3MsIGludCBvZmZzZXQsCisgICAgICAgICAgICBpbnQgY3Vyc29yT3B0LCBQYWludCBwKSB7CisKKyAgICAgICAgaW50IHJldDsKKworICAgICAgICBpbnQgY29udGV4dExlbiA9IGNvbnRleHRFbmQgLSBjb250ZXh0U3RhcnQ7CisgICAgICAgIGlmIChjb250ZXh0RW5kIDw9IG1HYXBTdGFydCkgeworICAgICAgICAgICAgcmV0ID0gcC5nZXRUZXh0UnVuQ3Vyc29yKG1UZXh0LCBjb250ZXh0U3RhcnQsIGNvbnRleHRMZW4sCisgICAgICAgICAgICAgICAgICAgIGZsYWdzLCBvZmZzZXQsIGN1cnNvck9wdCk7CisgICAgICAgIH0gZWxzZSBpZiAoY29udGV4dFN0YXJ0ID49IG1HYXBTdGFydCkgeworICAgICAgICAgICAgcmV0ID0gcC5nZXRUZXh0UnVuQ3Vyc29yKG1UZXh0LCBjb250ZXh0U3RhcnQgKyBtR2FwTGVuZ3RoLCBjb250ZXh0TGVuLAorICAgICAgICAgICAgICAgICAgICBmbGFncywgb2Zmc2V0ICsgbUdhcExlbmd0aCwgY3Vyc29yT3B0KTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGNoYXJbXSBidWYgPSBUZXh0VXRpbHMub2J0YWluKGNvbnRleHRMZW4pOworICAgICAgICAgICAgZ2V0Q2hhcnMoY29udGV4dFN0YXJ0LCBjb250ZXh0RW5kLCBidWYsIDApOworICAgICAgICAgICAgcmV0ID0gcC5nZXRUZXh0UnVuQ3Vyc29yKGJ1ZiwgMCwgY29udGV4dExlbiwKKyAgICAgICAgICAgICAgICAgICAgZmxhZ3MsIG9mZnNldCAtIGNvbnRleHRTdGFydCwgY3Vyc29yT3B0KSArIGNvbnRleHRTdGFydDsKKyAgICAgICAgICAgIFRleHRVdGlscy5yZWN5Y2xlKGJ1Zik7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gcmV0OworICAgIH0KKwogICAgIC8vIERvY3VtZW50YXRpb24gZnJvbSBpbnRlcmZhY2UKICAgICBwdWJsaWMgdm9pZCBzZXRG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IGltcGxlbWVudGluZyB5b3VyIG93biB3aWRnZXQKICAqIG9yIGN1c3RvbSBkaXNwbGF5IG9iamVjdCwgb3Igd291bGQgYmUgdGVtcHRlZCB0byBjYWxsCi0gKiB7QGxpbmsgYW5kcm9pZC5ncmFwaGljcy5DYW52YXMjZHJhd1RleHQoamF2YS5sYW5nLkNoYXJTZXF1ZW5jZSwgaW50LCBpbnQsIGZsb2F0LCBmbG9hdCwgYW5kcm9pZC5ncmFwaGljcy5QYWludCkKLSAqICBDYW52YXMuZHJhd1RleHQoKX0gZGlyZWN0bHkuPC9wPgorICoge0BsaW5rIGFuZHJvaWQuZ3JhcGhpY3MuQ2FudmFzI2RyYXdUZXh0KGphdmEubGFuZy5DaGFyU2VxdWVuY2UsIGludCwgaW50LAorICogZmxvYXQsIGZsb2F0LCBhbmRyb2lkLmdyYXBoaWNzLlBhaW50KQorICogQ2FudmFzLmRyYXdUZXh0KCl9IGRpcmVjdGx5LjwvcD4KICAqLwogcHVibGljIGNsYXNzCiBTdGF0aWNMYXlvdXQKQEAgLTYyLDcgKzY0LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gaW5jbHVkZXBhZCwKICAgICAgICAgICAgICAgICAgICAgICAgIFRleHRVdGlscy5UcnVuY2F0ZUF0IGVsbGlwc2l6ZSwgaW50IGVsbGlwc2l6ZWRXaWR0aCkgewogICAgICAgICBzdXBlcigoZWxsaXBzaXplID09IG51bGwpCi0gICAgICAgICAgICAgICAgPyBzb3VyY2UgCisgICAgICAgICAgICAgICAgPyBzb3VyY2UKICAgICAgICAgICAgICAgICA6IChzb3VyY2UgaW5zdGFuY2VvZiBTcGFubmVkKQogICAgICAgICAgICAgICAgICAgICA/IG5ldyBTcGFubmVkRWxsaXBzaXplcihzb3VyY2UpCiAgICAgICAgICAgICAgICAgICAgIDogbmV3IEVsbGlwc2l6ZXIoc291cmNlKSwKQEAgLTcyLDcgKzc0LDcgQEAKICAgICAgICAgICogVGhpcyBpcyBhbm5veWluZywgYnV0IHdlIGNhbid0IHJlZmVyIHRvIHRoZSBsYXlvdXQgdW50aWwKICAgICAgICAgICogc3VwZXJjbGFzcyBjb25zdHJ1Y3Rpb24gaXMgZmluaXNoZWQsIGFuZCB0aGUgc3VwZXJjbGFzcwogICAgICAgICAgKiBjb25zdHJ1Y3RvciB3YW50cyB0aGUgcmVmZXJlbmNlIHRvIHRoZSBkaXNwbGF5IHRleHQuCi0gICAgICAgICAqIAorICAgICAgICAgKgogICAgICAgICAgKiBUaGlzIHdpbGwgYnJlYWsgaWYgdGhlIHN1cGVyY2xhc3MgY29uc3RydWN0b3IgZXZlciBhY3R1YWxseQogICAgICAgICAgKiBjYXJlcyBhYm91dCB0aGUgY29udGVudCBpbnN0ZWFkIG9mIGp1c3QgaG9sZGluZyB0aGUgcmVmZXJlbmNlLgogICAgICAgICAgKi8KQEAgLTk0LDEzICs5NiwxMyBAQAogICAgICAgICBtTGluZURpcmVjdGlvbnMgPSBuZXcgRGlyZWN0aW9uc1sKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXlVdGlscy5pZGVhbEludEFycmF5U2l6ZSgyICogbUNvbHVtbnMpXTsKIAorICAgICAgICBtTWVhc3VyZWQgPSBNZWFzdXJlZFRleHQub2J0YWluKCk7CisKICAgICAgICAgZ2VuZXJhdGUoc291cmNlLCBidWZzdGFydCwgYnVmZW5kLCBwYWludCwgb3V0ZXJ3aWR0aCwgYWxpZ24sCiAgICAgICAgICAgICAgICAgIHNwYWNpbmdtdWx0LCBzcGFjaW5nYWRkLCBpbmNsdWRlcGFkLCBpbmNsdWRlcGFkLAogICAgICAgICAgICAgICAgICBlbGxpcHNpemUgIT0gbnVsbCwgZWxsaXBzaXplZFdpZHRoLCBlbGxpcHNpemUpOwogCi0gICAgICAgIG1DaGRpcnMgPSBudWxsOwotICAgICAgICBtQ2hzID0gbnVsbDsKLSAgICAgICAgbVdpZHRocyA9IG51bGw7CisgICAgICAgIG1NZWFzdXJlZCA9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ICAgICAgcGFyYUVuZCA9IGJ1ZmVuZDsKICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICBlbmQgPSBUZXh0VXRpbHMuaW5kZXhPZihzb3VyY2UsICdcbicsIHN0YXJ0LCBidWZlbmQpOworICAgICAgICAgICAgICAgIHBhcmFFbmQrKzsKKyAgICAgICAgICAgIGludCBwYXJhTGVuID0gcGFyYUVuZCAtIHBhcmFTdGFydDsKIAotICAgICAgICAgICAgaWYgKGVuZCA8IDApCi0gICAgICAgICAgICAgICAgZW5kID0gYnVmZW5kOwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIGVuZCsrOwotCi0gICAgICAgICAgICBpbnQgZmlyc3RXaWR0aExpbmVDb3VudCA9IDE7CisgICAgICAgICAgICBpbnQgZmlyc3RXaWR0aExpbmVMaW1pdCA9IG1MaW5lQ291bnQgKyAxOwogICAgICAgICAgICAgaW50IGZpcnN0d2lkdGggPSBvdXRlcndpZHRoOwogICAgICAgICAgICAgaW50IHJlc3R3aWR0aCA9IG91dGVyd2lkdGg7CiAKICAgICAgICAgICAgIExpbmVIZWlnaHRTcGFuW10gY2hvb3NlaHQgPSBudWxsOwogCiAgICAgICAgICAgICBpZiAoc3Bhbm5lZCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgTGVhZGluZ01hcmdpblNwYW5bXSBzcDsKLQotICAgICAgICAgICAgICAgIHNwID0gc3Bhbm5lZC5nZXRTcGFucyhzdGFydCwgZW5kLCBMZWFkaW5nTWFyZ2luU3Bhbi5jbGFzcyk7CisgICAgICAgICAgICAgICAgTGVhZGluZ01hcmdpblNwYW5bXSBzcCA9IHNwYW5uZWQuZ2V0U3BhbnMocGFyYVN0YXJ0LCBwYXJhRW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgTGVhZGluZ01hcmdpblNwYW4uY2xhc3MpOwogICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgc3AubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgICAgICAgICAgTGVhZGluZ01hcmdpblNwYW4gbG1zID0gc3BbaV07CiAgICAgICAgICAgICAgICAgICAgIGZpcnN0d2lkdGggLT0gc3BbaV0uZ2V0TGVhZGluZ01hcmdpbih0cnVlKTsKICAgICAgICAgICAgICAgICAgICAgcmVzdHdpZHRoIC09IHNwW2ldLmdldExlYWRpbmdNYXJnaW4oZmFsc2UpOwotICAgICAgICAgICAgICAgICAgICBpZiAobG1zIGluc3RhbmNlb2YgTGVhZGluZ01hcmdpblNwYW4uTGVhZGluZ01hcmdpblNwYW4yKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmaXJzdFdpZHRoTGluZUNvdW50ID0gKChMZWFkaW5nTWFyZ2luU3Bhbi5MZWFkaW5nTWFyZ2luU3BhbjIpbG1zKS5nZXRMZWFkaW5nTWFyZ2luTGluZUNvdW50KCk7CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAvLyBMZWFkaW5nTWFyZ2luU3BhbjIgaXMgb2RkLiAgVGhlIGNvdW50IGFmZmVjdHMgYWxsCisgICAgICAgICAgICAgICAgICAgIC8vIGxlYWRpbmcgbWFyZ2luIHNwYW5zLCBub3QganVzdCB0aGlzIHBhcnRpY3VsYXIgb25lLAorICAgICAgICAgICAgICAgICAgICAvLyBhbmQgc3RhcnQgZnJvbSB0aGUgdG9wIG9mIHRoZSBzcGFuLCBub3QgdGhlIHRvcCBvZiB0aGUKKyAgICAgICAgICAgICAgICAgICAgLy8gcGFyYWdyYXBoLgorICAgICAgICAgICAgICAgICAgICBpZiAobG1zIGluc3RhbmNlb2YgTGVhZGluZ01hcmdpblNwYW4yKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMZWFkaW5nTWFyZ2luU3BhbjIgbG1zMiA9IChMZWFkaW5nTWFyZ2luU3BhbjIpIGxtczsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBsbXNGaXJzdExpbmUgPSBnZXRMaW5lRm9yT2Zmc2V0KHNwYW5uZWQuZ2V0U3BhblN0YXJ0KGxtczIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0V2lkdGhMaW5lTGltaXQgPSBsbXNGaXJzdExpbmUgKyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsbXMyLmdldExlYWRpbmdNYXJnaW5MaW5lQ291bnQoKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgIGNob29zZWh0ID0gc3Bhbm5lZC5nZXRTcGFucyhzdGFydCwgZW5kLCBMaW5lSGVpZ2h0U3Bhbi5jbGFzcyk7CisgICAgICAgICAgICAgICAgY2hvb3NlaHQgPSBzcGFubmVkLmdldFNwYW5zKHBhcmFTdGFydCwgcGFyYUVuZCwgTGluZUhlaWdodFNwYW4uY2xhc3MpOwogCiAgICAgICAgICAgICAgICAgaWYgKGNob29zZWh0Lmxlbmd0aCAhPSAwKSB7CiAgICAgICAgICAgICAgICAgICAgIGlmIChjaG9vc2VodHYgPT0gbnVsbCB8fApAQCAtMTkyLDExICsxODYsMTEgQEAKICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjaG9vc2VodC5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgICAgICAgICAgaW50IG8gPSBzcGFubmVkLmdldFNwYW5TdGFydChjaG9vc2VodFtpXSk7CiAKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvIDwgc3RhcnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvIDwgcGFyYVN0YXJ0KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc3RhcnRzIGluIHRoaXMgbGF5b3V0LCBiZWZvcmUgdGhlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY3VycmVudCBwYXJhZ3JhcGgKIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZWh0dltpXSA9IGdldExpbmVUb3AoZ2V0TGluZUZvck9mZnNldChvKSk7IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZWh0dltpXSA9IGdldExpbmVUb3AoZ2V0TGluZUZvck9mZnNldChvKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN0YXJ0cyBpbiB0aGlzIHBhcmFncmFwaAogCkBAIC0yMDYsMTYyICsyMDAsODcgQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIGlmIChlbmQgLSBzdGFydCA+IGNoZGlycy5sZW5ndGgpIHsKLSAgICAgICAgICAgICAgICBjaGRpcnMgPSBuZXcgYnl0ZVtBcnJheVV0aWxzLmlkZWFsQnl0ZUFycmF5U2l6ZShlbmQgLSBzdGFydCldOwotICAgICAgICAgICAgICAgIG1DaGRpcnMgPSBjaGRpcnM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoZW5kIC0gc3RhcnQgPiBjaHMubGVuZ3RoKSB7Ci0gICAgICAgICAgICAgICAgY2hzID0gbmV3IGNoYXJbQXJyYXlVdGlscy5pZGVhbENoYXJBcnJheVNpemUoZW5kIC0gc3RhcnQpXTsKLSAgICAgICAgICAgICAgICBtQ2hzID0gY2hzOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKChlbmQgLSBzdGFydCkgKiAyID4gd2lkdGhzLmxlbmd0aCkgewotICAgICAgICAgICAgICAgIHdpZHRocyA9IG5ldyBmbG9hdFtBcnJheVV0aWxzLmlkZWFsSW50QXJyYXlTaXplKChlbmQgLSBzdGFydCkgKiAyKV07Ci0gICAgICAgICAgICAgICAgbVdpZHRocyA9IHdpZHRoczsKLSAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1lYXN1cmVkLnNldFBhcmEoc291cmNlLCBwYXJhU3RhcnQsIHBhcmFFbmQsIERJUl9SRVFVRVNUX0RFRkFVTFRfTFRSKTsKKyAgICAgICAgICAgIGNoYXJbXSBjaHMgPSBtZWFzdXJlZC5tQ2hhcnM7CisgICAgICAgICAgICBmbG9hdFtdIHdpZHRocyA9IG1lYXN1cmVkLm1XaWR0aHM7CisgICAgICAgICAgICBieXRlW10gY2hkaXJzID0gbWVhc3VyZWQubUxldmVsczsKKyAgICAgICAgICAgIGludCBkaXIgPSBtZWFzdXJlZC5tRGlyOworICAgICAgICAgICAgYm9vbGVhbiBlYXN5ID0gbWVhc3VyZWQubUVhc3k7CiAKLSAgICAgICAgICAgIFRleHRVdGlscy5nZXRDaGFycyhzb3VyY2UsIHN0YXJ0LCBlbmQsIGNocywgMCk7Ci0gICAgICAgICAgICBmaW5hbCBpbnQgbiA9IGVuZCAtIHN0YXJ0OwotCi0gICAgICAgICAgICBib29sZWFuIGVhc3kgPSB0cnVlOwotICAgICAgICAgICAgYm9vbGVhbiBhbHRlcmVkID0gZmFsc2U7Ci0gICAgICAgICAgICBpbnQgZGlyID0gREVGQVVMVF9ESVI7IC8vIFhYWAotCi0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykgewotICAgICAgICAgICAgICAgIGlmIChjaHNbaV0gPj0gRklSU1RfUklHSFRfVE9fTEVGVCkgewotICAgICAgICAgICAgICAgICAgICBlYXN5ID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLy8gRW5zdXJlIHRoYXQgbm9uZSBvZiB0aGUgdW5kZXJseWluZyBjaGFyYWN0ZXJzIGFyZSB0cmVhdGVkCi0gICAgICAgICAgICAvLyBhcyB2aWFibGUgYnJlYWtwb2ludHMsIGFuZCB0aGF0IHRoZSBlbnRpcmUgcnVuIGdldHMgdGhlCi0gICAgICAgICAgICAvLyBzYW1lIGJpZGkgZGlyZWN0aW9uLgotCi0gICAgICAgICAgICBpZiAoc291cmNlIGluc3RhbmNlb2YgU3Bhbm5lZCkgewotICAgICAgICAgICAgICAgIFNwYW5uZWQgc3AgPSAoU3Bhbm5lZCkgc291cmNlOwotICAgICAgICAgICAgICAgIFJlcGxhY2VtZW50U3BhbltdIHNwYW5zID0gc3AuZ2V0U3BhbnMoc3RhcnQsIGVuZCwgUmVwbGFjZW1lbnRTcGFuLmNsYXNzKTsKLQotICAgICAgICAgICAgICAgIGZvciAoaW50IHkgPSAwOyB5IDwgc3BhbnMubGVuZ3RoOyB5KyspIHsKLSAgICAgICAgICAgICAgICAgICAgaW50IGEgPSBzcC5nZXRTcGFuU3RhcnQoc3BhbnNbeV0pOwotICAgICAgICAgICAgICAgICAgICBpbnQgYiA9IHNwLmdldFNwYW5FbmQoc3BhbnNbeV0pOwotCi0gICAgICAgICAgICAgICAgICAgIGZvciAoaW50IHggPSBhOyB4IDwgYjsgeCsrKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjaHNbeCAtIHN0YXJ0XSA9ICdcdUZGRkMnOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoIWVhc3kpIHsKLSAgICAgICAgICAgICAgICAvLyBYWFggcHV0IG92ZXJyaWRlIGZsYWdzLCBldGMuIGludG8gY2hkaXJzCi0gICAgICAgICAgICAgICAgZGlyID0gYmlkaShkaXIsIGNocywgY2hkaXJzLCBuLCBmYWxzZSk7Ci0KLSAgICAgICAgICAgICAgICAvLyBEbyBtaXJyb3JpbmcgZm9yIHJpZ2h0LXRvLWxlZnQgc2VnbWVudHMKLQotICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbjsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChjaGRpcnNbaV0gPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX1JJR0hUX1RPX0xFRlQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCBqOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGogPSBpOyBqIDwgbjsgaisrKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoZGlyc1tqXSAhPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfUklHSFRfVE9fTEVGVCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBbmRyb2lkQ2hhcmFjdGVyLm1pcnJvcihjaHMsIGksIGogLSBpKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHRlcmVkID0gdHJ1ZTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGogLSAxOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBDaGFyU2VxdWVuY2Ugc3ViOwotCi0gICAgICAgICAgICBpZiAoYWx0ZXJlZCkgewotICAgICAgICAgICAgICAgIGlmIChhbHRlciA9PSBudWxsKQotICAgICAgICAgICAgICAgICAgICBhbHRlciA9IEFsdGVyZWRDaGFyU2VxdWVuY2UubWFrZShzb3VyY2UsIGNocywgc3RhcnQsIGVuZCk7Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICBhbHRlci51cGRhdGUoY2hzLCBzdGFydCwgZW5kKTsKLQotICAgICAgICAgICAgICAgIHN1YiA9IGFsdGVyOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBzdWIgPSBzb3VyY2U7Ci0gICAgICAgICAgICB9CisgICAgICAgICAgICBDaGFyU2VxdWVuY2Ugc3ViID0gc291cmNlOwogCiAgICAgICAgICAgICBpbnQgd2lkdGggPSBmaXJzdHdpZHRoOwogCiAgICAgICAgICAgICBmbG9hdCB3ID0gMDsKLSAgICAgICAgICAgIGludCBoZXJlID0gc3RhcnQ7CisgICAgICAgICAgICBpbnQgaGVyZSA9IHBhcmFTdGFydDsKIAotICAgICAgICAgICAgaW50IG9rID0gc3RhcnQ7CisgICAgICAgICAgICBpbnQgb2sgPSBwYXJhU3RhcnQ7CiAgICAgICAgICAgICBmbG9hdCBva3dpZHRoID0gdzsKICAgICAgICAgICAgIGludCBva2FzY2VudCA9IDAsIG9rZGVzY2VudCA9IDAsIG9rdG9wID0gMCwgb2tib3R0b20gPSAwOwogCi0gICAgICAgICAgICBpbnQgZml0ID0gc3RhcnQ7CisgICAgICAgICAgICBpbnQgZml0ID0gcGFyYVN0YXJ0OwogICAgICAgICAgICAgZmxvYXQgZml0d2lkdGggPSB3OwogICAgICAgICAgICAgaW50IGZpdGFzY2VudCA9IDAsIGZpdGRlc2NlbnQgPSAwLCBmaXR0b3AgPSAwLCBmaXRib3R0b20gPSAwOwogCi0gICAgICAgICAgICBib29sZWFuIHRhYiA9IGZhbHNlOworICAgICAgICAgICAgYm9vbGVhbiBoYXNUYWJPckVtb2ppID0gZmFsc2U7CisgICAgICAgICAgICBib29sZWFuIGhhc1RhYiA9IGZhbHNlOworICAgICAgICAgICAgVGFiU3RvcHMgdGFiU3RvcHMgPSBudWxsOwogCi0gICAgICAgICAgICBpbnQgbmV4dDsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSBzdGFydDsgaSA8IGVuZDsgaSA9IG5leHQpIHsKLSAgICAgICAgICAgICAgICBpZiAoc3Bhbm5lZCA9PSBudWxsKQotICAgICAgICAgICAgICAgICAgICBuZXh0ID0gZW5kOwotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgbmV4dCA9IHNwYW5uZWQubmV4dFNwYW5UcmFuc2l0aW9uKGksIGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1ldHJpY0FmZmVjdGluZ1NwYW4uCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzcyk7CisgICAgICAgICAgICBmb3IgKGludCBzcGFuU3RhcnQgPSBwYXJhU3RhcnQsIHNwYW5FbmQgPSBzcGFuU3RhcnQsIG5leHRTcGFuU3RhcnQ7CisgICAgICAgICAgICAgICAgICAgIHNwYW5TdGFydCA8IHBhcmFFbmQ7IHNwYW5TdGFydCA9IG5leHRTcGFuU3RhcnQpIHsKIAotICAgICAgICAgICAgICAgIGlmIChzcGFubmVkID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgcGFpbnQuZ2V0VGV4dFdpZHRocyhzdWIsIGksIG5leHQsIHdpZHRocyk7Ci0gICAgICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkod2lkdGhzLCAwLCB3aWR0aHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5kIC0gc3RhcnQgKyAoaSAtIHN0YXJ0KSwgbmV4dCAtIGkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgICAgICBwYWludC5nZXRGb250TWV0cmljc0ludChmbSk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgbVdvcmtQYWludC5iYXNlbGluZVNoaWZ0ID0gMDsKKyAgICAgICAgICAgICAgICBpZiAoc3BhblN0YXJ0ID09IHNwYW5FbmQpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNwYW5uZWQgPT0gbnVsbCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHNwYW5FbmQgPSBwYXJhRW5kOworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICBzcGFuRW5kID0gc3Bhbm5lZC5uZXh0U3BhblRyYW5zaXRpb24oc3BhblN0YXJ0LCBwYXJhRW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNZXRyaWNBZmZlY3RpbmdTcGFuLmNsYXNzKTsKIAotICAgICAgICAgICAgICAgICAgICBTdHlsZWQuZ2V0VGV4dFdpZHRocyhwYWludCwgbVdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3Bhbm5lZCwgaSwgbmV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGhzLCBmbSk7Ci0gICAgICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkod2lkdGhzLCAwLCB3aWR0aHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5kIC0gc3RhcnQgKyAoaSAtIHN0YXJ0KSwgbmV4dCAtIGkpOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChtV29ya1BhaW50LmJhc2VsaW5lU2hpZnQgPCAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmbS5hc2NlbnQgKz0gbVdvcmtQYWludC5iYXNlbGluZVNoaWZ0OwotICAgICAgICAgICAgICAgICAgICAgICAgZm0udG9wICs9IG1Xb3JrUGFpbnQuYmFzZWxpbmVTaGlmdDsKKyAgICAgICAgICAgICAgICAgICAgaW50IHNwYW5MZW4gPSBzcGFuRW5kIC0gc3BhblN0YXJ0OworICAgICAgICAgICAgICAgICAgICBpZiAoc3Bhbm5lZCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtZWFzdXJlZC5hZGRTdHlsZVJ1bihwYWludCwgc3BhbkxlbiwgZm0pOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgZm0uZGVzY2VudCArPSBtV29ya1BhaW50LmJhc2VsaW5lU2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmbS5ib3R0b20gKz0gbVdvcmtQYWludC5iYXNlbGluZVNoaWZ0OworICAgICAgICAgICAgICAgICAgICAgICAgTWV0cmljQWZmZWN0aW5nU3BhbltdIHNwYW5zID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGFubmVkLmdldFNwYW5zKHNwYW5TdGFydCwgc3BhbkVuZCwgTWV0cmljQWZmZWN0aW5nU3Bhbi5jbGFzcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBtZWFzdXJlZC5hZGRTdHlsZVJ1bihwYWludCwgc3BhbnMsIHNwYW5MZW4sIGZtKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KIAorICAgICAgICAgICAgICAgIG5leHRTcGFuU3RhcnQgPSBzcGFuRW5kOworICAgICAgICAgICAgICAgIGludCBzdGFydEluUGFyYSA9IHNwYW5TdGFydCAtIHBhcmFTdGFydDsKKyAgICAgICAgICAgICAgICBpbnQgZW5kSW5QYXJhID0gc3BhbkVuZCAtIHBhcmFTdGFydDsKKwogICAgICAgICAgICAgICAgIGludCBmbXRvcCA9IGZtLnRvcDsKICAgICAgICAgICAgICAgICBpbnQgZm1ib3R0b20gPSBmbS5ib3R0b207CiAgICAgICAgICAgICAgICAgaW50IGZtYXNjZW50ID0gZm0uYXNjZW50OwogICAgICAgICAgICAgICAgIGludCBmbWRlc2NlbnQgPSBmbS5kZXNjZW50OwogCi0gICAgICAgICAgICAgICAgaWYgKGZhbHNlKSB7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgc2IgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBqID0gaTsgaiA8IG5leHQ7IGorKykgewotICAgICAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKHdpZHRoc1tqIC0gc3RhcnQgKyAoZW5kIC0gc3RhcnQpXSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoJyAnKTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIExvZy5lKCJ0ZXh0Iiwgc2IudG9TdHJpbmcoKSk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgZm9yIChpbnQgaiA9IGk7IGogPCBuZXh0OyBqKyspIHsKLSAgICAgICAgICAgICAgICAgICAgY2hhciBjID0gY2hzW2ogLSBzdGFydF07CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaiA9IHNwYW5TdGFydDsgaiA8IHNwYW5FbmQ7IGorKykgeworICAgICAgICAgICAgICAgICAgICBjaGFyIGMgPSBjaHNbaiAtIHBhcmFTdGFydF07CiAgICAgICAgICAgICAgICAgICAgIGZsb2F0IGJlZm9yZSA9IHc7CiAKICAgICAgICAgICAgICAgICAgICAgaWYgKGMgPT0gJ1xuJykgewogICAgICAgICAgICAgICAgICAgICAgICAgOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGMgPT0gJ1x0JykgewotICAgICAgICAgICAgICAgICAgICAgICAgdyA9IExheW91dC5uZXh0VGFiKHN1Yiwgc3RhcnQsIGVuZCwgdywgbnVsbCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0YWIgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGMgPj0gMHhEODAwICYmIGMgPD0gMHhERkZGICYmIGogKyAxIDwgbmV4dCkgewotICAgICAgICAgICAgICAgICAgICAgICAgaW50IGVtb2ppID0gQ2hhcmFjdGVyLmNvZGVQb2ludEF0KGNocywgaiAtIHN0YXJ0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoYXNUYWIgPT0gZmFsc2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYXNUYWIgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhc1RhYk9yRW1vamkgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzcGFubmVkICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gRmlyc3QgdGFiIHRoaXMgcGFyYSwgY2hlY2sgZm9yIHRhYnN0b3BzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRhYlN0b3BTcGFuW10gc3BhbnMgPSBzcGFubmVkLmdldFNwYW5zKHBhcmFTdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhRW5kLCBUYWJTdG9wU3Bhbi5jbGFzcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzcGFucy5sZW5ndGggPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YWJTdG9wcyA9IG5ldyBUYWJTdG9wcyhUQUJfSU5DUkVNRU5ULCBzcGFucyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGFiU3RvcHMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgPSB0YWJTdG9wcy5uZXh0VGFiKHcpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ID0gVGFiU3RvcHMubmV4dERlZmF1bHRTdG9wKHcsIFRBQl9JTkNSRU1FTlQpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGMgPj0gMHhEODAwICYmIGMgPD0gMHhERkZGICYmIGogKyAxIDwgc3BhbkVuZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaW50IGVtb2ppID0gQ2hhcmFjdGVyLmNvZGVQb2ludEF0KGNocywgaiAtIHBhcmFTdGFydCk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbW9qaSA+PSBNSU5fRU1PSkkgJiYgZW1vamkgPD0gTUFYX0VNT0pJKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQml0bWFwIGJtID0gRU1PSklfRkFDVE9SWS4KQEAgLTM3NiwyMSArMjk1LDIxIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGljaFBhaW50ID0gbVdvcmtQYWludDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHdpZCA9IChmbG9hdCkgYm0uZ2V0V2lkdGgoKSAqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHdpZCA9IGJtLmdldFdpZHRoKCkgKgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtd2hpY2hQYWludC5hc2NlbnQoKSAvCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJtLmdldEhlaWdodCgpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgKz0gd2lkOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YWIgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYXNUYWJPckVtb2ppID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaisrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgKz0gd2lkdGhzW2ogLSBzdGFydCArIChlbmQgLSBzdGFydCldOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ICs9IHdpZHRoc1tqIC0gcGFyYVN0YXJ0XTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgKz0gd2lkdGhzW2ogLSBzdGFydCArIChlbmQgLSBzdGFydCldOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgKz0gd2lkdGhzW2ogLSBwYXJhU3RhcnRdOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgdyArPSB3aWR0aHNbaiAtIHN0YXJ0ICsgKGVuZCAtIHN0YXJ0KV07CisgICAgICAgICAgICAgICAgICAgICAgICB3ICs9IHdpZHRoc1tqIC0gcGFyYVN0YXJ0XTsKICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgIC8vIExvZy5lKCJ0ZXh0IiwgIndhcyAiICsgYmVmb3JlICsgIiBub3cgIiArIHcgKyAiIGFmdGVyICIgKyBjICsgIiB3aXRoaW4gIiArIHdpZHRoKTsKQEAgLTQxMSw3ICszMzAsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgLyoKICAgICAgICAgICAgICAgICAgICAgICAgICAqIEZyb20gdGhlIFVuaWNvZGUgTGluZSBCcmVha2luZyBBbGdvcml0aG06CiAgICAgICAgICAgICAgICAgICAgICAgICAgKiAoYXQgbGVhc3QgYXBwcm94aW1hdGVseSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAqICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAqCiAgICAgICAgICAgICAgICAgICAgICAgICAgKiAuLDo7IGFyZSBjbGFzcyBJUzogYnJlYWtwb2ludHMKICAgICAgICAgICAgICAgICAgICAgICAgICAqICAgICAgZXhjZXB0IHdoZW4gYWRqYWNlbnQgdG8gZGlnaXRzCiAgICAgICAgICAgICAgICAgICAgICAgICAgKiAvICAgIGlzIGNsYXNzIFNZOiBhIGJyZWFrcG9pbnQKQEAgLTQyNiwxMiArMzQ1LDEyIEBACiAKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjID09ICcgJyB8fCBjID09ICdcdCcgfHwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGMgPT0gJy4nICB8fCBjID09ICcsJyB8fCBjID09ICc6JyB8fCBjID09ICc7JykgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGogLSAxIDwgaGVyZSB8fCAhQ2hhcmFjdGVyLmlzRGlnaXQoY2hzW2ogLSAxIC0gc3RhcnRdKSkgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGogKyAxID49IG5leHQgfHwgIUNoYXJhY3Rlci5pc0RpZ2l0KGNoc1tqICsgMSAtIHN0YXJ0XSkpKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaiAtIDEgPCBoZXJlIHx8ICFDaGFyYWN0ZXIuaXNEaWdpdChjaHNbaiAtIDEgLSBwYXJhU3RhcnRdKSkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGogKyAxID49IHNwYW5FbmQgfHwgIUNoYXJhY3Rlci5pc0RpZ2l0KGNoc1tqICsgMSAtIHBhcmFTdGFydF0pKSkgfHwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGMgPT0gJy8nIHx8IGMgPT0gJy0nKSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaiArIDEgPj0gbmV4dCB8fCAhQ2hhcmFjdGVyLmlzRGlnaXQoY2hzW2ogKyAxIC0gc3RhcnRdKSkpIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChqICsgMSA+PSBzcGFuRW5kIHx8ICFDaGFyYWN0ZXIuaXNEaWdpdChjaHNbaiArIDEgLSBwYXJhU3RhcnRdKSkpIHx8CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGMgPj0gRklSU1RfQ0pLICYmIGlzSWRlb2dyYXBoaWMoYywgdHJ1ZSkgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiArIDEgPCBuZXh0ICYmIGlzSWRlb2dyYXBoaWMoY2hzW2ogKyAxIC0gc3RhcnRdLCBmYWxzZSkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogKyAxIDwgc3BhbkVuZCAmJiBpc0lkZW9ncmFwaGljKGNoc1tqICsgMSAtIHBhcmFTdGFydF0sIGZhbHNlKSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBva3dpZHRoID0gdzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvayA9IGogKyAxOwogCkBAIC00NDgsNyArMzY3LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvayAhPSBoZXJlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTG9nLmUoInRleHQiLCAib3V0cHV0IG9rICIgKyBoZXJlICsgIiB0byAiICtvayk7CiAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAob2sgPCBuZXh0ICYmIGNoc1tvayAtIHN0YXJ0XSA9PSAnICcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAob2sgPCBzcGFuRW5kICYmIGNoc1tvayAtIHBhcmFTdGFydF0gPT0gJyAnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9rKys7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCkBAIC00NTcsMTAgKzM3NiwxMCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2thc2NlbnQsIG9rZGVzY2VudCwgb2t0b3AsIG9rYm90dG9tLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNwYWNpbmdtdWx0LCBzcGFjaW5nYWRkLCBjaG9vc2VodCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZWh0diwgZm0sIHRhYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5lZWRNdWx0aXBseSwgc3RhcnQsIGNoZGlycywgZGlyLCBlYXN5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hvb3NlaHR2LCBmbSwgaGFzVGFiT3JFbW9qaSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5lZWRNdWx0aXBseSwgcGFyYVN0YXJ0LCBjaGRpcnMsIGRpciwgZWFzeSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9rID09IGJ1ZmVuZCwgaW5jbHVkZXBhZCwgdHJhY2twYWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aHMsIHN0YXJ0LCBlbmQgLSBzdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNocywgd2lkdGhzLCBoZXJlIC0gcGFyYVN0YXJ0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hlcmUsIGVsbGlwc2l6ZWRXaWR0aCwgb2t3aWR0aCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhaW50KTsKIApAQCAtNDg0LDcgKzQwMyw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob2sgIT0gaGVyZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIExvZy5lKCJ0ZXh0IiwgIm91dHB1dCBvayAiICsgaGVyZSArICIgdG8gIiArb2spOwogCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKG9rIDwgbmV4dCAmJiBjaHNbb2sgLSBzdGFydF0gPT0gJyAnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKG9rIDwgc3BhbkVuZCAmJiBjaHNbb2sgLSBwYXJhU3RhcnRdID09ICcgJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvaysrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIApAQCAtNDkzLDEwICs0MTIsMTAgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9rYXNjZW50LCBva2Rlc2NlbnQsIG9rdG9wLCBva2JvdHRvbSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHYsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGFjaW5nbXVsdCwgc3BhY2luZ2FkZCwgY2hvb3NlaHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaG9vc2VodHYsIGZtLCB0YWIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZWVkTXVsdGlwbHksIHN0YXJ0LCBjaGRpcnMsIGRpciwgZWFzeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZWh0diwgZm0sIGhhc1RhYk9yRW1vamksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZWVkTXVsdGlwbHksIHBhcmFTdGFydCwgY2hkaXJzLCBkaXIsIGVhc3ksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvayA9PSBidWZlbmQsIGluY2x1ZGVwYWQsIHRyYWNrcGFkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGhzLCBzdGFydCwgZW5kIC0gc3RhcnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaHMsIHdpZHRocywgaGVyZSAtIHBhcmFTdGFydCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoZXJlLCBlbGxpcHNpemVkV2lkdGgsIG9rd2lkdGgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWludCk7CiAKQEAgLTUwOSwxOSArNDI4LDIwIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaXR0b3AsIGZpdGJvdHRvbSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHYsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGFjaW5nbXVsdCwgc3BhY2luZ2FkZCwgY2hvb3NlaHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaG9vc2VodHYsIGZtLCB0YWIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZWVkTXVsdGlwbHksIHN0YXJ0LCBjaGRpcnMsIGRpciwgZWFzeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZWh0diwgZm0sIGhhc1RhYk9yRW1vamksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZWVkTXVsdGlwbHksIHBhcmFTdGFydCwgY2hkaXJzLCBkaXIsIGVhc3ksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaXQgPT0gYnVmZW5kLCBpbmNsdWRlcGFkLCB0cmFja3BhZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRocywgc3RhcnQsIGVuZCAtIHN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hzLCB3aWR0aHMsIGhlcmUgLSBwYXJhU3RhcnQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGVyZSwgZWxsaXBzaXplZFdpZHRoLCBmaXR3aWR0aCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhaW50KTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlcmUgPSBmaXQ7CiAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIExvZy5lKCJ0ZXh0IiwgIm91dHB1dCBvbmUgIiArIGhlcmUgKyAiIHRvICIgKyhoZXJlICsgMSkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lYXN1cmVUZXh0KHBhaW50LCBtV29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZSwgaGVyZSwgaGVyZSArIDEsIGZtLCB0YWIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gWFhYIG5vdCBzdXJlIHdoeSB0aGUgZXhpc3RpbmcgZm0gd2Fzbid0IG9rLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG1lYXN1cmVUZXh0KHBhaW50LCBtV29ya1BhaW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgIHNvdXJjZSwgaGVyZSwgaGVyZSArIDEsIGZtLCB0YWIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgbnVsbCk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gb3V0KHNvdXJjZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlcmUsIGhlcmUrMSwKQEAgLTUyOSwxOSArNDQ5LDIyIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbS50b3AsIGZtLmJvdHRvbSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHYsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGFjaW5nbXVsdCwgc3BhY2luZ2FkZCwgY2hvb3NlaHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaG9vc2VodHYsIGZtLCB0YWIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZWVkTXVsdGlwbHksIHN0YXJ0LCBjaGRpcnMsIGRpciwgZWFzeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZWh0diwgZm0sIGhhc1RhYk9yRW1vamksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZWVkTXVsdGlwbHksIHBhcmFTdGFydCwgY2hkaXJzLCBkaXIsIGVhc3ksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZXJlICsgMSA9PSBidWZlbmQsIGluY2x1ZGVwYWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFja3BhZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRocywgc3RhcnQsIGVuZCAtIHN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hzLCB3aWR0aHMsIGhlcmUgLSBwYXJhU3RhcnQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGVyZSwgZWxsaXBzaXplZFdpZHRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGhzW2hlcmUgLSBzdGFydF0sIHBhaW50KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoc1toZXJlIC0gcGFyYVN0YXJ0XSwgcGFpbnQpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVyZSA9IGhlcmUgKyAxOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGVyZSA8IGkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gbmV4dCA9IGhlcmU7IC8vIG11c3QgcmVtZWFzdXJlCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGVyZSA8IHNwYW5TdGFydCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRpZG4ndCBvdXRwdXQgYWxsIHRoZSB0ZXh0IGZvciB0aGlzIHNwYW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB3ZSd2ZSBtZWFzdXJlZCB0aGUgcmF3IHdpZHRocywgdGhvdWdoLCBzbworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGp1c3QgcmVzZXQgdGhlIHN0YXJ0IHBvaW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9IG5leHRTcGFuU3RhcnQgPSBoZXJlOwogICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gaGVyZSAtIDE7ICAgIC8vIGNvbnRpbnVlIGxvb3BpbmcKICAgICAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTU1MSwxNCArNDc0LDE0IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBmaXRhc2NlbnQgPSBmaXRkZXNjZW50ID0gZml0dG9wID0gZml0Ym90dG9tID0gMDsKICAgICAgICAgICAgICAgICAgICAgICAgIG9rYXNjZW50ID0gb2tkZXNjZW50ID0gb2t0b3AgPSBva2JvdHRvbSA9IDA7CiAKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICgtLWZpcnN0V2lkdGhMaW5lQ291bnQgPD0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKC0tZmlyc3RXaWR0aExpbmVMaW1pdCA8PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGggPSByZXN0d2lkdGg7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIGlmIChlbmQgIT0gaGVyZSkgeworICAgICAgICAgICAgaWYgKHBhcmFFbmQgIT0gaGVyZSkgewogICAgICAgICAgICAgICAgIGlmICgoZml0dG9wIHwgZml0Ym90dG9tIHwgZml0ZGVzY2VudCB8IGZpdGFzY2VudCkgPT0gMCkgewogICAgICAgICAgICAgICAgICAgICBwYWludC5nZXRGb250TWV0cmljc0ludChmbSk7CiAKQEAgLTU3MSwyMCArNDk0LDIwIEBACiAgICAgICAgICAgICAgICAgLy8gTG9nLmUoInRleHQiLCAib3V0cHV0IHJlc3QgIiArIGhlcmUgKyAiIHRvICIgKyBlbmQpOwogCiAgICAgICAgICAgICAgICAgdiA9IG91dChzb3VyY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICBoZXJlLCBlbmQsIGZpdGFzY2VudCwgZml0ZGVzY2VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGhlcmUsIHBhcmFFbmQsIGZpdGFzY2VudCwgZml0ZGVzY2VudCwKICAgICAgICAgICAgICAgICAgICAgICAgIGZpdHRvcCwgZml0Ym90dG9tLAogICAgICAgICAgICAgICAgICAgICAgICAgdiwKICAgICAgICAgICAgICAgICAgICAgICAgIHNwYWNpbmdtdWx0LCBzcGFjaW5nYWRkLCBjaG9vc2VodCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZWh0diwgZm0sIHRhYiwKLSAgICAgICAgICAgICAgICAgICAgICAgIG5lZWRNdWx0aXBseSwgc3RhcnQsIGNoZGlycywgZGlyLCBlYXN5LAotICAgICAgICAgICAgICAgICAgICAgICAgZW5kID09IGJ1ZmVuZCwgaW5jbHVkZXBhZCwgdHJhY2twYWQsCi0gICAgICAgICAgICAgICAgICAgICAgICB3aWR0aHMsIHN0YXJ0LCBlbmQgLSBzdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZWh0diwgZm0sIGhhc1RhYk9yRW1vamksCisgICAgICAgICAgICAgICAgICAgICAgICBuZWVkTXVsdGlwbHksIHBhcmFTdGFydCwgY2hkaXJzLCBkaXIsIGVhc3ksCisgICAgICAgICAgICAgICAgICAgICAgICBwYXJhRW5kID09IGJ1ZmVuZCwgaW5jbHVkZXBhZCwgdHJhY2twYWQsCisgICAgICAgICAgICAgICAgICAgICAgICBjaHMsIHdpZHRocywgaGVyZSAtIHBhcmFTdGFydCwKICAgICAgICAgICAgICAgICAgICAgICAgIHdoZXJlLCBlbGxpcHNpemVkV2lkdGgsIHcsIHBhaW50KTsKICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgc3RhcnQgPSBlbmQ7CisgICAgICAgICAgICBwYXJhU3RhcnQgPSBwYXJhRW5kOwogCi0gICAgICAgICAgICBpZiAoZW5kID09IGJ1ZmVuZCkKKyAgICAgICAgICAgIGlmIChwYXJhRW5kID09IGJ1ZmVuZCkKICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgfQogCkBAIC01OTksMjQ2ICs1MjIsMTMgQEAKICAgICAgICAgICAgICAgICAgICAgdiwKICAgICAgICAgICAgICAgICAgICAgc3BhY2luZ211bHQsIHNwYWNpbmdhZGQsIG51bGwsCiAgICAgICAgICAgICAgICAgICAgIG51bGwsIGZtLCBmYWxzZSwKLSAgICAgICAgICAgICAgICAgICAgbmVlZE11bHRpcGx5LCBidWZlbmQsIGNoZGlycywgREVGQVVMVF9ESVIsIHRydWUsCisgICAgICAgICAgICAgICAgICAgIG5lZWRNdWx0aXBseSwgYnVmZW5kLCBudWxsLCBERUZBVUxUX0RJUiwgdHJ1ZSwKICAgICAgICAgICAgICAgICAgICAgdHJ1ZSwgaW5jbHVkZXBhZCwgdHJhY2twYWQsCi0gICAgICAgICAgICAgICAgICAgIHdpZHRocywgYnVmc3RhcnQsIDAsCisgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIGJ1ZnN0YXJ0LAogICAgICAgICAgICAgICAgICAgICB3aGVyZSwgZWxsaXBzaXplZFdpZHRoLCAwLCBwYWludCk7CiAgICAgICAgIH0KICAgICB9CiAKLSAgICAvKioKLSAgICAgKiBSdW5zIHRoZSB1bmljb2RlIGJpZGkgYWxnb3JpdGhtIG9uIHRoZSBmaXJzdCBuIGNoYXJzIGluIGNocywgcmV0dXJuaW5nCi0gICAgICogdGhlIGNoYXIgZGlycyBpbiBjaEluZm8gYW5kIHRoZSBiYXNlIGxpbmUgZGlyZWN0aW9uIG9mIHRoZSBmaXJzdAotICAgICAqIHBhcmFncmFwaC4KLSAgICAgKiAKLSAgICAgKiBYWFggY2hhbmdlIHJlc3VsdCBmcm9tIGRpcnMgdG8gbGV2ZWxzCi0gICAgICogIAotICAgICAqIEBwYXJhbSBkaXIgdGhlIGRpcmVjdGlvbiBmbGFnLCBlaXRoZXIgRElSX1JFUVVFU1RfTFRSL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LyoKLSAgICAgICAgICogRGV0ZXJtaW5lIHByaW1hcnkgcGFyYWdyYXBoIGRpcmVjdGlvbiBpZiBub3Qgc3BlY2lmaWVkCi0gICAgICAgICAqLwotICAgICAgICBpZiAoZGlyICE9IERJUl9SRVFVRVNUX0xUUiAmJiBkaXIgIT0gRElSX1JFUVVFU1RfUlRMKSB7Ci0gICAgICAgICAgICAvLyBzZXQgdXAgZGVmYXVsdAotICAgICAgICAgICAgZGlyID0gZGlyID49IDAgPyBESVJfTEVGVF9UT19SSUdIVCA6IERJUl9SSUdIVF9UT19MRUZUOwotICAgICAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCBuOyBqKyspIHsKLSAgICAgICAgICAgICAgICBpbnQgZCA9IGNoSW5mb1tqXTsKLQotICAgICAgICAgICAgICAgIGlmIChkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9MRUZUX1RPX1JJR0hUKSB7Ci0gICAgICAgICAgICAgICAgICAgIGRpciA9IERJUl9MRUZUX1RPX1JJR0hUOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX1JJR0hUX1RPX0xFRlQpIHsKLSAgICAgICAgICAgICAgICAgICAgZGlyID0gRElSX1JJR0hUX1RPX0xFRlQ7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGZpbmFsIGJ5dGUgU09SID0gZGlyID09IERJUl9MRUZUX1RPX1JJR0hUID8KLSAgICAgICAgICAgICAgICBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfTEVGVF9UT19SSUdIVCA6Ci0gICAgICAgICAgICAgICAgQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX1JJR0hUX1RPX0xFRlQ7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogWFhYIEV4cGxpY2l0IG92ZXJyaWRlcyBzaG91bGQgZ28gaGVyZQotICAgICAgICAgKi8KLQotICAgICAgICAvKgotICAgICAgICAgKiBXZWFrIHR5cGUgcmVzb2x1dGlvbgotICAgICAgICAgKi8KLQotICAgICAgICAvLyBkdW1wKGNoZGlycywgbiwgImluaXRpYWwiKTsKLQotICAgICAgICAvLyBXMSBub24gc3BhY2luZyBtYXJrcwotICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IG47IGorKykgewotICAgICAgICAgICAgaWYgKGNoSW5mb1tqXSA9PSBDaGFyYWN0ZXIuTk9OX1NQQUNJTkdfTUFSSykgewotICAgICAgICAgICAgICAgIGlmIChqID09IDApCi0gICAgICAgICAgICAgICAgICAgIGNoSW5mb1tqXSA9IFNPUjsKLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIGNoSW5mb1tqXSA9IGNoSW5mb1tqIC0gMV07Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBkdW1wKGNoZGlycywgbiwgIlcxIik7Ci0KLSAgICAgICAgLy8gVzIgZXVyb3BlYW4gbnVtYmVycwotICAgICAgICBieXRlIGN1ciA9IFNPUjsKLSAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCBuOyBqKyspIHsKLSAgICAgICAgICAgIGJ5dGUgZCA9IGNoSW5mb1tqXTsKLQotICAgICAgICAgICAgaWYgKGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0xFRlRfVE9fUklHSFQgfHwKLSAgICAgICAgICAgICAgICBkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9SSUdIVF9UT19MRUZUIHx8Ci0gICAgICAgICAgICAgICAgZCA9PSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfUklHSFRfVE9fTEVGVF9BUkFCSUMpCi0gICAgICAgICAgICAgICAgY3VyID0gZDsKLSAgICAgICAgICAg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0b3JzCi0gICAgICAgIGJvb2xlYW4gYWRqYWNlbnQgPSBmYWxzZTsKLSAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCBuOyBqKyspIHsKLSAgICAgICAgICAgIGJ5dGUgZCA9IGNoSW5mb1tqXTsKLQotICAgICAgICAgICAgaWYgKGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0VVUk9QRUFOX05VTUJFUikKLSAgICAgICAgICAgICAgICBhZGphY2VudCA9IHRydWU7Ci0gICAgICAgICAgICBlbHNlIGlmIChkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9FVVJPUEVBTl9OVU1CRVJfVEVSTUlOQVRPUiAmJiBhZGphY2VudCkKLSAgICAgICAgICAgICAgICBjaEluZm9bal0gPSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfRVVST1BFQU5fTlVNQkVSOwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIGFkamFjZW50ID0gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICAvL2R1bXAoY2hkaXJzLCBuLCAiVzUiKTsKLQotICAgICAgICAvLyBXNSBldXJvcGVhbiBudW1iZXIgdGVybWluYXRvcnMgcGFydCAyLAotICAgICAgICAvLyBXNiBzZXBhcmF0b3JzIGFuZCB0ZXJtaW5hdG9ycwotICAgICAgICBhZGphY2VudCA9IGZhbHNlOwotICAgICAgICBmb3IgKGludCBqID0gbiAtIDE7IGogPj0gMDsgai0tKSB7Ci0gICAgICAgICAgICBieXRlIGQgPSBjaEluZm9bal07Ci0KLSAgICAgICAgICAgIGlmIChkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9FVVJPUEVBTl9OVU1CRVIpCi0gICAgICAgICAgICAgICAgYWRqYWNlbnQgPSB0cnVlOwotICAgICAgICAgICAgZWxzZSBpZiAoZCA9PSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfRVVST1BFQU5fTlVNQkVSX1RFUk1JTkFUT1IpIHsKLSAgICAgICAgICAgICAgICBpZiAoYWRqYWNlbnQpCi0gICAgICAgICAgICAgICAgICAgIGNoSW5mb1tqXSA9IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9FVVJPUEVBTl9OVU1CRVI7Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICBjaEluZm9bal0gPSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfT1RIRVJfTkVVVFJBTFM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgICAgICBhZGphY2VudCA9IGZhbHNlOwotCi0gICAgICAgICAgICAgICAgaWYgKGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0VVUk9QRUFOX05VTUJFUl9TRVBBUkFUT1IgfHwKLSAgICAgICAgICAgICAgICAgICAgZCA9PSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfQ09NTU9OX05VTUJFUl9TRVBBUkFUT1IgfHwKLSAgICAgICAgICAgICAgICAgICAgZCA9PSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfUEFSQUdSQVBIX1NFUEFSQVRPUiB8fAotICAgICAgICAgICAgICAgICAgICBkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9TRUdNRU5UX1NFUEFSQVRPUikKLSAgICAgICAgICAgICAgICAgICAgY2hJbmZvW2pdID0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX09USEVSX05FVVRSQUxTOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLy8gZHVtcChjaGRpcnMsIG4sICJXNiIpOwotCi0gICAgICAgIC8vIFc3IHN0cm9uZyBkaXJlY3Rpb24gb2YgZXVyb3BlYW4gbnVtYmVycwotICAgICAgICBjdXIgPSBTT1I7Ci0gICAgICAgIGZvciAoaW50IGogPSAwOyBqIDwgbjsgaisrKSB7Ci0gICAgICAgICAgICBieXRlIGQgPSBjaEluZm9bal07Ci0KLSAgICAgICAgICAgIGlmIChkID09IFNPUiB8fAotICAgICAgICAgICAgICAgIGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0xFRlRfVE9fUklHSFQgfHwKLSAgICAgICAgICAgICAgICBkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9SSUdIVF9UT19MRUZUKQotICAgICAgICAgICAgICAgIGN1ciA9IGQ7Ci0KLSAgICAgICAgICAgIGlmIChkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9FVVJPUEVBTl9OVU1CRVIpCi0gICAgICAgICAgICAgICAgY2hJbmZvW2pdID0gY3VyOwotICAgICAgICB9Ci0KLSAgICAgICAgLy8gZHVtcChjaGRpcnMsIG4sICJXNyIpOwotCi0gICAgICAgIC8vIE4xLCBOMiBuZXV0cmFscwotICAgICAgICBjdXIgPSBTT1I7Ci0gICAgICAgIGZvciAoaW50IGogPSAwOyBqIDwgbjsgaisrKSB7Ci0gICAgICAgICAgICBieXRlIGQgPSBjaEluZm9bal07Ci0KLSAgICAgICAgICAgIGlmIChkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9MRUZUX1RPX1JJR0hUIHx8Ci0gICAgICAgICAgICAgICAgZCA9PSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfUklHSFRfVE9fTEVGVCkgewotICAgICAgICAgICAgICAgIGN1ciA9IGQ7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0VVUk9QRUFOX05VTUJFUiB8fAotICAgICAgICAgICAgICAgICAgICAgICBkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9BUkFCSUNfTlVNQkVSKSB7Ci0gICAgICAgICAgICAgICAgY3VyID0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX1JJR0hUX1RPX0xFRlQ7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGJ5dGUgZGQgPSBTT1I7Ci0gICAgICAgICAgICAgICAgaW50IGs7Ci0KLSAgICAgICAgICAgICAgICBmb3IgKGsgPSBqICsgMTsgayA8IG47IGsrKykgewotICAgICAgICAgICAgICAgICAgICBkZCA9IGNoSW5mb1trXTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoZGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0xFRlRfVE9fUklHSFQgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgIGRkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9SSUdIVF9UT19MRUZUKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAoZGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0VVUk9QRUFOX05VTUJFUiB8fAotICAgICAgICAgICAgICAgICAgICAgICAgZGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0FSQUJJQ19OVU1CRVIpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGRkID0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX1JJR0hUX1RPX0xFRlQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGZvciAoaW50IHkgPSBqOyB5IDwgazsgeSsrKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChkZCA9PSBjdXIpCi0gICAgICAgICAgICAgICAgICAgICAgICBjaEluZm9beV0gPSBjdXI7Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIGNoSW5mb1t5XSA9IFNPUjsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBqID0gayAtIDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBkdW1wKGNoZGlycywgbiwgImZpbmFsIik7Ci0KLSAgICAgICAgLy8gZXh0cmE6IGVuZm9yY2UgdGhhdCBhbGwgdGFicyBhbmQgc3Vycm9nYXRlIGNoYXJhY3RlcnMgZ28gdGhlCi0gICAgICAgIC8vIHByaW1hcnkgZGlyZWN0aW9uCi0gICAgICAgIC8vIFRPRE86IGFjdHVhbGx5IGRvIGRpcmVjdGlvbnMgcmlnaHQgZm9yIHN1cnJvZ2F0ZXMKLQotICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IG47IGorKykgewotICAgICAgICAgICAgY2hhciBjID0gY2hzW2pdOwotCi0gICAgICAgICAgICBpZiAoYyA9PSAnXHQnIHx8IChjID49IDB4RDgwMCAmJiBjIDw9IDB4REZGRikpIHsKLSAgICAgICAgICAgICAgICBjaEluZm9bal0gPSBTT1I7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIHJldHVybiBkaXI7Ci0gICAgfQotCiAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgY2hhciBGSVJTVF9DSksgPSAnXHUyRTgwJzsKICAgICAvKioKICAgICAgKiBSZXR1cm5zIHRydWUgaWYgdGhlIHNwZWNpZmllZCBjaGFyYWN0ZXIgaXMgb25lIG9mIHRob3NlIHNwZWNpZmllZApAQCAtOTQ0LDM3ICs2MzQsMTUgQEAKICAgICB9CiAqLwogCi0gICAgcHJpdmF0ZSBzdGF0aWMgaW50IGdldEZpdChUZXh0UGFpbnQgcGFpbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0UGFpbnQgd29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICBDaGFyU2VxdWVuY2UgdGV4dCwgaW50IHN0YXJ0LCBpbnQgZW5kLAotICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB3aWQpIHsKLSAgICAgICAgaW50IGhpZ2ggPSBlbmQgKyAxLCBsb3cgPSBzdGFydCAtIDEsIGd1ZXNzOwotCi0gICAgICAgIHdoaWxlIChoaWdoIC0gbG93ID4gMSkgewotICAgICAgICAgICAgZ3Vlc3MgPSAoaGlnaCArIGxvdykgLyAyOwotCi0gICAgICAgICAgICBpZiAobWVhc3VyZVRleHQocGFpbnQsIHdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0LCBzdGFydCwgZ3Vlc3MsIG51bGwsIHRydWUsIG51bGwpID4gd2lkKQotICAgICAgICAgICAgICAgIGhpZ2ggPSBndWVzczsKLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICBsb3cgPSBndWVzczsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChsb3cgPCBzdGFydCkKLSAgICAgICAgICAgIHJldHVybiBzdGFydDsKLSAgICAgICAgZWxzZQotICAgICAgICAgICAgcmV0dXJuIGxvdzsKLSAgICB9Ci0KICAgICBwcml2YXRlIGludCBvdXQoQ2hhclNlcXVlbmNlIHRleHQsIGludCBzdGFydCwgaW50IGVuZCwKICAgICAgICAgICAgICAgICAgICAgICBpbnQgYWJvdmUsIGludCBiZWxvdywgaW50IHRvcCwgaW50IGJvdHRvbSwgaW50IHYsCiAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgc3BhY2luZ211bHQsIGZsb2F0IHNwYWNpbmdhZGQsCiAgICAgICAgICAgICAgICAgICAgICAgTGluZUhlaWdodFNwYW5bXSBjaG9vc2VodCwgaW50W10gY2hvb3NlaHR2LAotICAgICAgICAgICAgICAgICAgICAgIFBhaW50LkZvbnRNZXRyaWNzSW50IGZtLCBib29sZWFuIHRhYiwKKyAgICAgICAgICAgICAgICAgICAgICBQYWludC5Gb250TWV0cmljc0ludCBmbSwgYm9vbGVhbiBoYXNUYWJPckVtb2ppLAogICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gbmVlZE11bHRpcGx5LCBpbnQgcHN0YXJ0LCBieXRlW10gY2hkaXJzLAogICAgICAgICAgICAgICAgICAgICAgIGludCBkaXIsIGJvb2xlYW4gZWFzeSwgYm9vbGVhbiBsYXN0LAogICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gaW5jbHVkZXBhZCwgYm9vbGVhbiB0cmFja3BhZCwKLSAgICAgICAgICAgICAgICAgICAgICBmbG9hdFtdIHdpZHRocywgaW50IHdpZHN0YXJ0LCBpbnQgd2lkb2ZmLAorICAgICAgICAgICAgICAgICAgICAgIGNoYXJbXSBjaHMsIGZsb2F0W10gd2lkdGhzLCBpbnQgd2lkc3RhcnQsCiAgICAgICAgICAgICAgICAgICAgICAgVGV4dFV0aWxzLlRydW5jYXRlQXQgZWxsaXBzaXplLCBmbG9hdCBlbGxpcHNpc3dpZHRoLAogICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHRleHR3aWR0aCwgVGV4dFBhaW50IHBhaW50KSB7CiAgICAgICAgIGludCBqID0gbUxpbmVDb3VudDsKQEAgLTk4Miw4ICs2NTAsNiBAQAogICAgICAgICBpbnQgd2FudCA9IG9mZiArIG1Db2x1bW5zICsgVE9QOwogICAgICAgICBpbnRbXSBsaW5lcyA9IG1MaW5lczsKIAotICAgICAgICAvLyBMb2cuZSgidGV4dCIsICJsaW5lICIgKyBzdGFydCArICIgdG8gIiArIGVuZCArIChsYXN0ID8gIj09PSIgOiAiIikpOwotCiAgICAgICAgIGlmICh3YW50ID49IGxpbmVzLmxlbmd0aCkgewogICAgICAgICAgICAgaW50IG5sZW4gPSBBcnJheVV0aWxzLmlkZWFsSW50QXJyYXlTaXplKHdhbnQgKyAxKTsKICAgICAgICAgICAgIGludFtdIGdyb3cgPSBuZXcgaW50W25sZW5dOwpAQCAtMTA1OSw1OSArNzI1LDIzIEBACiAgICAgICAgIGxpbmVzW29mZiArIG1Db2x1bW5zICsgU1RBUlRdID0gZW5kOwogICAgICAgICBsaW5lc1tvZmYgKyBtQ29sdW1ucyArIFRPUF0gPSB2OwogCi0gICAgICAgIGlmICh0YWIpCisgICAgICAgIGlmIChoYXNUYWJPckVtb2ppKQogICAgICAgICAgICAgbGluZXNbb2ZmICsgVEFCXSB8PSBUQUJfTUFTSzsKIAotICAgICAgICB7Ci0gICAgICAgICAgICBsaW5lc1tvZmYgKyBESVJdIHw9IGRpciA8PCBESVJfU0hJRlQ7Ci0KLSAgICAgICAgICAgIGludCBjdXIgPSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfTEVGVF9UT19SSUdIVDsKLSAgICAgICAgICAgIGludCBjb3VudCA9IDA7Ci0KLSAgICAgICAgICAgIGlmICghZWFzeSkgewotICAgICAgICAgICAgICAgIGZvciAoaW50IGsgPSBzdGFydDsgayA8IGVuZDsgaysrKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChjaGRpcnNbayAtIHBzdGFydF0gIT0gY3VyKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjb3VudCsrOwotICAgICAgICAgICAgICAgICAgICAgICAgY3VyID0gY2hkaXJzW2sgLSBwc3RhcnRdOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBEaXJlY3Rpb25zIGxpbmVkaXJzOwotCi0gICAgICAgICAgICBpZiAoY291bnQgPT0gMCkgewotICAgICAgICAgICAgICAgIGxpbmVkaXJzID0gRElSU19BTExfTEVGVF9UT19SSUdIVDsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgc2hvcnRbXSBsZCA9IG5ldyBzaG9ydFtjb3VudCArIDFdOwotCi0gICAgICAgICAgICAgICAgY3VyID0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0xFRlRfVE9fUklHSFQ7Ci0gICAgICAgICAgICAgICAgY291bnQgPSAwOwotICAgICAgICAgICAgICAgIGludCBoZXJlID0gc3RhcnQ7Ci0KLSAgICAgICAgICAgICAgICBmb3IgKGludCBrID0gc3RhcnQ7IGsgPCBlbmQ7IGsrKykgewotICAgICAgICAgICAgICAgICAgICBpZiAoY2hkaXJzW2sgLSBwc3RhcnRdICE9IGN1cikgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gWFhYIGNoZWNrIHRvIG1ha2Ugc3VyZSB3ZSBkb24ndAotICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgIG92ZXJmbG93IHNob3J0Ci0gICAgICAgICAgICAgICAgICAgICAgICBsZFtjb3VudCsrXSA9IChzaG9ydCkgKGsgLSBoZXJlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGN1ciA9IGNoZGlyc1trIC0gcHN0YXJ0XTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGhlcmUgPSBrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgbGRbY291bnRdID0gKHNob3J0KSAoZW5kIC0gaGVyZSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoY291bnQgPT0gMSAmJiBsZFswXSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGxpbmVkaXJzID0gRElSU19BTExfUklHSFRfVE9fTEVGVDsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBsaW5lZGlycyA9IG5ldyBEaXJlY3Rpb25zKGxkKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KKyAgICAgICAgbGluZXNbb2ZmICsgRElSXSB8PSBkaXIgPDwgRElSX1NISUZUOworICAgICAgICBEaXJlY3Rpb25zIGxpbmVkaXJzID0gRElSU19BTExfTEVGVF9UT19SSUdIVDsKKyAgICAgICAgLy8gZWFzeSBtZWFucyBhbGwgY2hhcnMgPCB0aGUgZmlyc3QgUlRMLCBzbyBubyBlbW9qaSwgbm8gbm90aGluZworICAgICAgICAvLyBYWFggYSBydW4gd2l0aCBubyB0ZXh0IG9yIGFsbCBzcGFjZXMgaXMgZWFzeSBidXQgbWlnaHQgYmUgYW4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QgbGluZWVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXRbXSB3aWR0aHMsIGludCB3aWRzdGFydCwgaW50IHdpZG9mZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXRbXSB3aWR0aHMsIGludCB3aWRzdGFydCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgYXZhaWwsIFRleHRVdGlscy5UcnVuY2F0ZUF0IHdoZXJlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbGluZSwgZmxvYXQgdGV4dHdpZHRoLCBUZXh0UGFpbnQgcGFpbnQpIHsKICAgICAgICAgaW50IGxlbiA9IGxpbmVlbmQgLSBsaW5lc3RhcnQ7CkBAIC0xMTQyLDcgKzc3Miw3IEBACiAgICAgICAgICAgICBpbnQgaTsKIAogICAgICAgICAgICAgZm9yIChpID0gbGVuOyBpID49IDA7IGktLSkgewotICAgICAgICAgICAgICAgIGZsb2F0IHcgPSB3aWR0aHNbaSAtIDEgKyBsaW5lc3RhcnQgLSB3aWRzdGFydCArIHdpZG9mZl07CisgICAgICAgICAgICAgICAgZmxvYXQgdyA9IHdpZHRoc1tpIC0gMSArIGxpbmVzdGFydCAtIHdpZHN0YXJ0XTsKIAogICAgICAgICAgICAgICAgIGlmICh3ICsgc3VtICsgZWxsaXBzaXN3aWQgPiBhdmFpbCkgewogICAgICAgICAgICAgICAgICAgICBicmVhazsKQEAgLTExNTgsNyArNzg4LDcgQEAKICAgICAgICAgICAgIGludCBpOwogCiAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbGVuOyBpKyspIHsKLSAgICAgICAgICAgICAgICBmbG9hdCB3ID0gd2lkdGhzW2kgKyBsaW5lc3RhcnQgLSB3aWRzdGFydCArIHdpZG9mZl07CisgICAgICAgICAgICAgICAgZmxvYXQgdyA9IHdpZHRoc1tpICsgbGluZXN0YXJ0IC0gd2lkc3RhcnRdOwogCiAgICAgICAgICAgICAgICAgaWYgKHcgKyBzdW0gKyBlbGxpcHNpc3dpZCA+IGF2YWlsKSB7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwpAQCAtMTE3NSw3ICs4MDUsNyBAQAogCiAgICAgICAgICAgICBmbG9hdCByYXZhaWwgPSAoYXZhaWwgLSBlbGxpcHNpc3dpZCkgLyAyOwogICAgICAgICAgICAgZm9yIChyaWdodCA9IGxlbjsgcmlnaHQgPj0gMDsgcmlnaHQtLSkgewotICAgICAgICAgICAgICAgIGZsb2F0IHcgPSB3aWR0aHNbcmlnaHQgLSAxICsgbGluZXN0YXJ0IC0gd2lkc3RhcnQgKyB3aWRvZmZdOworICAgICAgICAgICAgICAgIGZsb2F0IHcgPSB3aWR0aHNbcmlnaHQgLSAxICsgbGluZXN0YXJ0IC0gd2lkc3RhcnRdOwogCiAgICAgICAgICAgICAgICAgaWYgKHcgKyByc3VtID4gcmF2YWlsKSB7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwpAQCAtMTE4Niw3ICs4MTYsNyBAQAogCiAgICAgICAgICAgICBmbG9hdCBsYXZhaWwgPSBhdmFpbCAtIGVsbGlwc2lzd2lkIC0gcnN1bTsKICAgICAgICAgICAgIGZvciAobGVmdCA9IDA7IGxlZnQgPCByaWdodDsgbGVmdCsrKSB7Ci0gICAgICAgICAgICAgICAgZmxvYXQgdyA9IHdpZHRoc1tsZWZ0ICsgbGluZXN0YXJ0IC0gd2lkc3RhcnQgKyB3aWRvZmZdOworICAgICAgICAgICAgICAgIGZsb2F0IHcgPSB3aWR0aHNbbGVmdCArIGxpbmVzdGFydCAtIHdpZHN0YXJ0XTsKIAogICAgICAgICAgICAgICAgIGlmICh3ICsgbHN1bSA+IGxhdmFpbCkgewogICAgICAgICAgICAgICAgICAgICBicmVhazsKQEAgLTEyMDMsNyArODMzLDcgQEAKICAgICAgICAgbUxpbmVzW21Db2x1bW5zICogbGluZSArIEVMTElQU0lTX0NPVU5UXS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V0dXJuLCB3b3JrUGFpbnQgd2lsbCByZWZsZWN0IHRoZSBvcmlnaW5hbCBwYWludCBwbHVzIGFueQotICAgICAqIG1vZGlmaWNhdGlvbnMgbWFkZSBieSBjaGFyYWN0ZXIgc3R5bGVzIG9uIHRoZSBydW4uCi0gICAgICoKLSAgICAgKiA8cD5UaGUgcmV0dXJuZWQgd2lkdGggaXMgc2lnbmVkIGFuZCB3aWxsIGJlIDwgMCBpZiB0aGUgcGFyYWdyYXBoCi0gICAgICogZGlyZWN0aW9uIGlzIHJpZ2h0LXRvLWxlZnQuCi0gICAgICovCi0gICAgcHJpdmF0ZSBzdGF0aWMgZmxvYXQgZHJhd1VuaWZvcm1SdW4oQ2FudmFzIGNhbnZhcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNwYW5uZWQgdGV4dCwgaW50IHN0YXJ0LCBpbnQgZW5kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGRpciwgYm9vbGVhbiBydW5Jc1J0bCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHgsIGludCB0b3AsIGludCB5LCBpbnQgYm90dG9tLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFpbnQuRm9udE1ldHJpY3NJbnQgZm1pLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGV4dFBhaW50IHBhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGV4dFBhaW50IHdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gbmVlZFdpZHRoKSB7Ci0KLSAgICAgICAgYm9vbGVhbiBoYXZlV2lkdGggPSBmYWxzZTsKLSAgICAgICAgZmxvYXQgcmV0ID0gMDsKLSAgICAgICAgQ2hhcmFjdGVyU3R5bGVbXSBzcGFucyA9IHRleHQuZ2V0U3BhbnMoc3RhcnQsIGVuZCwgQ2hhcmFjdGVyU3R5bGUuY2xhc3MpOwotCi0gICA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J0LCBlbmQpOwotICAgICAgICAgICAgICAgIHRtcHN0YXJ0ID0gMDsKLSAgICAgICAgICAgICAgICAvLyBYWFg6IGFzc3VtZXMgZ2V0UmV2ZXJzZSBkb2Vzbid0IGNoYW5nZSB0aGUgbGVuZ3RoIG9mIHRoZSB0ZXh0Ci0gICAgICAgICAgICAgICAgdG1wZW5kID0gZW5kIC0gc3RhcnQ7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHRtcCA9IHRleHQ7Ci0gICAgICAgICAgICAgICAgdG1wc3RhcnQgPSBzdGFydDsKLSAgICAgICAgICAgICAgICB0bXBlbmQgPSBlbmQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChmbWkgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHdvcmtQYWludC5nZXRGb250TWV0cmljc0ludChmbWkpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoY2FudmFzICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBpZiAod29ya1BhaW50LmJnQ29sb3IgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICBpbnQgYyA9IHdvcmtQYWludC5nZXRDb2xvcigpOwotICAgICAgICAgICAgICAgICAgICBQYWludC5TdHlsZSBzID0gd29ya1BhaW50LmdldFN0eWxlKCk7Ci0gICAgICAgICAgICAgICAgICAgIHdvcmtQYWludC5zZXRDb2xvcih3b3JrUGFpbnQuYmdDb2xvcik7Ci0gICAgICAgICAgICAgICAgICAgIHdvcmtQYWludC5zZXRTdHlsZShQYWludC5TdHlsZS5GSUxMKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoIWhhdmVXaWR0aCkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0ID0gd29ya1BhaW50Lm1lYXN1cmVUZXh0KHRtcCwgdG1wc3RhcnQsIHRtcGVuZCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBoYXZlV2lkdGggPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGRpciA9PSBMYXlvdXQuRElSX1JJR0hUX1RPX0xFRlQpCi0gICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QoeCAtIHJldCwgdG9wLCB4LCBib3R0b20sIHdvcmtQYWludCk7Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdCh4LCB0b3AsIHggKyByZXQsIGJvdHRvbSwgd29ya1BhaW50KTsKLQotICAgICAgICAgICAgICAgICAgICB3b3JrUGFpbnQuc2V0U3R5bGUocyk7Ci0gICAgICAgICAgICAgICAgICAgIHdvcmtQYWludC5zZXRDb2xvcihjKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoZGlyID09IExheW91dC5ESVJfUklHSFRfVE9fTEVGVCkgewotICAgICAgICAgICAgICAgICAgICBpZiAoIWhhdmVXaWR0aCkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0ID0gd29ya1BhaW50Lm1lYXN1cmVUZXh0KHRtcCwgdG1wc3RhcnQsIHRtcGVuZCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBoYXZlV2lkdGggPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgY2FudmFzLmRyYXdUZXh0KHRtcCwgdG1wc3RhcnQsIHRtcGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggLSByZXQsIHkgKyB3b3JrUGFpbnQuYmFzZWxpbmVTaGlmdCwgd29ya1BhaW50KTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBpZiAobmVlZFdpZHRoKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWhhdmVXaWR0aCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldCA9IHdvcmtQYWludC5tZWFzdXJlVGV4dCh0bXAsIHRtcHN0YXJ0LCB0bXBlbmQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhdmVXaWR0aCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBjYW52YXMuZHJhd1RleHQodG1wLCB0bXBzdGFydCwgdG1wZW5kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeCwgeSArIHdvcmtQYWludC5iYXNlbGluZVNoaWZ0LCB3b3JrUGFpbnQpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgaWYgKG5lZWRXaWR0aCAmJiAhaGF2ZVdpZHRoKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldCA9IHdvcmtQYWludC5tZWFzdXJlVGV4dCh0bXAsIHRtcHN0YXJ0LCB0bXBlbmQpOwotICAgICAgICAgICAgICAgICAgICBoYXZlV2lkdGggPSB0cnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHJldCA9IHJlcGxhY2VtZW50LmdldFNpemUod29ya1BhaW50LCB0ZXh0LCBzdGFydCwgZW5kLCBmbWkpOwotCi0gICAgICAgICAgICBpZiAoY2FudmFzICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBpZiAoZGlyID09IExheW91dC5ESVJfUklHSFRfVE9fTEVGVCkKLSAgICAgICAgICAgICAgICAgICAgcmVwbGFjZW1lbnQuZHJhdyhjYW52YXMsIHRleHQsIHN0YXJ0LCBlbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeCAtIHJldCwgdG9wLCB5LCBib3R0b20sIHdvcmtQYWludCk7Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAg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WV0cmljc0ludCBmbWksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0UGFpbnQgcGFpbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0UGFpbnQgd29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBuZWVkV2lkdGgpIHsKLQotICAgICAgICAvLyBYWFg6IEl0IGxvb2tzIGxpa2UgYWxsIGNhbGxzIHRvIHRoaXMgQVBJIG1hdGNoIGRpciBhbmQgcnVuSXNSdGwsIHNvCi0gICAgICAgIC8vIGhhdmluZyBib3RoIHBhcmFtZXRlcnMgaXMgcmVkdW5kYW50IGFuZCBjb25mdXNpbmcuCi0KLSAgICAgICAgLy8gZmFzdCBwYXRoIGZvciB1bnN0eWxlZCB0ZXh0Ci0gICAgICAgIGlmICghKHRleHQgaW5zdGFuY2VvZiBTcGFubmVkKSkgewotICAgICAgICAgICAgZmxvYXQgcmV0ID0gMDsKLQotICAgICAgICAgICAgaWYgKHJ1bklzUnRsKSB7Ci0gICAgICAgICAgICAgICAgQ2hhclNlcXVlbmNlIHRtcCA9IFRleHRVdGlscy5nZXRSZXZlcnNlKHRleHQsIHN0YXJ0LCBlbmQpOwotICAgICAgICAgICAgICAgIC8vIFhYWDogdGhpcyBhc3N1bWVzIGdldFJldmVyc2UgZG9lc24ndCB0d2VhayB0aGUgbGVuZ3RoIG9mCi0gICAgICAgICAgICAgICAgLy8gdGhlIHRleHQKLSAgICAgICAgICAgICAgICBpbnQgdG1wZW5kID0gZW5kIC0gc3RhcnQ7Ci0KLSAgICAgICAgICAgICAgICBpZiAoY2FudmFzICE9IG51bGwgfHwgbmVlZFdpZHRoKQotICAgICAgICAgICAgICAgICAgICByZXQgPSBwYWludC5tZWFzdXJlVGV4dCh0bXAsIDAsIHRtcGVuZCk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoY2FudmFzICE9IG51bGwpCi0gICAgICAgICAgICAgICAgICAgIGNhbnZhcy5kcmF3VGV4dCh0bXAsIDAsIHRtcGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggLSByZXQsIHksIHBhaW50KTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgaWYgKG5lZWRXaWR0aCkKLSAgICAgICAgICAgICAgICAgICAgcmV0ID0gcGFpbnQubWVhc3VyZVRleHQodGV4dCwgc3RhcnQsIGVuZCk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoY2FudmFzICE9IG51bGwpCi0gICAgICAgICAgICAgICAgICAgIGNhbnZhcy5kcmF3VGV4dCh0ZXh0LCBzdGFydCwgZW5kLCB4LCB5LCBwYWludCk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChmbWkgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHBhaW50LmdldEZvbnRNZXRyaWNzSW50KGZtaSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHJldHVybiByZXQgKiBkaXI7ICAgLy8gTGF5b3V0LkRJUl9SSUdIVF9UT19MRUZUID09IC0xCi0gICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIGZsb2F0IG94ID0geDsKLSAgICAgICAgaW50IG1pbkFzY2VudCA9IDAsIG1heERlc2NlbnQgPSAwLCBtaW5Ub3AgPSAwLCBtYXhCb3R0b20gPSAwOwotCi0gICAgICAgIFNwYW5uZWQgc3AgPSAoU3Bhbm5lZCkgdGV4dDsKLSAgICAgICAgQ2xhc3M8Pz4gZGl2aXNpb247Ci0KLSAgICAgICAgaWYgKGNhbnZhcyA9PSBudWxsKQotICAgICAgICAgICAgZGl2aXNpb24gPSBNZXRyaWNBZmZlY3RpbmdTcGFuLmNsYXNzOwotICAgICAgICBlbHNlCi0gICAgICAgICAgICBkaXZpc2lvbiA9IENoYXJhY3RlclN0eWxlLmNsYXNzOwotCi0gICAgICAgIGludCBuZXh0OwotICAgICAgICBmb3IgKGludCBpID0gc3RhcnQ7IGkgPCBlbmQ7IGkgPSBuZXh0KSB7Ci0gICAgICAgICAgICBuZXh0ID0gc3AubmV4dFNwYW5UcmFuc2l0aW9uKGksIGVuZCwgZGl2aXNpb24pOwotCi0gICAgICAgICAgICAvLyBYWFg6IGlmIGRpciBhbmQgcnVuSXNSdGwgd2VyZSBub3QgdGhlIHNhbWUsIHRoaXMgd291bGQgZHJhdwotICAgICAgICAgICAgLy8gc3BhbnMgaW4gdGhlIHdyb25nIG9yZGVyLCBidXQgbm8gb25lIGFwcGVhcnMgdG8gY2FsbCBpdCB0aGlzCi0gICAgICAgICAgICAvLyB3YXkuCi0gICAgICAgICAgICB4ICs9IGRyYXdVbmlmb3JtUnVuKGNhbnZhcywgc3AsIGksIG5leHQsIGRpciwgcnVuSXNSdGwsCi0gICAgICAgICAgICAgICAgICB4LCB0b3AsIHksIGJvdHRvbSwgZm1pLCBwYWludCwgd29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgbmVlZFdpZHRoIHx8IG5leHQgIT0gZW5kKTsKLQotICAgICAgICAgICAgaWYgKGZtaSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGZtaS5hc2NlbnQgPCBtaW5Bc2NlbnQpCi0gICAgICAgICAgICAgICAgICAgIG1pbkFzY2VudCA9IGZtaS5hc2NlbnQ7Ci0gICAgICAgICAgICAgICAgaWYgKGZtaS5kZXNjZW50ID4gbWF4RGVzY2VudCkKLSAgICAgICAgICAgICAgICAgICAgbWF4RGVzY2VudCA9IGZtaS5kZXNjZW50OwotCi0gICAgICAgICAgICAgICAgaWYgKGZtaS50b3AgPCBtaW5Ub3ApCi0gICAgICAgICAgICAgICAgICAgIG1pblRvcCA9IGZtaS50b3A7Ci0gICAgICAgICAgICAgICAgaWYgKGZtaS5ib3R0b20gPiBtYXhCb3R0b20pCi0gICAgICAgICAgICAgICAgICAgIG1heEJvdHRvbSA9IGZtaS5ib3R0b207Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoZm1pICE9IG51bGwpIHsKLSAgICAgICAgICAgIGlmIChzdGFydCA9PSBlbmQpIHsKLSAgICAgICAgICAgICAgICBwYWludC5nZXRGb250TWV0cmljc0ludChmbWkpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBmbWkuYXNjZW50ID0gbWluQXNjZW50OwotICAgICAgICAgICAgICAgIGZtaS5kZXNjZW50ID0gbWF4RGVzY2VudDsKLSAgICAgICAgICAgICAgICBmbWkudG9wID0gbWluVG9wOwotICAgICAgICAgICAgICAgIGZtaS5ib3R0b20gPSBtYXhCb3R0b207Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4geCAtIG94OwotICAgIH0KLQotICAgIC8qKgotICAgICAqIERyYXdzIGEgdW5pZGlyZWN0aW9uYWwgcnVuIG9mIHRleHQgb24gYSBzaW5nbGUgbGluZSwgYW5kIG9wdGlvbmFsbHkKLSAgICAgKiByZXR1cm5zIHRoZSBzaWduZWQgYWR2YW5jZS4gIFVubGlrZSBkcmF3RGlyZWN0aW9uYWxSdW4sIHRoZSBwYXJhZ3JhcGgKLSAgICAgKiBkaXJlY3Rpb24gYW5kIHJ1biBkaXJlY3Rpb24gY2FuIGJlIGRpZmZlcmVudC4KLSAgICAgKi8KLSAgICAvKiBwYWNrYWdlICovIHN0YXRpYyBmbG9hdCBkcmF3VGV4dChDYW52YXMgY2FudmFzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2hhclNlcXVlbmNlIHRleHQsIGludCBzdGFydCwgaW50IGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBkaXIsIGJvb2xlYW4gcnVuSXNSdGwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB4LCBpbnQgdG9wLCBpbnQgeSwgaW50IGJvdHRvbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRleHRQYWludCBwYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRleHRQYWludCB3b3JrUGFpbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sZWFuIG5lZWRXaWR0aCkgewotICAgICAgICAvLyBYWFggdGhpcyBsb2dpYyBpcyAoZGlyID09IERJUl9MRUZUX1RPX1JJR0hUKSA9PSBydW5Jc1J0bAotICAgICAgICBpZiAoKGRpciA9PSBMYXlvdXQuRElSX1JJR0hUX1RPX0xFRlQgJiYgIXJ1bklzUnRsKSB8fAotICAgICAgICAgICAgKHJ1bklzUnRsICYmIGRpciA9PSBMYXlvdXQuRElSX0xFRlRfVE9fUklHSFQpKSB7Ci0gICAgICAgICAgICAvLyBUT0RPOiB0aGlzIG5lZWRzIHRoZSByZWFsIGRpcmVjdGlvbgotICAgICAgICAgICAgZmxvYXQgY2ggPSBkcmF3RGlyZWN0aW9uYWxSdW4obnVsbCwgdGV4dCwgc3RhcnQsIGVuZCwKLSAgICAgICAgICAgICAgICAgICAgTGF5b3V0LkRJUl9MRUZUX1RPX1JJR0hULCBmYWxzZSwgMCwgMCwgMCwgMCwgbnVsbCwgcGFpbnQsCi0gICAgICAgICAgICAgICAgICAgIHdvcmtQYWludCwgdHJ1ZSk7Ci0KLSAgICAgICAgICAgIGNoICo9IGRpcjsgIC8vIERJUl9SSUdIVF9UT19MRUZUID09IC0xCi0gICAgICAgICAgICBkcmF3RGlyZWN0aW9uYWxSdW4oY2FudmFzLCB0ZXh0LCBzdGFydCwgZW5kLCAtZGlyLAotICAgICAgICAgICAgICAgICAgICBydW5Jc1J0bCwgeCArIGNoLCB0b3AsIHksIGJvdHRvbSwgbnVsbCwgcGFpbnQsCi0gICAgICAgICAgICAgICAgICAgIHdvcmtQYWludCwgdHJ1ZSk7Ci0KLSAgICAgICAgICAgIHJldHVybiBjaDsKLSAgICAgICAgfQotC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mFtIG5lZWRXaWR0aCBJZiB0cnVlLCB0aGlzIG1ldGhvZCByZXR1cm5zIHRoZSB3aWR0aCBvZiBkcmF3biB0ZXh0Ci0gICAgICogQHJldHVybiBXaWR0aCBvZiB0aGUgZHJhd24gdGV4dCBpZiBuZWVkV2lkdGggaXMgdHJ1ZQotICAgICAqLwotICAgIHB1YmxpYyBzdGF0aWMgZmxvYXQgZHJhd1RleHQoQ2FudmFzIGNhbnZhcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENoYXJTZXF1ZW5jZSB0ZXh0LCBpbnQgc3RhcnQsIGludCBlbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZGlyZWN0aW9uLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeCwgaW50IHRvcCwgaW50IHksIGludCBib3R0b20sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0UGFpbnQgcGFpbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0UGFpbnQgd29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBuZWVkV2lkdGgpIHsKLSAgICAgICAgLy8gRm9yIHNhZmV0eS4KLSAgICAgICAgZGlyZWN0aW9uID0gZGlyZWN0aW9uID49IDAgPyBMYXlvdXQuRElSX0xFRlRfVE9fUklHSFQKLSAgICAgICAgICAgICAgICA6IExheW91dC5ESVJfUklHSFRfVE9fTEVGVDsKLQotICAgICAgICAvLyBIaWRlIHJ1bklzUnRsIHBhcmFtZXRlciBzaW5jZSBpdCBpcyBtZWFuaW5nbGVzcyBmb3IgZXh0ZXJuYWwKLSAgICAgICAgLy8gZGV2ZWxvcGVycy4KLSAgICAgICAgLy8gWFhYOiB0aGUgcnVuSXNSdGwgcHJvYmFibHkgb3VnaHQgdG8gYmUgdGhlIHNhbWUgYXMgZGlyZWN0aW9uLCB0aGVuCi0gICAgICA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IG9mIHRoZSBsYXN0IGNoYXJhY3RlciB0byBtZWFzdXJlCi0gICAgICogQHBhcmFtIGZtaSBGb250TWV0cmljcyBpbmZvcm1hdGlvbjsgY2FuIGJlIG51bGwKLSAgICAgKiBAcmV0dXJuIFRoZSB3aWR0aCBvZiB0aGUgdGV4dAotICAgICAqLwotICAgIHB1YmxpYyBzdGF0aWMgZmxvYXQgbWVhc3VyZVRleHQoVGV4dFBhaW50IHBhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGV4dFBhaW50IHdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENoYXJTZXF1ZW5jZSB0ZXh0LCBpbnQgc3RhcnQsIGludCBlbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYWludC5Gb250TWV0cmljc0ludCBmbWkpIHsKLSAgICAgICAgcmV0dXJuIGRyYXdEaXJlY3Rpb25hbFJ1bihudWxsLCB0ZXh0LCBzdGFydCwgZW5kLAotICAgICAgICAgICAgICAgICAgICAgICBMYXlvdXQuRElSX0xFRlRfVE9fUklHSFQsIGZhbHNlLAotICAgICAgICAgICAgICAgICAgICAgICAwLCAwLCAwLCAwLCBmbWksIHBhaW50LCB3b3JrUGFpbnQsIHRydWUpOwotICAgIH0KLX0KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL3RleHQvVGV4dExpbmUuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL3RleHQvVGV4dExpbmUuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zM2M5NTU0Ci0tLSAvZGV2L251bGwKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvdGV4dC9UZXh0TGluZS5qYXZhCkBAIC0wLDAgKzEsOTQwIEBACisvKgorICogQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY3QKKyAqCisg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IG1IYXNUYWJzOworICAgIHByaXZhdGUgVGFiU3RvcHMgbVRhYnM7CisgICAgcHJpdmF0ZSBjaGFyW10gbUNoYXJzOworICAgIHByaXZhdGUgYm9vbGVhbiBtQ2hhcnNWYWxpZDsKKyAgICBwcml2YXRlIFNwYW5uZWQgbVNwYW5uZWQ7CisgICAgcHJpdmF0ZSBmaW5hbCBUZXh0UGFpbnQgbVdvcmtQYWludCA9IG5ldyBUZXh0UGFpbnQoKTsKKworICAgIHByaXZhdGUgc3RhdGljIFRleHRMaW5lW10gY2FjaGVkID0gbmV3IFRleHRMaW5lWzNdOworCisgICAgLyoqCisgICAgICogUmV0dXJucyBhIG5ldyBUZXh0TGluZSBmcm9tIHRoZSBzaGFyZWQgcG9vbC4KKyAgICAgKgorICAgICAqIEByZXR1cm4gYW4gdW5pbml0aWFsaXplZCBUZXh0TGluZQorICAgICAqLworICAgIHN0YXRpYyBUZXh0TGluZSBvYnRhaW4oKSB7CisgICAgICAgIFRleHRMaW5lIHRsOworICAgICAgICBzeW5jaHJvbml6ZWQgKGNhY2hlZCkgeworICAgICAgICAgICAgZm9yIChpbnQgaSA9IGNhY2hlZC5sZW5ndGg7IC0taSA+PSAwOykgeworICAgICAgICAgICAgICAgIGlmIChjYWNoZWRbaV0gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICB0bCA9IGNhY2hlZFtpXTsKKyAgICAgICAgICAgICAgICAgICAgY2FjaGVkW2ldID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRsOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICB0bCA9IG5ldyBUZXh0TGluZSgpOworICAgICAgICBMb2cuZSgiVExJTkUiLCAibmV3OiAiICsgdGwpOworICAgICAgICByZXR1cm4gdGw7CisgICAgfQorCisgICAgLyoqCisgICAgICogUHV0cyBhIFRleHRMaW5lIGJhY2sgaW50byB0aGUgc2hhcmVkIHBvb2wuIERvIG5vdCB1c2UgdGhpcyBUZXh0TGluZSBvbmNlCisgICAgICogaXQgaGFzIGJlZW4gcmV0dXJuZWQuCisgICAgICogQHBhcmFtIHRsIHRoZSB0ZXh0TGluZQorICAgICAqIEByZXR1cm4gbnVsbCwgYXMgYSBjb252ZW5pZW5jZSBmcm9tIGNsZWFyaW5nIHJlZmVyZW5jZXMgdG8gdGhlIHByb3ZpZGVkCisgICAgICogVGV4dExpbmUKKyAgICAgKi8KKyAgICBzdGF0aWMgVGV4dExpbmUgcmVjeWNsZShUZXh0TGluZSB0bCkgeworICAgICAgICB0bC5tVGV4dCA9IG51bGw7CisgICAgICAgIHRsLm1QYWludCA9IG51bGw7CisgICAgICAgIHRsLm1EaXJlY3Rpb25zID0gbnVsbDsKKyAgICAgICAgaWYgKHRsLm1MZW4gPCAyNTApIHsKKyAgICAgICAgICAgIHN5bmNocm9uaXplZChjYWNoZWQpIHsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNhY2hlZC5sZW5ndGg7ICsraSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoY2FjaGVkW2ldID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhY2hlZFtpXSA9IHRsOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgLyoqCisgICAgICogSW5pdGlhbGl6ZXMgYSBUZXh0TGluZSBhbmQgcHJlcGFyZXMgaXQgZm9yIHVzZS4KKyAgICAgKgorICAgICAqIEBwYXJhbSBwYWludCB0aGUgYmFzZSBwYWludCBmb3IgdGhlIGxpbmUKKyAgICAgKiBAcGFyYW0gdGV4dCB0aGUgdGV4dCwgY2FuIGJlIFN0eWxlZAorICAgICAqIEBwYXJhbSBzdGFydCB0aGUgc3RhcnQgb2YgdGh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ICAgICAgICAgICAgICAgLy8gemVyby13aWR0aCBjaGFyYWN0ZXJzLgorICAgICAgICAgICAgICAgIGNoYXJbXSBjaGFycyA9IG1DaGFyczsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gc3RhcnQsIGluZXh0OyBpIDwgbGltaXQ7IGkgPSBpbmV4dCkgeworICAgICAgICAgICAgICAgICAgICBpbmV4dCA9IG1TcGFubmVkLm5leHRTcGFuVHJhbnNpdGlvbihpLCBsaW1pdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXBsYWNlbWVudFNwYW4uY2xhc3MpOworICAgICAgICAgICAgICAgICAgICBpZiAobVNwYW5uZWQuZ2V0U3BhbnMoaSwgaW5leHQsIFJlcGxhY2VtZW50U3Bhbi5jbGFzcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAubGVuZ3RoID4gMCkgeyAvLyB0cmFuc2l0aW9uIGludG8gYSBzcGFuCisgICAgICAgICAgICAgICAgICAgICAgICBjaGFyc1tpIC0gc3RhcnRdID0gJ1x1ZmZmYyc7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBqID0gaSAtIHN0YXJ0ICsgMSwgZSA9IGluZXh0IC0gc3RhcnQ7IGogPCBlOyArK2opIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyc1tqXSA9ICdcdWZlZmYnOyAvLyB1c2VkIGFzIFpXTkJTLCBtYXJrcyBwb3NpdGlvbnMgdG8gc2tpcAorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIG1UYWJzID0gdGFiU3RvcHM7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmVuZGVycyB0aGUgVGV4dExpbmUuCisgICAgICoKKyAgICAgKiBAcGFyYW0gYyB0aGUgY2FudmFzIHRvIHJlbmRlciBvbgorICAgICAqIEBwYXJhbSB4IHRoZSBsZWFkaW5nIG1hcmdpbiBwb3NpdGlvbgorICAgICAqIEBwYXJhbSB0b3AgdGhlIHRvcCBvZiB0aGUgbGluZQorICAgICAqIEBwYXJhbSB5IHRoZSBiYXNlbGluZQorICAgICAqIEBwYXJhbSBib3R0b20gdGhlIGJvdHRvbSBvZiB0aGUgbGluZQorICAgICAqLworICAgIHZvaWQgZHJhdyhDYW52YXMgYywgZmxvYXQgeCwgaW50IHRvcCwgaW50IHksIGludCBib3R0b20pIHsKKyAgICAgICAgaWYgKCFtSGFzVGFicykgeworICAgICAgICAgICAgaWYgKG1EaXJlY3Rpb25zID09IExheW91dC5ESVJTX0FMTF9MRUZUX1RPX1JJR0hUKSB7CisgICAgICAgICAgICAgICAgZHJhd1J1bihjLCAwLCAwLCBtTGVuLCBmYWxzZSwgeCwgdG9wLCB5LCBib3R0b20sIGZhbHNlKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobURpcmVjdGlvbnMgPT0gTGF5b3V0LkRJUlNfQUxMX1JJR0hUX1RPX0xFRlQpIHsKKyAgICAgICAgICAgICAgICBkcmF3UnVuKGMsIDAsIDAsIG1MZW4sIHRydWUsIHgsIHRvcCwgeSwgYm90dG9tLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgZmxvYXQgaCA9IDA7CisgICAgICAgIGludFtdIHJ1bnMgPSBtRGlyZWN0aW9ucy5tRGlyZWN0aW9uczsKKyAgICAgICAgUmVjdEYgZW1vamlSZWN0ID0gbnVsbDsKKworICAgICAgICBpbnQgbGFzdFJ1bkluZGV4ID0gcnVucy5sZW5ndGggLSAyOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHJ1bnMubGVuZ3RoOyBpICs9IDIpIHsKKyAgICAgICAgICAgIGludCBydW5TdGFydCA9IHJ1bnNbaV07CisgICAgICAgICAgICBpbnQgcnVuTGltaXQgPSBydW5TdGFydCArIChydW5zW2krMV0gJiBMYXlvdXQuUlVOX0xFTkdUSF9NQVNLKTsKKyAgICAgICAgICAgIGlmIChydW5MaW1pdCA+IG1MZW4pIHsKKyAgICAgICAgICAgICAgICBydW5MaW1pdCA9IG1MZW47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBib29sZWFuIHJ1bklzUnRsID0gKHJ1bnNbaSsxXSAmIExheW91dC5SVU5fUlRMX0ZMQUcpICE9IDA7CisKKyAgICAgICAgICAgIGludCBzZWdzdGFydCA9IHJ1blN0YXJ0OworICAgICAgICAgICAgY2hhcltdIGNoYXJzID0gbUNoYXJzOworICAgICAgICAgICAgZm9yIChpbnQgaiA9IG1IYXNUYWJzID8gcnVuU3RhcnQgOiBydW5MaW1pdDsgaiA8PSBydW5MaW1pdDsgaisrKSB7CisgICAgICAgICAgICAgICAgaW50IGNvZGVwdCA9IDA7CisgICAgICAgICAgICAgICAgQml0bWFwIGJtID0gbnVsbDsKKworICAgICAgICAgICAgICAgIGlmIChtSGFzVGFicyAmJiBqIDwgcnVuTGltaXQpIHsKKyAgICAgICAgICAgICAgICAgICAgY29kZXB0ID0gbUNoYXJzW2pdOworICAgICAgICAgICAgICAgICAgICBpZiAoY29kZXB0ID49IDB4ZDgwMCAmJiBjb2RlcHQgPCAweGRjMDAgJiYgaiArIDEgPCBydW5MaW1pdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgY29kZXB0ID0gQ2hhcmFjdGVyLmNvZGVQb2ludEF0KG1DaGFycywgaik7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29kZXB0ID49IExheW91dC5NSU5fRU1PSkkgJiYgY29kZXB0IDw9IExheW91dC5NQVhfRU1PSkkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBibSA9IExheW91dC5FTU9KSV9GQUNUT1JZLmdldEJpdG1hcEZyb21BbmRyb2lkUHVhKGNvZGVwdCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNvZGVwdCA+IDB4ZmZmZikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICsrajsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChqID09IHJ1bkxpbWl0IHx8IGNvZGVwdCA9PSAnXHQnIHx8IGJtICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgaCArPSBkcmF3UnVuKGMsIGksIHNlZ3N0YXJ0LCBqLCBydW5Jc1J0bCwgeCtoLCB0b3AsIHksIGJvdHRvbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpICE9IGxhc3RSdW5JbmRleCB8fCBqICE9IG1MZW4pOworCisgICAgICAgICAgICAgICAgICAgIGlmIChjb2RlcHQgPT0gJ1x0JykgeworICAgICAgICAgICAgICAgICAgICAgICAgaCA9IG1EaXIgKiBuZXh0VGFiKGggKiBtRGlyKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChibSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCBibUFzY2VudCA9IGFzY2VudChqKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IGJpdG1hcEhlaWdodCA9IGJtLmdldEhlaWdodCgpOworICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgc2NhbGUgPSAtYm1Bc2NlbnQgLyBiaXRtYXBIZWlnaHQ7CisgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB3aWR0aCA9IGJtLmdldFdpZHRoKCkgKiBzY2FsZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVtb2ppUmVjdCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW1vamlSZWN0ID0gbmV3IFJlY3RGKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbW9qaVJlY3Quc2V0KHggKyBoLCB5ICsgYm1Bc2NlbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggKyBoICsgd2lkdGgsIHkpOworICAgICAgICAgICAgICAgICAgICAgICAgYy5kcmF3Qml0bWFwKGJtLCBudWxsLCBlbW9qaVJlY3QsIG1QYWludCk7CisgICAgICAgICAgICAgICAgICAgICAgICBoICs9IHdpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgaisrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHNlZ3N0YXJ0ID0gaiArIDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyBtZXRyaWNzIGluZm9ybWF0aW9uIGZvciB0aGUgZW50aXJlIGxpbmUuCisgICAgICoKKyAgICAgKiBAcGFyYW0gZm1pIHJlY2VpdmVzIGZvbnQgbWV0cmljcyBpbmZvcm1hdGlvbiwgY2FuIGJlIG51bGwKKyAgICAgKiBAcmV0dXJuIHRoZSBzaWduZWQgd2lkdGggb2YgdGhlIGxpbmUKKyAgICAgKi8KKyAgICBmbG9hdCBtZXRyaWNzKEZvbnRNZXRyaWNzSW50IGZtaSkgeworICAgICAgICByZXR1cm4gbWVhc3VyZShtTGVuLCBmYWxzZSwgZm1pKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIGluZm9ybWF0aW9uIGFib3V0IGEgcG9zaXRpb24gb24gdGhlIGxpbmUuCisgICAgICoKKyAgICAgKiBAcGFyYW0gb2Zmc2V0IHRoZSBsaW5lLXJlbGF0aXZlIGNoYXJhY3RlciBvZmZzZXQsIGJldHdlZW4gMCBhbmQgdGhlCisgICAgICogbGluZSBsZW5ndGgsIGluY2x1c2l2ZQorICAgICAqIEBwYXJhbSB0cmFpbGluZyB0cnVlIHRvIG1lY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Cwgb2Zmc2V0LCBtTGVuLCB0cnVlLCBmbWkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgY2hhcltdIGNoYXJzID0gbUNoYXJzOworICAgICAgICBpbnRbXSBydW5zID0gbURpcmVjdGlvbnMubURpcmVjdGlvbnM7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgcnVucy5sZW5ndGg7IGkgKz0gMikgeworICAgICAgICAgICAgaW50IHJ1blN0YXJ0ID0gcnVuc1tpXTsKKyAgICAgICAgICAgIGludCBydW5MaW1pdCA9IHJ1blN0YXJ0ICsgKHJ1bnNbaSsxXSAmIExheW91dC5SVU5fTEVOR1RIX01BU0spOworICAgICAgICAgICAgaWYgKHJ1bkxpbWl0ID4gbUxlbikgeworICAgICAgICAgICAgICAgIHJ1bkxpbWl0ID0gbUxlbjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJvb2xlYW4gcnVuSXNSdGwgPSAocnVuc1tpKzFdICYgTGF5b3V0LlJVTl9SVExfRkxBRykgIT0gMDsKKworICAgICAgICAgICAgaW50IHNlZ3N0YXJ0ID0gcnVuU3RhcnQ7CisgICAgICAgICAgICBmb3IgKGludCBqID0gbUhhc1RhYnMgPyBydW5TdGFydCA6IHJ1bkxpbWl0OyBqIDw9IHJ1bkxpbWl0OyBqKyspIHsKKyAgICAgICAgICAgICAgICBpbnQgY29kZXB0ID0gMDsKKyAgICAgICAgICAgICAgICBCaXRtYXAgYm0gPSBudWxsOworCisgICAgICAgICAgICAgICAgaWYgKG1IYXNUYWJzICYmIGogPCBydW5MaW1pdCkgeworICAgICAgICAgICAgICAgICAgICBjb2RlcHQgPSBjaGFyc1tqXTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvZGVwdCA+PSAweGQ4MDAgJiYgY29kZXB0IDwgMHhkYzAwICYmIGogKyAxIDwgcnVuTGltaXQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvZGVwdCA9IENoYXJhY3Rlci5jb2RlUG9pbnRBdChjaGFycywgaik7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29kZXB0ID49IExheW91dC5NSU5fRU1PSkkgJiYgY29kZXB0IDw9IExheW91dC5NQVhfRU1PSkkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBibSA9IExheW91dC5FTU9KSV9GQUNUT1JZLmdldEJpdG1hcEZyb21BbmRyb2lkUHVhKGNvZGVwdCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNvZGVwdCA+IDB4ZmZmZikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICsrajsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChqID09IHJ1bkxpbWl0IHx8IGNvZGVwdCA9PSAnXHQnIHx8IGJtICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBpblNlZ21lbnQgPSB0YXJnZXQgPj0gc2Vnc3RhcnQgJiYgdGFyZ2V0IDwgajsKKworICAgICAgICAgICAgICAgICAgICBib29sZWFuIGFkdmFuY2UgPSAobURpciA9PSBMYXlvdXQuRElSX1JJR0hUX1RPX0xFRlQpID09IHJ1bklzUnRsOworICAgICAgICAgICAgICAgICAgICBpZiAoaW5TZWdtZW50ICYmIGFkdmFuY2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBoICs9IG1lYXN1cmVSdW4oaSwgc2Vnc3RhcnQsIG9mZnNldCwgaiwgcnVuSXNSdGwsIGZtaSk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBmbG9hdCB3ID0gbWVhc3VyZVJ1bihpLCBzZWdzdGFydCwgaiwgaiwgcnVuSXNSdGwsIGZtaSk7CisgICAgICAgICAgICAgICAgICAgIGggKz0gYWR2YW5jZSA/IHcgOiAtdzsKKworICAgICAgICAgICAgICAgICAgICBpZiAoaW5TZWdtZW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaCArPSBtZWFzdXJlUnVuKGksIHNlZ3N0YXJ0LCBvZmZzZXQsIGosIHJ1bklzUnRsLCBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmIChjb2RlcHQgPT0gJ1x0JykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9mZnNldCA9PSBqKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGg7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBoID0gbURpciAqIG5leHRUYWIoaCAqIG1EaXIpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRhcmdldCA9PSBqKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGg7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoYm0gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgYm1Bc2NlbnQgPSBhc2NlbnQoaik7CisgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB3aWQgPSBibS5nZXRXaWR0aCgpICogLWJtQXNjZW50IC8gYm0uZ2V0SGVpZ2h0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICBoICs9IG1EaXIgKiB3aWQ7CisgICAgICAgICAgICAgICAgICAgICAgICBqKys7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBzZWdzdGFydCA9IGogKyAxOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBoOworICAgIH0KKworICAgIC8qKgorICAgICAqIERyYXdzIGEg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JldCA9IC0xOworICAgICAgICBib29sZWFuIHRyYWlsaW5nID0gZmFsc2U7CisKKyAgICAgICAgaWYgKGN1cnNvciA9PSBsaW5lU3RhcnQpIHsKKyAgICAgICAgICAgIHJ1bkluZGV4ID0gLTI7CisgICAgICAgIH0gZWxzZSBpZiAoY3Vyc29yID09IGxpbmVFbmQpIHsKKyAgICAgICAgICAgIHJ1bkluZGV4ID0gcnVucy5sZW5ndGg7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgLy8gRmlyc3QsIGdldCBpbmZvcm1hdGlvbiBhYm91dCB0aGUgcnVuIGNvbnRhaW5pbmcgdGhlIGNoYXJhY3RlciB3aXRoCisgICAgICAgICAgLy8gdGhlIGFjdGl2ZSBjYXJldC4KKyAgICAgICAgICBmb3IgKHJ1bkluZGV4ID0gMDsgcnVuSW5kZXggPCBydW5zLmxlbmd0aDsgcnVuSW5kZXggKz0gMikgeworICAgICAgICAgICAgcnVuU3RhcnQgPSBsaW5lU3RhcnQgKyBydW5zW3J1bkluZGV4XTsKKyAgICAgICAgICAgIGlmIChjdXJzb3IgPj0gcnVuU3RhcnQpIHsKKyAgICAgICAgICAgICAgcnVuTGltaXQgPSBydW5TdGFydCArIChydW5zW3J1bkluZGV4KzFdICYgTGF5b3V0LlJVTl9MRU5HVEhfTUFTSyk7CisgICAgICAgICAgICAgIGlmIChydW5MaW1pdCA+IGxpbmVFbmQpIHsKKyAgICAgICAgICAgICAgICAgIHJ1bkxpbWl0ID0gbGluZUVuZDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBpZiAoY3Vyc29yIDwgcnVuTGltaXQpIHsKKyAgICAgICAgICAgICAgICBydW5MZXZlbCA9IChydW5zW3J1bkluZGV4KzFdID4+PiBMYXlvdXQuUlVOX0xFVkVMX1NISUZUKSAmCisgICAgICAgICAgICAgICAgICAgIExheW91dC5SVU5fTEVWRUxfTUFTSzsKKyAgICAgICAgICAgICAgICBpZiAoY3Vyc29yID09IHJ1blN0YXJ0KSB7CisgICAgICAgICAgICAgICAgICAvLyBUaGUgY2FyZXQgaXMgb24gYSBydW4gYm91bmRhcnksIHNlZSBpZiB3ZSBzaG91bGQKKyAgICAgICAgICAgICAgICAgIC8vIHVzZSB0aGUgcG9zaXRpb24gb24gdGhlIHRyYWlsaW5nIGVkZ2Ugb2YgdGhlIHByZXZpb3VzCisgICAgICAgICAgICAgICAgICAvLyBsb2dpY2FsIGNoYXJhY3RlciBpbnN0ZWFkLgorICAgICAgICAgICAgICAgICAgaW50IHByZXZSdW5JbmRleCwgcHJldlJ1bkxldmVsLCBwcmV2UnVuU3RhcnQsIHByZXZSdW5MaW1pdDsKKyAgICAgICAgICAgICAgICAgIGludCBwb3MgPSBjdXJzb3IgLSAxOworICAgICAgICAgICAgICAgICAgZm9yIChwcmV2UnVuSW5kZXggPSAwOyBwcmV2UnVuSW5kZXggPCBydW5zLmxlbmd0aDsgcHJldlJ1bkluZGV4ICs9IDIpIHsKKyAgICAgICAgICAgICAgICAgICAgcHJldlJ1blN0YXJ0ID0gbGluZVN0YXJ0ICsgcnVuc1twcmV2UnVuSW5kZXhdOworICAgICAgICAgICAgICAgICAgICBpZiAocG9zID49IHByZXZSdW5TdGFydCkgeworICAgICAgICAgICAgICAgICAgICAgIHByZXZSdW5MaW1pdCA9IHByZXZSdW5TdGFydCArCisgICAgICAgICAgICAgICAgICAgICAgICAgIChydW5zW3ByZXZSdW5JbmRleCsxXSAmIExheW91dC5SVU5fTEVOR1RIX01BU0spOworICAgICAgICAgICAgICAgICAgICAgIGlmIChwcmV2UnVuTGltaXQgPiBsaW5lRW5kKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHByZXZSdW5MaW1pdCA9IGxpbmVFbmQ7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgIGlmIChwb3MgPCBwcmV2UnVuTGltaXQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHByZXZSdW5MZXZlbCA9IChydW5zW3ByZXZSdW5JbmRleCsxXSA+Pj4gTGF5b3V0LlJVTl9MRVZFTF9TSElGVCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmIExheW91dC5SVU5fTEVWRUxfTUFTSzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwcmV2UnVuTGV2ZWwgPCBydW5MZXZlbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBTdGFydCBmcm9tIGxvZ2ljYWxseSBwcmV2aW91cyBjaGFyYWN0ZXIuCisgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bkluZGV4ID0gcHJldlJ1bkluZGV4OworICAgICAgICAgICAgICAgICAgICAgICAgICBydW5MZXZlbCA9IHByZXZSdW5MZXZlbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcnVuU3RhcnQgPSBwcmV2UnVuU3RhcnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bkxpbWl0ID0gcHJldlJ1bkxpbWl0OworICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFpbGluZyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgIH0KKworICAgICAgICAgIC8vIGNhcmV0IG1pZ2h0IGJlID09IGxpbmVFbmQuICBUaGlzIGlzIGdlbmVyYWxseSBhIHNwYWNlIG9yIHBhcmFncmFwaAorICAgICAgICAgIC8vIHNlcGFyYXRvciBhbmQgaGFzIGFuIGFzc29jaWF0ZWQgcnVuLCBidXQgbWlnaHQgYmUgdGhlIGVuZCBvZgorICAgICAgICAgIC8vIHRleHQsIGluIHdoaWNoIGNhc2UgaXQgZG9lc24ndC4gI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5TdGFydCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3Q2FyZXQ7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBJZiBuZXdDYXJldCBpcyAtMSwgd2UncmUgc3RhcnRpbmcgYXQgYSBydW4gYm91bmRhcnkgYW5kIGNyb3NzaW5nCisgICAgICAgIC8vIGludG8gYW5vdGhlciBydW4uIE90aGVyd2lzZSB3ZSd2ZSBhcnJpdmVkIGF0IGEgcnVuIGJvdW5kYXJ5LCBhbmQKKyAgICAgICAgLy8gbmVlZCB0byBmaWd1cmUgb3V0IHdoaWNoIGNoYXJhY3RlciB0byBhdHRhY2ggdG8uICBOb3RlIHdlIG1pZ2h0CisgICAgICAgIC8vIG5lZWQgdG8gcnVuIHRoaXMgdHdpY2UsIGlmIHdlIGNyb3NzIGEgcnVuIGJvdW5kYXJ5IGFuZCBlbmQgdXAgYXQKKyAgICAgICAgLy8gYW5vdGhlciBydW4gYm91bmRhcnkuCisgICAgICAgIHdoaWxlICh0cnVlKSB7CisgICAgICAgICAgYm9vbGVhbiBhZHZhbmNlID0gdG9MZWZ0ID09IHBhcmFJc1J0bDsKKyAgICAgICAgICBpbnQgb3RoZXJSdW5JbmRleCA9IHJ1bkluZGV4ICsgKGFkdmFuY2UgPyAyIDogLTIpOworICAgICAgICAgIGlmIChvdGhlclJ1bkluZGV4ID49IDAgJiYgb3RoZXJSdW5JbmRleCA8IHJ1bnMubGVuZ3RoKSB7CisgICAgICAgICAgICBpbnQgb3RoZXJSdW5TdGFydCA9IGxpbmVTdGFydCArIHJ1bnNbb3RoZXJSdW5JbmRleF07CisgICAgICAgICAgICBpbnQgb3RoZXJSdW5MaW1pdCA9IG90aGVyUnVuU3RhcnQgKworICAgICAgICAgICAgKHJ1bnNbb3RoZXJSdW5JbmRleCsxXSAmIExheW91dC5SVU5fTEVOR1RIX01BU0spOworICAgICAgICAgICAgaWYgKG90aGVyUnVuTGltaXQgPiBsaW5lRW5kKSB7CisgICAgICAgICAgICAgICAgb3RoZXJSdW5MaW1pdCA9IGxpbmVFbmQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpbnQgb3RoZXJSdW5MZXZlbCA9IChydW5zW290aGVyUnVuSW5kZXgrMV0gPj4+IExheW91dC5SVU5fTEVWRUxfU0hJRlQpICYKKyAgICAgICAgICAgICAgICBMYXlvdXQuUlVOX0xFVkVMX01BU0s7CisgICAgICAgICAgICBib29sZWFuIG90aGVyUnVuSXNSdGwgPSAob3RoZXJSdW5MZXZlbCAmIDEpICE9IDA7CisKKyAgICAgICAgICAgIGFkdmFuY2UgPSB0b0xlZnQgPT0gb3RoZXJSdW5Jc1J0bDsKKyAgICAgICAgICAgIGlmIChuZXdDYXJldCA9PSAtMSkgeworICAgICAgICAgICAgICAgIG5ld0NhcmV0ID0gZ2V0T2Zmc2V0QmVmb3JlQWZ0ZXIob3RoZXJSdW5JbmRleCwgb3RoZXJSdW5TdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgIG90aGVyUnVuTGltaXQsIG90aGVyUnVuSXNSdGwsCisgICAgICAgICAgICAgICAgICAgICAgICBhZHZhbmNlID8gb3RoZXJSdW5TdGFydCA6IG90aGVyUnVuTGltaXQsIGFkdmFuY2UpOworICAgICAgICAgICAgICAgIGlmIChuZXdDYXJldCA9PSAoYWR2YW5jZSA/IG90aGVyUnVuTGltaXQgOiBvdGhlclJ1blN0YXJ0KSkgeworICAgICAgICAgICAgICAgICAgICAvLyBDcm9zc2VkIGFuZCBlbmRlZCB1cCBhdCBhIG5ldyBib3VuZGFyeSwKKyAgICAgICAgICAgICAgICAgICAgLy8gcmVwZWF0IGEgc2Vjb25kIGFuZCBmaW5hbCB0aW1lLgorICAgICAgICAgICAgICAgICAgICBydW5JbmRleCA9IG90aGVyUnVuSW5kZXg7CisgICAgICAgICAgICAgICAgICAgIHJ1bkxldmVsID0gb3RoZXJSdW5MZXZlbDsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBUaGUgbmV3IGNhcmV0IGlzIGF0IGEgYm91bmRhcnkuCisgICAgICAgICAgICBpZiAob3RoZXJSdW5MZXZlbCA8IHJ1bkxldmVsKSB7CisgICAgICAgICAgICAgIC8vIFRoZSBzdHJvbmcgY2hhcmFjdGVyIGlzIGluIHRoZSBvdGhlciBydW4uCisgICAgICAgICAgICAgIG5ld0NhcmV0ID0gYWR2YW5jZSA/IG90aGVyUnVuU3RhcnQgOiBvdGhlclJ1bkxpbWl0OworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgfQorCisgICAgICAgICAgaWYgKG5ld0NhcmV0ID09IC0xKSB7CisgICAgICAgICAgICAgIC8vIFdlJ3JlIHdhbGtpbmcgb2ZmIHRoZSBlbmQgb2YgdGhlIGxpbmUuICBUaGUgcGFyYWdyYXBoCisgICAgICAgICAgICAgIC8vIGxldmVsIGlzIGFsd2F5cyBlcXVhbCB0byBvciBsb3dlciB0aGFuIGFueSBpbnRlcm5hbCBsZXZlbCwgc28KKyAgICAgICAgICAgICAgLy8gdGhlIGJvdW5kYXJpZXMgZ2V0IHRoZSBzdHJvbmcgY2FyZXQuCisgICAgICAgICAgICAgIG5ld0NhcmV0ID0gYWR2YW5jZSA/IG1MZW4gKyAxIDogLTE7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIH0KKworICAgICAgICAgIC8vIEVsc2Ugd2UndmUgYXJyaXZlZCBhdCB0aGUgZW5kIG9mIHRoZSBsaW5lLiAgVGhhdCdzIGEgc3Ryb25nIHBvc2l0aW9uLgorICAgICAgICAgIC8vIFdlIG1pZ2h0IGhhdmUgYXJyaXZlZCBoZXJlIGJ5IGNyb3NzaW5nIG92ZXIgYSBydW4gd2l0aCBubyBpbnRlcm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YXJnZXQpIHsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNwYW5TdGFydCA9IHNwYW5MaW1pdDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgTWV0cmljQWZmZWN0aW5nU3BhbltdIHNwYW5zID0gbVNwYW5uZWQuZ2V0U3BhbnMobVN0YXJ0ICsgc3BhblN0YXJ0LAorICAgICAgICAgICAgICAgICAgICBtU3RhcnQgKyBzcGFuTGltaXQsIE1ldHJpY0FmZmVjdGluZ1NwYW4uY2xhc3MpOworCisgICAgICAgICAgICBpZiAoc3BhbnMubGVuZ3RoID4gMCkgeworICAgICAgICAgICAgICAgIFJlcGxhY2VtZW50U3BhbiByZXBsYWNlbWVudCA9IG51bGw7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCBzcGFucy5sZW5ndGg7IGorKykgeworICAgICAgICAgICAgICAgICAgICBNZXRyaWNBZmZlY3RpbmdTcGFuIHNwYW4gPSBzcGFuc1tqXTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNwYW4gaW5zdGFuY2VvZiBSZXBsYWNlbWVudFNwYW4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlcGxhY2VtZW50ID0gKFJlcGxhY2VtZW50U3BhbilzcGFuOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgc3Bhbi51cGRhdGVNZWFzdXJlU3RhdGUod3ApOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKHJlcGxhY2VtZW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gSWYgd2UgaGF2ZSBhIHJlcGxhY2VtZW50IHNwYW4sIHdlJ3JlIG1vdmluZyBlaXRoZXIgdG8KKyAgICAgICAgICAgICAgICAgICAgLy8gdGhlIHN0YXJ0IG9yIGVuZCBvZiB0aGlzIHNwYW4uCisgICAgICAgICAgICAgICAgICAgIHJldHVybiBhZnRlciA/IHNwYW5MaW1pdCA6IHNwYW5TdGFydDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpbnQgZmxhZ3MgPSBydW5Jc1J0bCA/IFBhaW50LkRJUkVDVElPTl9SVEwgOiBQYWludC5ESVJFQ1RJT05fTFRSOworICAgICAgICBpbnQgY3Vyc29yT3B0ID0gYWZ0ZXIgPyBQYWludC5DVVJTT1JfQUZURVIgOiBQYWludC5DVVJTT1JfQkVGT1JFOworICAgICAgICBpZiAobUNoYXJzVmFsaWQpIHsKKyAgICAgICAgICAgIHJldHVybiB3cC5nZXRUZXh0UnVuQ3Vyc29yKG1DaGFycywgc3BhblN0YXJ0LCBzcGFuTGltaXQgLSBzcGFuU3RhcnQsCisgICAgICAgICAgICAgICAgICAgIGZsYWdzLCBvZmZzZXQsIGN1cnNvck9wdCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gd3AuZ2V0VGV4dFJ1bkN1cnNvcihtVGV4dCwgbVN0YXJ0ICsgc3BhblN0YXJ0LAorICAgICAgICAgICAgICAgICAgICBtU3RhcnQgKyBzcGFuTGltaXQsIGZsYWdzLCBtU3RhcnQgKyBvZmZzZXQsIGN1cnNvck9wdCkgLSBtU3RhcnQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBVdGlsaXR5IGZ1bmN0aW9uIGZvciBtZWFzdXJpbmcgYW5kIHJlbmRlcmluZyB0ZXh0LiAgVGhlIHRleHQgbXVzdAorICAgICAqIG5vdCBpbmNsdWRlIGEgdGFiIG9yIGVtb2ppLgorICAgICAqCisgICAgICogQHBhcmFtIHdwIHRoZSB3b3JraW5nIHBhaW50CisgICAgICogQHBhcmFtIHN0YXJ0IHRoZSBzdGFydCBvZiB0aGUgdGV4dAorICAgICAqIEBwYXJhbSBlbmQ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A9IDA7CisKKyAgICAgICAgaW50IHJ1bkxlbiA9IGVuZCAtIHN0YXJ0OworICAgICAgICBpbnQgY29udGV4dExlbiA9IGNvbnRleHRFbmQgLSBjb250ZXh0U3RhcnQ7CisgICAgICAgIGlmIChuZWVkV2lkdGggfHwgKGMgIT0gbnVsbCAmJiAod3AuYmdDb2xvciAhPSAwIHx8IHJ1bklzUnRsKSkpIHsKKyAgICAgICAgICAgIGludCBmbGFncyA9IHJ1bklzUnRsID8gUGFpbnQuRElSRUNUSU9OX1JUTCA6IFBhaW50LkRJUkVDVElPTl9MVFI7CisgICAgICAgICAgICBpZiAobUNoYXJzVmFsaWQpIHsKKyAgICAgICAgICAgICAgICByZXQgPSB3cC5nZXRUZXh0UnVuQWR2YW5jZXMobUNoYXJzLCBzdGFydCwgcnVuTGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dFN0YXJ0LCBjb250ZXh0TGVuLCBmbGFncywgbnVsbCwgMCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGludCBkZWx0YSA9IG1TdGFydDsKKyAgICAgICAgICAgICAgICByZXQgPSB3cC5nZXRUZXh0UnVuQWR2YW5jZXMobVRleHQsIGRlbHRhICsgc3RhcnQsCisgICAgICAgICAgICAgICAgICAgICAgICBkZWx0YSArIGVuZCwgZGVsdGEgKyBjb250ZXh0U3RhcnQsIGRlbHRhICsgY29udGV4dEVuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdzLCBudWxsLCAwKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmIChmbWkgIT0gbnVsbCkgeworICAgICAgICAgICAgd3AuZ2V0Rm9udE1ldHJpY3NJbnQoZm1pKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChjICE9IG51bGwpIHsKKyAgICAgICAgICAgIGlmIChydW5Jc1J0bCkgeworICAgICAgICAgICAgICAgIHggLT0gcmV0OworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAod3AuYmdDb2xvciAhPSAwKSB7CisgICAgICAgICAgICAgICAgaW50IGNvbG9yID0gd3AuZ2V0Q29sb3IoKTsKKyAgICAgICAgICAgICAgICBQYWludC5TdHlsZSBzID0gd3AuZ2V0U3R5bGUoKTsKKyAgICAgICAgICAgICAgICB3cC5zZXRDb2xvcih3cC5iZ0NvbG9yKTsKKyAgICAgICAgICAgICAgICB3cC5zZXRTdHlsZShQYWludC5TdHlsZS5GSUxMKTsKKworICAgICAgICAgICAgICAgIGMuZHJhd1JlY3QoeCwgdG9wLCB4ICsgcmV0LCBib3R0b20sIHdwKTsKKworICAgICAgICAgICAgICAgIHdwLnNldFN0eWxlKHMpOworICAgICAgICAgICAgICAgIHdwLnNldENvbG9yKGNvbG9yKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZHJhd1RleHRSdW4oYywgd3AsIHN0YXJ0LCBlbmQsIGNvbnRleHRTdGFydCwgY29udGV4dEVuZCwgcnVuSXNSdGwsCisgICAgICAgICAgICAgICAgICAgIHgsIHkgKyB3cC5iYXNlbGluZVNoaWZ0KTsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBydW5Jc1J0bCA/IC1yZXQgOiByZXQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogVXRpbGl0eSBmdW5jdGlvbiBmb3IgbWVhc3VyaW5nIGFuZCByZW5kZXJpbmcgYSByZXBsYWNlbWVudC4KKyAgICAgKgorICAgICAqIEBwYXJhbSByZXBsYWNlbWVudCB0aGUgcmVwbGFjZW1lbnQKKyAgICAgKiBAcGFyYW0gd3AgdGhlIHdvcmsgcGFpbnQKKyAgICAgKiBAcGFyYW0gcnVuSW5kZXggdGhlIHJ1biBpbmRleAorICAgICAqIEBwYXJhbSBzdGFydCB0aGUgc3RhcnQgb2YgdGhlIHJ1bgorICAgICAqIEBwYXJhbSBsaW1pdCB0aGUgbGltaXQgb2YgdGhlIHJ1bgorICAgICAqIEBwYXJhbSBydW5Jc1J0bC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AgaW50IHRleHRTdGFydCA9IG1TdGFydCArIHN0YXJ0OworICAgICAgICBpbnQgdGV4dExpbWl0ID0gbVN0YXJ0ICsgbGltaXQ7CisKKyAgICAgICAgaWYgKG5lZWRXaWR0aCB8fCAoYyAhPSBudWxsICYmIHJ1bklzUnRsKSkgeworICAgICAgICAgICAgcmV0ID0gcmVwbGFjZW1lbnQuZ2V0U2l6ZSh3cCwgbVRleHQsIHRleHRTdGFydCwgdGV4dExpbWl0LCBmbWkpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGMgIT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKHJ1bklzUnRsKSB7CisgICAgICAgICAgICAgICAgeCAtPSByZXQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXBsYWNlbWVudC5kcmF3KGMsIG1UZXh0LCB0ZXh0U3RhcnQsIHRleHRMaW1pdCwKKyAgICAgICAgICAgICAgICAgICAgeCwgdG9wLCB5LCBib3R0b20sIHdwKTsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBydW5Jc1J0bCA/IC1yZXQgOiByZXQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogVXRpbGl0eSBmdW5jdGlvbiBmb3IgaGFuZGxpbmcgYSB1bmlkaXJlY3Rpb25hbCBydW4uICBUaGUgcnVuIG11c3Qgbm90CisgICAgICogY29udGFpbiB0YWJzIG9yIGVtb2ppIGJ1dCBjYW4gY29udGFpbiBzdHlsZXMuCisgICAgICoKKyAgICAgKiBAcGFyYW0gcnVuSW5kZXggdGhlIHJ1biBpbmRleAorICAgICAqIEBwYXJhbSBzdGFydCB0aGUgbGluZS1yZWxhdGl2ZSBzdGFydCBvZiB0aGUgcnVuCisgICAgICogQHBhcmFtIG1lYXN1cmVMaW1pdCB0aGUgb2Zmc2V0IHRvIG1lYXN1cmUgdG8sIGJldHdlZW4gc3RhcnQgYW5kIGxpbWl0IGluY2x1c2l2ZQorICAgICAqIEBwYXJhbSBsaW1pdCB0aGUgbGltaXQgb2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XRTcGFucyhtU3RhcnQgKyBpLAorICAgICAgICAgICAgICAgICAgICAgICAgbVN0YXJ0ICsgbWxpbWl0LCBNZXRyaWNBZmZlY3RpbmdTcGFuLmNsYXNzKTsKKworICAgICAgICAgICAgICAgIGlmIChzcGFucy5sZW5ndGggPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIFJlcGxhY2VtZW50U3BhbiByZXBsYWNlbWVudCA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGogPSAwOyBqIDwgc3BhbnMubGVuZ3RoOyBqKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIE1ldHJpY0FmZmVjdGluZ1NwYW4gc3BhbiA9IHNwYW5zW2pdOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNwYW4gaW5zdGFuY2VvZiBSZXBsYWNlbWVudFNwYW4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXBsYWNlbWVudCA9IChSZXBsYWNlbWVudFNwYW4pc3BhbjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2UgbWlnaHQgaGF2ZSBhIHJlcGxhY2VtZW50IHRoYXQgdXNlcyB0aGUgZHJhdworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN0YXRlLCBvdGhlcndpc2UgbWVhc3VyZSBzdGF0ZSB3b3VsZCBzdWZmaWNlLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNwYW4udXBkYXRlRHJhd1N0YXRlKHdwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmIChyZXBsYWNlbWVudCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB4ICs9IGhhbmRsZVJlcGxhY2VtZW50KHJlcGxhY2VtZW50LCB3cCwgcnVuSW5kZXgsIGksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1saW1pdCwgcnVuSXNSdGwsIGMsIHgsIHRvcCwgeSwgYm90dG9tLCBmbWksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5lZWRXaWR0aCB8fCBtbGltaXQgPCBtZWFzdXJlTGltaXQpOworICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChtU3Bhbm5lZCA9PSBudWxsIHx8IGMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHggKz0gaGFuZGxlVGV4dCh3cCwgaSwgbWxpbWl0LCBpLCBpbmV4dCwgcnVuSXNSdGwsIGMsIHgsIHRvcCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHksIGJvdHRvbSwgZm1pLCBuZWVkV2lkdGggfHwgbWxpbWl0IDwgbWVhc3VyZUxpbWl0KTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaiA9IGksIGpuZXh0OyBqIDwgbWxpbWl0OyBqID0gam5leHQpIHsKKyAgICAgICAgICAgICAgICAgICAgam5leHQgPSBtU3Bhbm5lZC5uZXh0U3BhblRyYW5zaXRpb24obVN0YXJ0ICsgaiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU3RhcnQgKyBtbGltaXQsIENoYXJhY3RlclN0eWxlLmNsYXNzKSAtIG1TdGFydDsKKworICAgICAgICAgICAgICAgICAgICBDaGFyYWN0ZXJTdHlsZVtdIHNwYW5zID0gbVNwYW5uZWQuZ2V0U3BhbnMobVN0YXJ0ICsgaiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU3RhcnQgKyBqbmV4dCwgQ2hhcmFjdGVyU3R5bGUuY2xhc3MpOworCisgICAgICAgICAgICAgICAgICAgIHdwLnNldChtUGFpbnQpOworICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBrID0gMDsgayA8IHNwYW5zLmxlbmd0aDsgaysrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBDaGFyYWN0ZXJTdHlsZSBzcGFuID0gc3BhbnNba107CisgICAgICAgICAgICAgICAgICAgICAgICBzcGFuLnVwZGF0ZURyYXdTdGF0ZSh3cCk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICB4ICs9IGhhbmRsZVRleHQod3AsIGosIGpuZXh0LCBpLCBpbmV4dCwgcnVuSXNSdGwsIGMsIHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9wLCB5LCBib3R0b20sIGZtaSwgbmVlZFdpZHRoIHx8IGpuZXh0IDwgbWVhc3VyZUxpbWl0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4geCAtIG94OworICAgIH0KKworICAgIC8qKgorICAgICAqIFJlbmRlciBhIHRleHQgcnVuIHdpdGggdGhlIHNldC11cCBwYWludC4KKyAgICAgKgorICAgICAqIEBwYXJhbSBjIHRoZSBjYW52YXMKKyAgICAgKiBAcGFyYW0gd3AgdGhlIHBhaW50IHVzZWQgdG8gcmVuZGVyIHRoZSB0ZXh0CisgICAgICogQHBhcmFtIHN0YXJ0IHRoZSBzdGFydCBvZiB0aGUgcnVuCisgICAgICogQHBhcmFtIGVuZCB0aGUgZW5kIG9mIHRoZSBydW4KKyAgICAgKiBAcGFyYW0gY29udGV4dFN0YXJ0IHRoZSBzdGFydCBvZiBjb250ZXh0IGZvciB0aGUgcnVuCisgICAgICogQHBhcmFtIGNvbnRleHRFbmQgdGhlIGVuZCBvZiB0aGUgY29udGV4dCBmb3IgdGhlIHJ1bgorICAgICAqIEBwYXJhbSBydW5Jc1J0bCB0cnVlIGlmIHRoZSBydW4gaXMgcmlnaHQtdG8tbGVmdAorICAgICAqIEBwYXJhbSB4IHRoZSB4IHBvc2l0aW9uIG9mIHRoZSBsZWZ0IGVkZ2Ugb2YgdGhlIHJ1bgorICAgICAqIEBwYXJhbSB5IHRoZSBiYXNlbGluZSBvZiB0aGUgcnVuCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIGRyYXdUZXh0UnVuKENhbnZhcyBjLCBUZXh0UGFpbnQgd3AsIGludCBzdGFydCwgaW50IGVuZCwKKyAgICAgICAgICAgIGludCBjb250ZXh0U3RhcnQsIGludCBjb250ZXh0RW5kLCBib29sZWFuIHJ1bklzUnRsLCBmbG9hdCB4LCBpbnQgeSkgeworCisgICAgICAgIGludCBmbGFncyA9IHJ1bklzUnRsID8gQ2FudmFzLkRJUkVDVElPTl9SVEwgOiBDYW52YXMuRElSRUNUSU9OX0xUUjsKKyAgICAgICAgaWYgKG1DaGFyc1ZhbGlkKSB7CisgICAgICAgICAgICBpbnQgY291bnQgPSBlbmQgLSBzdGFydDsKKyAgICAgICAgICAgIGludCBjb250ZXh0Q291bnQgPSBjb250ZXh0RW5kIC0gY29udGV4dFN0YXJ0OworICAgICAgICAgICAgYy5kcmF3VGV4dFJ1bihtQ2hhcnMsIHN0YXJ0LCBjb3VudCwgY29udGV4dFN0YXJ0LCBjb250ZXh0Q291bnQsCisgICAgICAgICAgICAgICAgICAgIHgsIHksIGZsYWdzLCB3cCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpbnQgZGVsdGEgPSBtU3RhcnQ7CisgICAgICAgICAgICBjLmRyYXdUZXh0UnVuKG1UZXh0LCBkZWx0YSArIHN0YXJ0LCBkZWx0YSArIGVuZCwKKyAgICAgICAgICAgICAgICAgICAgZGVsdGEgKyBjb250ZXh0U3RhcnQsIGRlbHRhICsgY29udGV4dEVuZCwgeCwgeSwgZmxhZ3MsIHdwKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgdGhlIGFzY2VudCBvZiB0aGUgdGV4dCBhdCBzdGFydC4gIFRoaXMgaXMgdXNlZCBmb3Igc2NhbGluZworICAgICAqIGVtb2ppLgorICAgICAqCisgICAgICogQHBhcmFtIHBvcyB0aGUgbGluZS1yZWxhdGl2ZSBwb3NpdGlvbgorICAgICAqIEByZXR1cm4gdGhlIGFzY2VudCBvZiB0aGUgdGV4dCBhdCBzdGFydAorICAgICAqLworICAgIGZsb2F0IGFzY2VudChpbnQgcG9zKSB7CisgICAgICAgIGlmIChtU3Bhbm5lZCA9PSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm4gbVBhaW50LmFzY2VudCgpOworICAgICAgICB9CisKKyAgICAgICAgcG9zICs9IG1TdGFydDsKKyAgICAgICAgTWV0cmljQWZmZWN0aW5nU3BhbltdIHNwYW5zID0gbVNwYW5uZWQuZ2V0U3BhbnMocG9zLCBwb3MgKyAxLAorICAgICAgICAgICAgICAgIE1ldHJpY0FmZmVjdGluZ1NwYW4uY2xhc3MpOworICAgICAgICBpZiAoc3BhbnMubGVuZ3RoID09IDApIHsKKyAgICAgICAgICAgIHJldHVybiBtUGFpbnQuYXNjZW50KCk7CisgICAgICAgIH0KKworICAgICAgICBUZXh0UGFpbnQgd3AgPSBtV29ya1BhaW50OworICAgICAgICB3cC5zZXQobVBhaW50KTsKKyAgICAgICAgZm9yIChNZXRyaWNBZmZlY3RpbmdTcGFuIHNwYW4gOiBzcGFucykgeworICAgICAgICAgICAgc3Bhbi51cGRhdGVNZWFzdXJlU3RhdGUod3ApOworICAgICAgICB9CisgICAgICAgIHJldHVybiB3cC5hc2NlbnQoKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRoZSBuZXh0IHRhYiBwb3NpdGlvbi4KKyAgICAgKgorICAgICAqIEBwYXJhbSBoIHRoZSAodW5zaWduZWQpIG9mZnNldCBmcm9tIHRoZSBsZWFkaW5nIG1hcmdpbgorICAgICAqIEByZXR1cm4gdGhlICh1bnNpZ25lZCkgdGFiIHBvc2l0aW9uIGFmdGVyIHRoaXMgb2Zmc2V0CisgICAgICovCisgICAgZmxvYXQgbmV4dFRhYihm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RvIHByZXNlcnZlIHRoZSBvcmlnaW5hbApAQCAtOTkyLDcgKzk4OSw3IEBACiAgICAgICogcmVwb3J0IHRoZSBzdGFydCBhbmQgZW5kIG9mIHRoZSBlbGxpcHNpemVkIHJhbmdlLgogICAgICAqLwogICAgIHB1YmxpYyBzdGF0aWMgQ2hhclNlcXVlbmNlIGVsbGlwc2l6ZShDaGFyU2VxdWVuY2UgdGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGV4dFBhaW50IHAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRleHRQYWludCBwYWludCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgYXZhaWwsIFRydW5jYXRlQXQgd2hlcmUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gcHJlc2VydmVMZW5ndGgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVsbGlwc2l6ZUNhbGxiYWNrIGNhbGxiYWNrKSB7CkBAIC0xMDAzLDEzICsxMDAwLDEyIEBACiAKICAgICAgICAgaW50IGxlbiA9IHRleHQubGVuZ3RoKCk7CiAKLSAgICAgICAgLy8gVXNlIFBhaW50LmJyZWFrVGV4dCgpIGZvciB0aGUgbm9uLVNwYW5uZWQgY2FzZSB0byBhdm9pZCBoYXZpbmcKLSAgICAgICAgLy8gdG8gYWxsb2NhdGUgbWVtb3J5IGFuZCBhY2N1bXVsYXRlIHRoZSBjaGFyYWN0ZXIgd2lkdGhzIG91cnNlbHZlcy4KKyAgICAgICAgTWVhc3VyZWRUZXh0IG10ID0gTWVhc3VyZWRUZXh0Lm9idGFpbigpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgZmxvYXQgd2lkdGggPSBzZXRQYXJhKG10LCBwYWludCwgdGV4dCwgMCwgdGV4dC5sZW5ndGgoKSwKKyAgICAgICAgICAgICAgICAgICAgTGF5b3V0LkRJUl9SRVFVRVNUX0RFRkFVTFRfTFRSKTsKIAotICAgICAgICBpZiAoISh0ZXh0IGluc3RhbmNlb2YgU3Bhbm5lZCkpIHsKLSAgICAgICAgICAgIGZsb2F0IHdpZCA9IHAubWVhc3VyZVRleHQodGV4dCwgMCwgbGVuKTsKLQotICAgICAgICAgICAgaWYgKHdpZCA8PSBhdmFpbCkgeworICAgICAgICAgICAgaWYgKHdpZHRoIDw9IGF2YWlsKSB7CiAgICAgICAgICAgICAgICAgaWYgKGNhbGxiYWNrICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2suZWxsaXBzaXplZCgwLCAwKTsKICAgICAgICAgICAgICAgICB9CkBAIC0xMDE3LDI1MCArMTAxMyw2OSBAQAogICAgICAgICAgICAgICAgIHJldHVybiB0ZXh0OwogICAgICAgICAgICAgfQogCi0gICAgICAgICAgICBmbG9hdCBlbGxpcHNpc3dpZCA9IHAubWVhc3VyZVRleHQoc0VsbGlwc2lzKTsKKyAgICAgICAgICAgIC8vIFhYWCBhc3N1bWVzIGVsbGlwc2lzIHN0cmluZyBkb2VzIG5vdCByZXF1aXJlIHNoYXBpbmcgYW5kCisgICAgICAgICAgICAvLyBpcyB1bmFmZmVjdGVkIGJ5IHN0eWxlCisgICAgICAgICAgICBmbG9hdCBlbGxpcHNpc3dpZCA9IHBhaW50Lm1lYXN1cmVUZXh0KHNFbGxpcHNpcyk7CisgICAgICAgICAgICBhdmFpbCAtPSBlbGxpcHNpc3dpZDsKIAotICAgICAgICAgICAgaWYgKGVsbGlwc2lzd2lkID4gYXZhaWwpIHsKLSAgICAgICAgICAgICAgICBpZiAoY2FsbGJhY2sgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBjYWxsYmFjay5lbGxpcHNpemVkKDAsIGxlbik7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKHByZXNlcnZlTGVuZ3RoKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNoYXJbXSBidWYgPSBvYnRhaW4obGVuKTsKLSAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW47IGkrKykgewotICAgICAgICAgICAgICAgICAgICAgICAgYnVmW2ldID0gJ1x1RkVGRic7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHJldCA9IG5ldyBTdHJpbmcoYnVmLCAwLCBsZW4pOwotICAgICAgICAgICAgICAgICAgICByZWN5Y2xlKGJ1Zik7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXQ7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuICIiOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKHdoZXJlID09IFRydW5jYXRlQXQuU1RBUlQpIHsKLSAgICAgICAgICAgICAgICBpbnQgZml0ID0gcC5icmVha1RleHQodGV4dCwgMCwgbGVuLCBmYWxzZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXZhaWwgLSBlbGxpcHNpc3dpZCwgbnVsbCk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoY2FsbGJhY2sgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBjYWxsYmFjay5lbGxpcHNpemVkKDAsIGxlbiAtIGZpdCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKHByZXNlcnZlTGVuZ3RoKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBibGFuayh0ZXh0LCAwLCBsZW4gLSBmaXQpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBzRWxsaXBzaXMgKyB0ZXh0LnRvU3RyaW5nKCkuc3Vic3RyaW5nKGxlbiAtIGZpdCwgbGVuKTsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpbnQgbGVmdCA9IDA7CisgICAgICAgICAgICBpbnQgcmlnaHQgPSBsZW47CisgICAgICAgICAgICBpZiAoYXZhaWwgPCAwKSB7CisgICAgICAgICAgICAgICAgLy8gaXQgYWxsIGdvZXMKKyAgICAgICAgICAgIH0gZWxzZSBpZiAod2hlcmUgPT0gVHJ1bmNhdGVBdC5TVEFSVCkgeworICAgICAgICAgICAgICAgIHJpZ2h0ID0gbGVuIC0gbXQuYnJlYWtUZXh0KDAsIGxlbiwgZmFsc2UsIGF2YWlsKTsKICAgICAgICAgICAgIH0gZWxzZSBpZiAod2hlcmUgPT0gVHJ1bmNhdGVBdC5FTkQpIHsKLSAgICAgICAgICAgICAgICBpbnQgZml0ID0gcC5icmVha1RleHQodGV4dCwgMCwgbGVuLCB0cnVlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdmFpbCAtIGVsbGlwc2lzd2lkLCBudWxsKTsKLQotICAgICAgICAgICAgICAgIGlmIChjYWxsYmFjayAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrLmVsbGlwc2l6ZWQoZml0LCBsZW4pOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChwcmVzZXJ2ZUxlbmd0aCkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gYmxhbmsodGV4dCwgZml0LCBsZW4pOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiB0ZXh0LnRvU3RyaW5nKCkuc3Vic3RyaW5nKDAsIGZpdCkgKyBzRWxsaXBzaXM7Ci0gICAgICAgICAgICAgICAgfSAKLSAgICAgICAgICAgIH0gZWxzZSAvKiB3aGVyZSA9PSBUcnVuY2F0ZUF0Lk1JRERMRSAqLyB7Ci0gICAgICAgICAgICAgICAgaW50IHJpZ2h0ID0gcC5icmVha1RleHQodGV4dCwgMCwgbGVuLCBmYWxzZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYXZhaWwgLSBlbGxpcHNpc3dpZCkgLyAyLCBudWxsKTsKLSAgICAgICAgICAgICAgICBmbG9hdCB1c2VkID0gcC5tZWFzdXJlVGV4dCh0ZXh0LCBsZW4gLSByaWdodCwgbGVuKTsKLSAgICAgICAgICAgICAgICBpbnQgbGVmdCA9IHAuYnJlYWtUZXh0KHRleHQsIDAsIGxlbiAtIHJpZ2h0LCB0cnVlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXZhaWwgLSBlbGxpcHNpc3dpZCAtIHVzZWQsIG51bGwpOwotCi0gICAgICAgICAgICAgICAgaWYgKGNhbGxiYWNrICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2suZWxsaXBzaXplZChsZWZ0LCBsZW4gLSByaWdodCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKHByZXNlcnZlTGVuZ3RoKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBibGFuayh0ZXh0LCBsZWZ0LCBsZW4gLSByaWdodCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHMgPSB0ZXh0LnRvU3RyaW5nKCk7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBzLnN1YnN0cmluZygwLCBsZWZ0KSArIHNFbGxpcHNpcyArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBzLnN1YnN0cmluZyhsZW4gLSByaWdodCwgbGVuKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBCdXQgZG8gdGhlIFNwYW5uZWQgY2FzZXMgYnkgaGFuZCwgYmVjYXVzZSBpdCdzIHN1Y2ggYSBwYWluCi0gICAgICAgIC8vIHRvIGl0ZX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ICAgICAgIH0KLQotICAgICAgICBpZiAoc3VtIDw9IGF2YWlsKSB7Ci0gICAgICAgICAgICBpZiAoY2FsbGJhY2sgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGNhbGxiYWNrLmVsbGlwc2l6ZWQoMCwgMCk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHJldHVybiB0ZXh0OwotICAgICAgICB9Ci0KLSAgICAgICAgZmxvYXQgZWxsaXBzaXN3aWQgPSBwLm1lYXN1cmVUZXh0KHNFbGxpcHNpcyk7Ci0KLSAgICAgICAgaWYgKGVsbGlwc2lzd2lkID4gYXZhaWwpIHsKLSAgICAgICAgICAgIGlmIChjYWxsYmFjayAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgY2FsbGJhY2suZWxsaXBzaXplZCgwLCBsZW4pOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAocHJlc2VydmVMZW5ndGgpIHsKLSAgICAgICAgICAgICAgICBjaGFyW10gYnVmID0gb2J0YWluKGxlbik7Ci0gICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW47IGkrKykgewotICAgICAgICAgICAgICAgICAgICBidWZbaV0gPSAnXHVGRUZGJzsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgU3Bhbm5hYmxlU3RyaW5nIHNzID0gbmV3IFNwYW5uYWJsZVN0cmluZyhuZXcgU3RyaW5nKGJ1ZiwgMCwgbGVuKSk7Ci0gICAgICAgICAgICAgICAgcmVjeWNsZShidWYpOwotICAgICAgICAgICAgICAgIGNvcHlTcGFuc0Zyb20oc3AsIDAsIGxlbiwgT2JqZWN0LmNsYXNzLCBzcywgMCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHNzOworICAgICAgICAgICAgICAgIGxlZnQgPSBtdC5icmVha1RleHQoMCwgbGVuLCB0cnVlLCBhdmFpbCk7CiAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHJldHVybiAiIjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmICh3aGVyZSA9PSBUcnVuY2F0ZUF0LlNUQVJUKSB7Ci0gICAgICAgICAgICBzdW0gPSAwOwotICAgICAgICAgICAgaW50IGk7Ci0KLSAgICAgICAgICAgIGZvciAoaSA9IGxlbjsgaSA+PSAwOyBpLS0pIHsKLSAgICAgICAgICAgICAgICBmbG9hdCB3ID0gd2lkW2xlbiArIGkgLSAxXTsKLQotICAgICAgICAgICAgICAgIGlmICh3ICsgc3VtICsgZWxsaXBzaXN3aWQgPiBhdmFpbCkgewotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBzdW0gKz0gdzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGNhbGxiYWNrICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBjYWxsYmFjay5lbGxpcHNpemVkKDAsIGkpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAocHJlc2VydmVMZW5ndGgpIHsKLSAgICAgICAgICAgICAgICBTcGFubmFibGVTdHJpbmcgc3MgPSBuZXcgU3Bhbm5hYmxlU3RyaW5nKGJsYW5rKHRleHQsIDAsIGkpKTsKLSAgICAgICAgICAgICAgICBjb3B5U3BhbnNGcm9tKHNwLCAwLCBsZW4sIE9iamVjdC5jbGFzcywgc3MsIDApOwotICAgICAgICAgICAgICAgIHJldHVybiBzczsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgU3Bhbm5hYmxlU3RyaW5nQnVpbGRlciBvdXQgPSBuZXcgU3Bhbm5hYmxlU3RyaW5nQnVpbGRlcihzRWxsaXBzaXMpOwotICAgICAgICAgICAgICAgIG91dC5pbnNlcnQoMSwgdGV4dCwgaSwgbGVuKTsKLQotICAgICAgICAgICAgICAgIHJldHVybiBvdXQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSBpZiAod2hlcmUgPT0gVHJ1bmNhdGVBdC5FTkQpIHsKLSAgICAgICAgICAgIHN1bSA9IDA7Ci0gICAgICAgICAgICBpbnQgaTsKLQotICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGxlbjsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgZmxvYXQgdyA9IHdpZFtsZW4gKyBpXTsKLQotICAgICAgICAgICAgICAgIGlmICh3ICsgc3VtICsgZWxsaXBzaXN3aWQgPiBhdmFpbCkgewotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBzdW0gKz0gdzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGNhbGxiYWNrICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBjYWxsYmFjay5lbGxpcHNpemVkKGksIGxlbik7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChwcmVzZXJ2ZUxlbmd0aCkgewotICAgICAgICAgICAgICAgIFNwYW5uYWJsZVN0cmluZyBzcyA9IG5ldyBTcGFubmFibGVTdHJpbmcoYmxhbmsodGV4dCwgaSwgbGVuKSk7Ci0gICAgICAgICAgICAgICAgY29weVNwYW5zRnJvbShzcCwgMCwgbGVuLCBPYmplY3QuY2xhc3MsIHNzLCAwKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gc3M7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIFNwYW5uYWJsZVN0cmluZ0J1aWxkZXIgb3V0ID0gbmV3IFNwYW5uYWJsZVN0cmluZ0J1aWxkZXIoc0VsbGlwc2lzKTsKLSAgICAgICAgICAgICAgICBvdXQuaW5zZXJ0KDAsIHRleHQsIDAsIGkpOwotCi0gICAgICAgICAgICAgICAgcmV0dXJuIG91dDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIC8qIHdoZXJlID0gVHJ1bmNhdGVBdC5NSURETEUgKi8gewotICAgICAgICAgICAgZmxvYXQgbHN1bSA9IDAsIHJzdW0gPSAwOwotICAgICAgICAgICAgaW50IGxlZnQgPSAwLCByaWdodCA9IGxlbjsKLQotICAgICAgICAgICAgZmxvYXQgcmF2YWlsID0gKGF2YWlsIC0gZWxsaXBzaXN3aWQpIC8gMjsKLSAgICAgICAgICAgIGZvciAocmlnaHQgPSBsZW47IHJpZ2h0ID49IDA7IHJpZ2h0LS0pIHsKLSAgICAgICAgICAgICAgICBmbG9hdCB3ID0gd2lkW2xlbiArIHJpZ2h0IC0gMV07Ci0KLSAgICAgICAgICAgICAgICBpZiAodyArIHJzdW0gPiByYXZhaWwpIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgcnN1bSArPSB3OwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBmbG9hdCBsYXZhaWwgPSBhdmFpbCAtIGVsbGlwc2lzd2lkIC0gcnN1bTsKLSAgICAgICAgICAgIGZvciAobGVmdCA9IDA7IGxlZnQgPCByaWdodDsgbGVmdCsrKSB7Ci0gICAgICAgICAgICAgICAgZmxvYXQgdyA9IHdpZFtsZW4gKyBsZWZ0XTsKLQotICAgICAgICAgICAgICAgIGlmICh3ICsgbHN1bSA+IGxhdmFpbCkgewotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBsc3VtICs9IHc7CisgICAgICAgICAgICAgICAgcmlnaHQgPSBsZW4gLSBtdC5icmVha1RleHQoMCwgbGVuLCBmYWxzZSwgYXZhaWwgLyAyKTsKKyAgICAgICAgICAgICAgICBhdmFpbCAtPSBtdC5tZWFzdXJlKHJpZ2h0LCBsZW4pOworICAgICAgICAgICAgICAgIGxlZnQgPSBtdC5icmVha1RleHQoMCwgcmlnaHQsIHRydWUsIGF2YWlsKTsKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgaWYgKGNhbGxiYWNrICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBjYWxsYmFjay5lbGxpcHNpemVkKGxlZnQsIHJpZ2h0KTsKICAgICAgICAgICAgIH0KIAorICAgICAgICAgICAgY2hhcltdIGJ1ZiA9IG10Lm1DaGFyczsKKyAgICAgICAgICAgIFNwYW5uZWQgc3AgPSB0ZXh0IGluc3RhbmNlb2YgU3Bhbm5lZCA/IChTcGFubmVkKSB0ZXh0IDogbnVsbDsKKworICAgICAgICAgICAgaW50IHJlbWFpbmluZyA9IGxlbiAtIChyaWdodCAtIGxlZnQpOwogICAgICAgICAgICAgaWYgKHByZXNlcnZlTGVuZ3RoKSB7Ci0gICAgICAgICAgICAgICAgU3Bhbm5hYmxlU3RyaW5nIHNzID0gbmV3IFNwYW5uYWJsZVN0cmluZyhibGFuayh0ZXh0LCBsZWZ0LCByaWdodCkpOworICAgICAgICAgICAgICAgIGlmIChyZW1haW5pbmcgPiAwKSB7IC8vIGVsc2UgZWxpbWluYXRlIHRoZSBlbGxpcHNpcyB0b28KKyAgICAgICAgICAgICAgICAgICAgYnVmW2xlZnQrK10gPSAnXHUyMDI2JzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IGxlZnQ7IGkgPCByaWdodDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIGJ1ZltpXSA9ICdcdUZFRkYnOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBTdHJpbmcgcyA9IG5ldyBTdHJpbmcoYnVmLCAwLCBsZW4pOworICAgICAgICAgICAgICAgIGlmIChzcCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBzOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBTcGFubmFibGVTdHJpbmcgc3MgPSBuZXcgU3Bhbm5hYmxlU3RyaW5nKHMpOwogICAgICAgICAgICAgICAgIGNvcHlTcGFuc0Zyb20oc3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tYWluaW5nID09IDApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gIiI7CiAgICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAKLSAgICAgICAgU3RyaW5nIHJldCA9IG5ldyBTdHJpbmcoYnVmLCAwLCBsZW4pOwotICAgICAgICByZWN5Y2xlKGJ1Zik7CiAKLSAgICAgICAgcmV0dXJuIHJldDsKKyAgICAgICAgICAgIGlmIChzcCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgU3RyaW5nQnVpbGRlciBzYiA9IG5ldyBTdHJpbmdCdWlsZGVyKHJlbWFpbmluZyArIHNFbGxpcHNpcy5sZW5ndGgoKSk7CisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKGJ1ZiwgMCwgbGVmdCk7CisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKHNFbGxpcHNpcyk7CisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKGJ1ZiwgcmlnaHQsIGxlbiAtIHJpZ2h0KTsKKyAgICAgICAgICAgICAgICByZXR1cm4gc2IudG9TdHJpbmcoKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgU3Bhbm5hYmxlU3RyaW5nQnVpbGRlciBzc2IgPSBuZXcgU3Bhbm5hYmxlU3RyaW5nQnVpbGRlcigpOworICAgICAgICAgICAgc3NiLmFwcGVuZCh0ZXh0LCAwLCBsZWZ0KTsKKyAgICAgICAgICAgIHNzYi5hcHBlbmQoc0VsbGlwc2lzKTsKKyAgICAgICAgICAgIHNzYi5hcHBlbmQodGV4dCwgcmlnaHQsIGxlbik7CisgICAgICAgICAgICByZXR1cm4gc3NiOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgTWVhc3VyZWRUZXh0LnJlY3ljbGUobXQpOworICAgICAgICB9CiAgICAgfQogCiAgICAgLyoqCkBAIC0xMjc4LDgwICsxMDkzLDEyMSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRleHRQYWludCBwLCBmbG9hdCBhdmFpbCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgb25lTW9yZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgbW9yZSkgewotICAgICAgICBpbnQgbGVuID0gdGV4dC5sZW5ndGgoKTsKLSAgICAgICAgY2hhcltdIGJ1ZiA9IG5ldyBjaGFyW2xlbl07Ci0gICAgICAgIFRleHRVdGlscy5nZXRDaGFycyh0ZXh0LCAwLCBsZW4sIGJ1ZiwgMCk7CiAKLSAgICAgICAgaW50IGNvbW1hQ291bnQgPSAwOwotICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbjsgaSsrKSB7Ci0gICAgICAgICAgICBpZiAoYnVmW2ldID09ICcsJykgewotICAgICAgICAgICAgICAgIGNvbW1hQ291bnQrKzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGZsb2F0W10gd2lkOwotCi0gICAgICAgIGlmICh0ZXh0IGluc3RhbmNlb2YgU3Bhbm5lZCkgewotICAgICAgICAgICAgU3Bhbm5lZCBzcCA9IChTcGFubmVkKSB0ZXh0OwotICAgICAgICAgICAgVGV4dFBhaW50IHRlbXBwYWludCA9IG5ldyBUZXh0UGFpbnQoKTsKLSAgICAgICAgICAgIHdpZCA9IG5ldyBmbG9hdFtsZW4gKiAyXTsKLQotICAgICAgICAgICAgaW50IG5leHQ7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbjsgaSA9IG5leHQpIHsKLSAgICAgICAgICAgICAgICBuZXh0ID0gc3AubmV4dFNwYW5UcmFuc2l0aW9uKGksIGxlbiwgTWV0cmljQWZmZWN0aW5nU3Bhbi5jbGFzcyk7Ci0KLSAgICAgICAgICAgICAgICBTdHlsZWQuZ2V0VGV4dFdpZHRocyhwLCB0ZW1wcGFpbnQsIHNwLCBpLCBuZXh0LCB3aWQsIG51bGwpOwotICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkod2lkLCAwLCB3aWQsIGxlbiArIGksIG5leHQgLSBpKTsKKyAgICAgICAgTWVhc3VyZWRUZXh0IG10ID0gTWVhc3VyZWRUZXh0Lm9idGFpbigpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgaW50IGxlbiA9IHRleHQubGVuZ3RoKCk7CisgICAgICAgICAgICBmbG9hdCB3aWR0aCA9IHNldFBhcmEobXQsIHAsIHRleHQsIDAsIGxlbiwgTGF5b3V0LkRJUl9SRVFVRVNUX0RFRkFVTFRfTFRSKTsKKyAgICAgICAgICAgIGlmICh3aWR0aCA8PSBhdmFpbCkgeworICAgICAgICAgICAgICAgIHJldHVybiB0ZXh0OwogICAgICAgICAgICAgfQogCi0gICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KHdpZCwgbGVuLCB3aWQsIDAsIGxlbik7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICB3aWQgPSBuZXcgZmxvYXRbbGVuXTsKLSAgICAgICAgICAgIHAuZ2V0VGV4dFdpZHRocyh0ZXh0LCAwLCBsZW4sIHdpZCk7Ci0gICAgICAgIH0KKyAgICAgICAgICAgIGNoYXJbXSBidWYgPSBtdC5tQ2hhcnM7CiAKLSAgICAgICAgaW50IG9rID0gMDsKLSAgICAgICAgaW50IG9rUmVtYWluaW5nID0gY29tbWFDb3VudCArIDE7Ci0gICAgICAgIFN0cmluZyBva0Zvcm1hdCA9ICIiOwotCi0gICAgICAgIGludCB3ID0gMDsKLSAgICAgICAgaW50IGNvdW50ID0gMDsKLQotICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbjsgaSsrKSB7Ci0gICAgICAgICAgICB3ICs9IHdpZFtpXTsKLQotICAgICAgICAgICAgaWYgKGJ1ZltpXSA9PSAnLCcpIHsKLSAgICAgICAgICAgICAgICBjb3VudCsrOwotCi0gICAgICAgICAgICAgICAgaW50IHJlbWFpbmluZyA9IGNvbW1hQ291bnQgLSBjb3VudCArIDE7Ci0gICAgICAgICAgICAgICAgZmxvYXQgbW9yZVdpZDsKLSAgICAgICAgICAgICAgICBTdHJpbmcgZm9ybWF0OwotCi0gICAgICAgICAgICAgICAgaWYgKHJlbWFpbmluZyA9PSAxKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZvcm1hdCA9ICIgIiArIG9uZU1vcmU7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgZm9ybWF0ID0gIiAiICsgU3RyaW5nLmZvcm1hdChtb3JlLCByZW1haW5pbmcpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIG1vcmVXaWQgPSBwLm1lYXN1cmVUZXh0KGZvcm1hdCk7Ci0KLSAgICAgICAgICAgICAgICBpZiAodyArIG1vcmVXaWQgPD0gYXZhaWwpIHsKLSAgICAgICAgICAgICAgICAgICAgb2sgPSBpICsgMTsKLSAgICAgICAgICAgICAgICAgICAgb2tSZW1haW5pbmcgPSByZW1haW5pbmc7Ci0gICAgICAgICAgICAgICAgICAgIG9rRm9ybWF0ID0gZm9ybWF0OworICAgICAgICAgICAgaW50IGNvbW1hQ291bnQgPSAwOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW47IGkrKykgeworICAgICAgICAgICAgICAgIGlmIChidWZbaV0gPT0gJywnKSB7CisgICAgICAgICAgICAgICAgICAgIGNvbW1hQ291bnQrKzsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgIH0KIAotICAgICAgICBpZiAodyA8PSBhdmFpbCkgewotICAgICAgICAgICAgcmV0dXJuIHRleHQ7Ci0gICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpbnQgcmVtYWluaW5nID0gY29tbWFDb3VudCArIDE7CisKKyAgICAgICAgICAgIGludCBvayA9IDA7CisgICAgICAgICAgICBpbnQgb2tSZW1haW5pbmcgPSByZW1haW5pbmc7CisgICAgICAgICAgICBTdHJpbmcgb2tGb3JtYXQgPSAiIjsKKworICAgICAgICAgICAgaW50IHcgPSAwOworICAgICAgICAgICAgaW50IGNvdW50ID0gMDsKKyAgICAgICAgICAgIGZsb2F0W10gd2lkdGhzID0gbXQubVdpZHRoczsKKworICAgICAgICAgICAgaW50IHJlcXVlc3QgPSBtdC5tRGlyID09IDEgPyBMYXlvdXQuRElSX1JFUVVFU1RfTFRSIDoKKyAgICAgICAgICAgICAgICBMYXlvdXQuRElSX1JFUVVFU1RfUlRMOworCisgICAgICAgICAgICBNZWFzdXJlZFRleHQgdGVtcE10ID0gTWVhc3VyZWRUZXh0Lm9idGFpbigpOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW47IGkrKykgeworICAgICAgICAgICAgICAgIHcgKz0gd2lkdGhzW2ldOworCisgICAgICAgICAgICAgICAgaWYgKGJ1ZltpXSA9PSAnLCcpIHsKKyAgICAgICAgICAgICAgICAgICAgY291bnQrKzsKKworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgZm9ybWF0OworICAgICAgICAgICAgICAgICAgICAvLyBYWFggc2hvdWxkIG5vdCBpbnNlcnQgc3BhY2VzLCBzaG91bGQgYmUgcGFydCBvZiBzdHJpbmcKKyAgICAgICAgICAgICAgICAgICAgLy8gWFhYIHNob3VsZCB1c2UgcGx1cmFsIHJ1bGVzIGFuZCBub3QgYXNzdW1lIEVuZ2xpc2ggcGx1cmFscworICAgICAgICAgICAgICAgICAgICBpZiAoLS1yZW1haW5pbmcgPT0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZm9ybWF0ID0gIiAiICsgb25lTW9yZTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvcm1hdCA9ICIgIiArIFN0cmluZy5mb3JtYXQobW9yZSwgcmVtYWluaW5nKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIC8vIFhYWCB0aGlzIGlzIHByb2JhYmx5IG9rLCBidXQgbmVlZCB0byBsb29rIGF0IGl0IG1vcmUKKyAgICAgICAgICAgICAgICAgICAgdGVtcE10LnNldFBhcmEoZm9ybWF0LCAwLCBmb3JtYXQubGVuZ3RoKCksIHJlcXVlc3QpOworICAgICAgICAgICAgICAgICAgICBmbG9hdCBtb3JlV2lkID0gbXQuYWRkU3R5bGVSdW4ocCwgbXQubUxlbiwgbnVsbCk7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKHcgKyBtb3JlV2lkIDw9IGF2YWlsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBvayA9IGkgKyAxOworICAgICAgICAgICAgICAgICAgICAgICAgb2tSZW1haW5pbmcgPSByZW1haW5pbmc7CisgICAgICAgICAgICAgICAgICAgICAgICBva0Zvcm1hdCA9IGZvcm1hdDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIE1lYXN1cmVkVGV4dC5yZWN5Y2xlKHRlbXBNdCk7CisKICAgICAgICAgICAgIFNwYW5uYWJsZVN0cmluZ0J1aWxkZXIgb3V0ID0gbmV3IFNwYW5uYWJsZVN0cmluZ0J1aWxkZXIob2tGb3JtYXQpOwogICAgICAgICAgICAgb3V0Lmluc2VydCgwLCB0ZXh0LCAwLCBvayk7CiAgICAgICAgICAgICByZXR1cm4gb3V0OworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgTWVhc3VyZWRUZXh0LnJlY3ljbGUobXQpOwogICAgICAgICB9CiAgICAgfQogCisgICAgcHJpdmF0ZSBzdGF0aWMgZmxvYXQgc2V0UGFyYShNZWFzdXJlZFRleHQgbXQsIFRleHRQYWludCBwYWludCwKKyAgICAgICAgICAgIENoYXJTZXF1ZW5jZSB0ZXh0LCBpbnQgc3RhcnQsIGludCBlbmQsIGludCBiaWRpUmVxdWVzdCkgeworCisgICAgICAgIG10LnNldFBhcmEodGV4dCwgc3RhcnQsIGVuZCwgYmlkaVJlcXVlc3QpOworCisgICAgICAgIGZsb2F0IHdpZHRoOworICAgICAgICBTcGFubmVkIHNwID0gdGV4dCBpbnN0YW5jZW9mIFNwYW5uZWQgPyAoU3Bhbm5lZCkgdGV4dCA6IG51bGw7CisgICAgICAgIGludCBsZW4gPSBlbmQgLSBzdGFydDsKKyAgICAgICAgaWYgKHNwID09IG51bGwpIHsKKyAgICAgICAgICAgIHdpZHRoID0gbXQuYWRkU3R5bGVSdW4ocGFpbnQsIGxlbiwgbnVsbCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICB3aWR0aCA9IDA7CisgICAgICAgICAgICBpbnQgc3BhbkVuZDsKKyAgICAgICAgICAgIGZvciAoaW50IHNwYW5TdGFydCA9IDA7IHNwYW5TdGFydCA8IGxlbjsgc3BhblN0YXJ0ID0gc3BhbkVuZCkgeworICAgICAgICAgICAgICAgIHNwYW5FbmQgPSBzcC5uZXh0U3BhblRyYW5zaXRpb24oc3BhblN0YXJ0LCBsZW4sCisgICAgICAgICAgICAgICAgICAgICAgICBNZXRyaWNBZmZlY3RpbmdTcGFuLmNsYXNzKTsKKyAgICAgICAgICAgICAgICBNZXRyaWNBZmZlY3RpbmdTcGFuW10gc3BhbnMgPSBzcC5nZXRTcGFucygKKyAgICAgICAgICAgICAgICAgICAgICAgIHNwYW5TdGFydCwgc3BhbkVuZCwgTWV0cmljQWZmZWN0aW5nU3Bhbi5jbGFzcyk7CisgICAgICAgICAgICAgICAgd2lkdGggKz0gbXQuYWRkU3R5bGVSdW4ocGFpbnQsIHNwYW5zLCBzcGFuRW5kIC0gc3BhblN0YXJ0LCBudWxsKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiB3aWR0aDsKKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBjaGFyIEZJUlNUX1JJR0hUX1RPX0xFRlQgPSAnXHUwNTkwJzsKKworICAgIC8qIHBhY2thZ2UgKi8KKyAgICBzdGF0aWMgYm9vbGVhbiBkb2VzTm90TmVlZEJpZGkoQ2hhclNlcXVlbmNlIHMsIGludCBzdGFydCwgaW50IGVuZCkgeworICAgICAgICBmb3IgKGludCBpID0gc3RhcnQ7IGkgPCBlbmQ7IGkrKykgeworICAgICAgICAgICAgaWYgKHMuY2hhckF0KGkpID49IEZJUlNUX1JJR0hUX1RPX0xFRlQpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisgICAgLyogcGFja2FnZSAqLworICAgIHN0YXRpYyBib29sZWFuIGRvZXNOb3ROZWVkQmlkaShjaGFyW10gdGV4dCwgaW50IHN0YXJ0LCBpbnQgbGVuKSB7CisgICAgICAgIGZvciAoaW50IGkgPSBzdGFydCwgZSA9IGkgKyBsZW47IGkgPCBlOyBpKyspIHsKKyAgICAgICAgICAgIGlmICh0ZXh0W2ldID49IEZJUlNUX1JJR0hUX1RPX0xFRlQpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCiAgICAgLyogcGFja2FnZSAqLyBzdGF0aWMgY2hhcltdIG9idGFpbihpbnQgbGVuKSB7CiAgICAgICAgIGNoYXJbXSBidWY7CiAKQEAgLTE1MjksNyArMTM4NSw3IEBACiAgICAgICovCiAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgQ0FQX01PREVfQ0hBUkFDVEVSUwogICAgICAgICAgICAgPSBJbnB1dFR5cGUuVFlQRV9URVhUX0ZMQUdfQ0FQX0NIQVJBQ1RFUlM7Ci0gICAgCisKICAgICAvKioKICAgICAgKiBDYXBpdGFsaXphdGlvbiBtb2RlIGZvciB7QGxpbmsgI2dldENhcHNNb2RlfTogY2FwaXRhbGl6ZSB0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7CitpbXBvcnQgYW5kcm9pZC52aWV3LktleUV2ZW50OwogaW1wb3J0IGFuZHJvaWQudmlldy5Nb3Rpb25FdmVudDsKIGltcG9ydCBhbmRyb2lkLnZpZXcuVmlld0NvbmZpZ3VyYXRpb247CiBpbXBvcnQgYW5kcm9pZC53aWRnZXQuVGV4dFZpZXc7Ci1pbXBvcnQgYW5kcm9pZC52aWV3LktleUV2ZW50OwogCiBwdWJsaWMgY2xhc3MgVG91Y2ggewogICAgIHByaXZhdGUgVG91Y2goKSB7IH0KQEAgLTQ1LDYgKzQ0LDcgQEAKICAgICAgICAgaW50IGxlZnQgPSBJbnRlZ2VyLk1BWF9WQUxVRTsKICAgICAgICAgaW50IHJpZ2h0ID0gMDsKICAgICAgICAgQWxpZ25tZW50IGEgPSBudWxsOworICAgICAgICBib29sZWFuIGx0ciA9IHRydWU7CiAKICAgICAgICAgZm9yIChpbnQgaSA9IHRvcDsgaSA8PSBib3R0b207IGkrKykgewogICAgICAgICAgICAgbGVmdCA9IChpbnQpIE1hdGgubWluKGxlZnQsIGxheW91dC5nZXRMaW5lTGVmdChpKSk7CkBAIC01Miw2ICs1Miw3IEBACiAKICAgICAgICAgICAgIGlmIChhID09IG51bGwpIHsKICAgICAgICAgICAgICAgICBhID0gbGF5b3V0LmdldFBhcmFncmFwaEFsaWdubWVudChpKTsKKyAgICAgICAgICAgICAgICBsdHIgPSBsYXlvdXQuZ2V0UGFyYWdyYXBoRGlyZWN0aW9uKGkpID4gMDsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCkBAIC01OSwxMCArNjAsMTIgQEAKICAgICAgICAgaW50IHdpZHRoID0gd2lkZ2V0LmdldFdpZHRoKCk7CiAgICAgICAgIGludCBkaWZmID0gMDsKIAorICAgICAgICAvLyBhbGlnbl9vcHBvc2l0ZSBkb2VzIE5PVCBtZWFuIGFsaWduX3JpZ2h0LCB3ZSBuZWVkIHRoZSBwYXJhZ3JhcGgKKyAgICAgICAgLy8gZGlyZWN0aW9uI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SFRfRElQID0gNTA7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IENPTlRFTlRfUEFERElOR19ESVAgPSAzOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBDT05URU5UX1NQQUNJTkdfRElQID0gNjsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgQ09OVEVOVF9BQ1RJT05fU1BBQ0lOR19ESVAgPSAxMjsKKyAgICAKKyAgICAvKioKKyAgICAgKiBEaXNwbGF5IG9wdGlvbnMgYXBwbGllZCBieSBkZWZhdWx0CisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRElTUExBWV9ERUZBVUxUID0gMDsKKworICAgIC8qKgorICAgICAqIERpc3BsYXkgb3B0aW9ucyB0aGF0IHJlcXVpcmUgcmUtbGF5b3V0IGFzIG9wcG9zZWQgdG8gYSBzaW1wbGUgaW52YWxpZGF0ZQorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBESVNQTEFZX1JFTEFZT1VUX01BU0sgPQorICAgICAgICAgICAgQWN0aW9uQmFyLkRJU1BMQVlfSElERV9IT01FIHwKKyAgICAgICAgICAgIEFjdGlvbkJhci5ESVNQTEFZX1VTRV9MT0dPOworICAgIAorICAgIHByaXZhdGUgZmluYWwgaW50IG1Db250ZW50SGVpZ2h0OworCisgICAgcHJpdmF0ZSBpbnQgbU5hdmlnYXRpb25Nb2RlOworICAgIHByaXZhdGUgaW50IG1EaXNwbGF5T3B0aW9uczsKKyAgICBwcml2YXRlIGludCBtU3BhY2luZzsKKyAgICBwcml2YXRlIGludCBtQWN0aW9uU3BhY2luZzsKKyAgICBwcml2YXRlIENoYXJTZXF1ZW5jZSBtVGl0bGU7CisgICAgcHJpdmF0ZSBDaGFyU2VxdWVuY2UgbVN1YnRpdGxlOworICAgIHByaXZhdGUgRHJhd2FibGUgbUljb247CisgICAgcHJpdmF0ZSBEcmF3YWJsZSBtTG9nbzsKKworICAgI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ICAgICAgcHVibGljIHZvaWQgb25Ob3RoaW5nU2VsZWN0ZWQoQWRhcHRlclZpZXcgcGFyZW50KSB7CisgICAgICAgICAgICAvLyBEbyBub3RoaW5nCisgICAgICAgIH0KKyAgICB9OworCisgICAgcHJpdmF0ZSBPbkNsaWNrTGlzdGVuZXIgbUhvbWVDbGlja0xpc3RlbmVyID0gbnVsbDsKKworICAgIHB1YmxpYyBBY3Rpb25CYXJWaWV3KENvbnRleHQgY29udGV4dCwgQXR0cmlidXRlU2V0IGF0dHJzKSB7CisgICAgICAgIHN1cGVyKGNvbnRleHQsIGF0dHJzKTsKKworICAgICAgICBmaW5hbCBEaXNwbGF5TWV0cmljcyBtZXRyaWNzID0gY29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXREaXNwbGF5TWV0cmljcygpOworICAgICAgICBtQ29udGVudEhlaWdodCA9IChpbnQpIChDT05URU5UX0hFSUdIVF9ESVAgKiBtZXRyaWNzLmRlbnNpdHkgKyAwLjVmKTsKKworICAgICAgICBUeXBlZEFycmF5IGEgPSBjb250ZXh0Lm9idGFpblN0eWxlZEF0dHJpYnV0ZXMoYXR0cnMsIFIuc3R5bGVhYmxlLkFjdGlvbkJhcik7CisKKyAgICAgICAgZmluYWwgaW50IGNvbG9yRmlsdGVyID0gYS5nZXRDb2xvcihSLnN0eWxlYWJsZS5BY3Rpb25CYXJfY29sb3JGaWx0ZXIsIDApOworCisgICAgICAgIGlmIChjb2xvckZpbHRlciAhPSAwKSB7CisgICAgICAgICAgICBmaW5hbCBEcmF3YWJsZSBkID0gZ2V0QmFja2dyb3VuZCgpOworICAgICAgICAgICAgZC5zZXREaXRoZXIodHJ1ZSk7CisgICAgICAgICAgICBkLnNldENvbG9yRmlsdGVyKG5ldyBQb3J0ZXJEdWZmQ29sb3JGaWx0ZXIoY29sb3JGaWx0ZXIsIFBvcnRlckR1ZmYuTW9kZS5PVkVSTEFZKSk7CisgICAgICAgIH0KKworICAgICAgICBBcHBsaWNhdGlvbkluZm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IG51bGwpIHsKKyAgICAgICAgICAgIG1Mb2dvTmF2SXRlbSA9IG5ldyBBY3Rpb25NZW51SXRlbShjb250ZXh0LCAwLCBhbmRyb2lkLlIuaWQuaG9tZSwgMCwgMCwgbVRpdGxlKTsKKyAgICAgICAgICAgIG1Ib21lQ2xpY2tMaXN0ZW5lciA9IG5ldyBPbkNsaWNrTGlzdGVuZXIoKSB7CisgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25DbGljayhWaWV3IHYpIHsKKyAgICAgICAgICAgICAgICAgICAgQ29udGV4dCBjb250ZXh0ID0gZ2V0Q29udGV4dCgpOworICAgICAgICAgICAgICAgICAgICBpZiAoY29udGV4dCBpbnN0YW5jZW9mIEFjdGl2aXR5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBBY3Rpdml0eSBhY3Rpdml0eSA9IChBY3Rpdml0eSkgY29udGV4dDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2aXR5Lm9uT3B0aW9uc0l0ZW1TZWxlY3RlZChtTG9nb05hdkl0ZW0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgbUNvbnRleHRNZW51cyA9IG5ldyBTcGFyc2VBcnJheTxBY3Rpb25NZW51PigpOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgdm9pZCBzZXRDYWxsYmFjayhDYWxsYmFjayBjYWxsYmFjaykgeworICAgICAgICBtQ2FsbGJhY2sgPSBjYWxsYmFjazsKKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgc2V0TWVudShNZW51IG1lbnUpIHsKKyAgICAgICAgTWVudUJ1aWxkZXIgYnVpbGRlciA9IChNZW51QnVpbGRlcikgbWVudTsKKyAgICAgICAgbU9wdGlvbnNNZW51ID0gYnVpbGRlcjsKKyAgICAgICAgaWYgKG1NZW51VmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICByZW1vdmVWaWV3KG1NZW51Vmlldyk7CisgICAgICAgIH0KKyAgICAgICAgZmluYWwgQWN0aW9uTWVudVZpZXcgbWVudVZpZXcgPSAoQWN0aW9uTWVudVZpZXcpIGJ1aWxkZXIuZ2V0TWVudVZpZXcoCisgICAgICAgICAgICAgICAgTWVudUJ1aWxkZXIuVFlQRV9BQ1RJT05fQlVUVE9OLCBudWxsKTsKKyAgICAgICAgbUFjdGlvblNwYWNpbmcgPSBtZW51Vmlldy5nZXRJdGVtTWFyZ2luKCk7CisgICAgICAgIGZpbmFsIExheW91dFBhcmFtcyBsYXlvdXRQYXJhbXMgPSBuZXcgTGF5b3V0UGFyYW1zKExheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQsCisgICAgICAgICAgICAgICAgTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCk7CisgICAgICAgIG1lbnVWaWV3LnNldExheW91dFBhcmFtcyhsYXlvdXRQYXJhbXMpOworICAgICAgICBhZGRWaWV3KG1lbnVWaWV3KTsKKyAgICAgICAgbU1lbnVWaWV3ID0gbWVudVZpZXc7CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIHNldEN1c3RvbU5hdmlnYXRpb25WaWV3KFZpZXcgdmlldykgeworICAgICAgICBtQ3VzdG9tTmF2VmlldyA9IHZpZXc7CisgICAgICAgIGlmICh2aWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgIHNldE5hdmlnYXRpb25Nb2RlKEFjdGlvbkJhci5OQVZJR0FUSU9OX01PREVfQ1VTVE9NKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBwdWJsaWMgQ2hhclNlcXVlbmNlIGdldFRpdGxlKCkgeworICAgICAgICByZXR1cm4gbVRpdGxlOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgdm9pZCBzZXRUaXRsZShDaGFyU2VxdWVuY2UgdGl0bGUpIHsKKyAgICAgICAgbVRpdGxlID0gdGl0bGU7CisgICAgICAgIGlmIChtVGl0bGVWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1UaXRsZVZpZXcuc2V0VGV4dCh0aXRsZSk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1Mb2dvTmF2SXRlbSAhPSBudWxsKSB7CisgICAgICAgICAgICBtTG9nb05hdkl0ZW0uc2V0VGl0bGUodGl0bGUpOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIHB1YmxpYyBDaGFyU2VxdWVuY2UgZ2V0U3VidGl0bGUoKSB7CisgICAgICAgIHJldHVybiBtU3VidGl0bGU7CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIHNldFN1YnRpdGxlKENoYXJTZXF1ZW5jZSBzdWJ0aXRsZSkgeworICAgICAgICBtU3VidGl0bGUgPSBzdWJ0aXRsZTsKKyAgICAgICAgaWYgKG1TdWJ0aXRsZVZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgbVN1YnRpdGxlVmlldy5zZXRUZXh0KHN1YnRpdGxlKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBwdWJsaWMgdm9pZCBzZXREaXNwbGF5T3B0aW9ucyhpbnQgb3B0aW9ucykgeworICAgICAgICBmaW5hbCBpbnQgZmxhZ3NDaGFuZ2VkID0gb3B0aW9ucyBeIG1EaXNwbGF5T3B0aW9uczsKKyAgICAgICAgbURpc3BsYXlPcHRpb25zID0gb3B0aW9uczsKKyAgICAgICAgaWYgKChmbGFnc0NoYW5nZWQgJiBESVNQTEFZX1JFTEFZT1VUX01BU0spICE9IDApIHsKKyAgICAgICAgICAgIGZpbmFsIGludCB2aXMgPSAob3B0aW9ucyAmIEFjdGlvbkJhci5ESVNQTEFZX0hJREVfSE9NRSkgIT0gMCA/IEdPTkUgOiBWSVNJQkxFOworICAgICAgICAgICAgaWYgKG1Mb2dvVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbUxvZ29WaWV3LnNldFZpc2liaWxpdHkodmlzKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtSWNvblZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1JY29uVmlldy5zZXRWaXNpYmlsaXR5KHZpcyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHJlcXVlc3RMYXlvdXQoKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGludmFsaWRhdGUoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldE5hdmlnYXRpb25Nb2RlKGludCBtb2RlKSB7CisgICAgICAgIGZpbmFsIGludCBvbGRNb2RlID0gbU5hdmlnYXRpb25Nb2RlOworICAgICAgICBpZiAobW9kZSAhPSBvbGRNb2RlKSB7CisgICAgICAgICAgICBzd2l0Y2ggKG9sZE1vZGUpIHsKKyAgICAgICAgICAgIGNhc2UgQWN0aW9uQmFyLk5BVklHQVRJT05fTU9ERV9TVEFOREFSRDoKKyAgICAgICAgICAgICAgICBpZiAobVRpdGxlVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHJlbW92ZVZpZXcobVRpdGxlVmlldyk7CisgICAgICAgICAgICAgICAgICAgIG1UaXRsZVZpZXcgPSBudWxsOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQWN0aW9uQmFyLk5BVklHQVRJT05fTU9ERV9EUk9QRE9XTl9MSVNUOgorICAgICAgICAgICAgICAgIGlmIChtU3Bpbm5lciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHJlbW92ZVZpZXcobVNwaW5uZXIpOworICAgICAgICAgICAgICAgICAgICBtU3Bpbm5lciA9IG51bGw7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBBY3Rpb25CYXIuTkFWSUdBVElPTl9NT0RFX0NVU1RPTToKKyAgICAgICAgICAgICAgICBpZiAobUN1c3RvbU5hdlZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICByZW1vdmVWaWV3KG1DdXN0b21OYXZWaWV3KTsKKyAgICAgICAgICAgICAgICAgICAgbUN1c3RvbU5hdlZpZXcgPSBudWxsOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgc3dpdGNoIChtb2RlKSB7CisgICAgICAgICAgICBjYXNlIEFjdGlvbkJhci5OQVZJR0FUSU9OX01PREVfU1RBTkRBUkQ6CisgICAgICAgICAgICAgICAgaW5pdFRpdGxlKCk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEFjdGlvbkJhci5OQVZJR0FUSU9OX01PREVfRFJPUERPV05fTElTVDoKKyAgICAgICAgICAgICAgICBtU3Bpbm5lciA9IG5ldyBTcGlubmVyKG1Db250ZXh0LCBudWxsLAorICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5hdHRyLmRyb3BEb3duU3Bpbm5lclN0eWxlKTsKKyAgICAgICAgICAgICAgICBtU3Bpbm5lci5zZXRPbkl0ZW1TZWxlY3RlZExpc3RlbmVyKG1OYXZJdGVtU2VsZWN0ZWRMaXN0ZW5lcik7CisgICAgICAgICAgICAgICAgbVNwaW5uZXIuc2V0TGF5b3V0UGFyYW1zKG5ldyBMYXlvdXRQYXJhbXMoTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCwKKyAgICAgICAgICAgICAgICAgICAgICAgIExheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQpKTsKKyAgICAgICAgICAgICAgICBhZGRWaWV3KG1TcGlubmVyKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQWN0aW9uQmFyLk5BVklHQVRJT05fTU9ERV9DVVNUT006CisgICAgICAgICAgICAgICAgbUN1c3RvbU5hdlZpZXcuc2V0TGF5b3V0UGFyYW1zKG5ldyBMYXlvdXRQYXJhbXMoTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCwKKyAgICAgICAgICAgICAgICAgICAgICAgIExheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQpKTsKKyAgICAgICAgICAgICAgICBhZGRWaWV3KG1DdXN0b21OYXZWaWV3KTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1OYXZpZ2F0aW9uTW9kZSA9IG1vZGU7CisgICAgICAgICAgICByZXF1ZXN0TGF5b3V0KCk7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgc2V0RHJvcGRvd25BZGFwdGVyKFNwaW5uZXJBZGFwdGVyIGFkYXB0ZXIpIHsKKyAgICAgICAgbVNwaW5uZXIuc2V0QWRhcHRlcihhZGFwdGVyKTsKKyAgICB9CisgICAgCisgICAgcHVibGljIFZpZXcgZ2V0Q3VzdG9tTmF2aWdhdGlvblZpZXcoKSB7CisgICAgICAgIHJldHVybiBtQ3VzdG9tTmF2VmlldzsKKyAgICB9CisgICAgCisgICAgcHVibGljIGludCBnZXROYXZpZ2F0aW9uTW9kZSgpIHsKKyAgICAgICAgcmV0dXJuIG1OYXZpZ2F0aW9uTW9kZTsKKyAgICB9CisgICAgCisgICAgcHVibGljIGludCBnZXREaXNwbGF5T3B0aW9ucygpIHsKKyAgICAgICAgcmV0dXJuIG1EaXNwbGF5T3B0aW9uczsKKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgc2V0Q29udGV4dE1vZGUoaW50IG1vZGUpIHsKKyAgICAgICAgQ2FsbGJhY2sgY2FsbGJhY2sgPSBtQ2FsbGJhY2s7CisgICAgICAgIGlmIChjYWxsYmFjayA9PSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAiQXR0ZW1wdGVkIHRvIHNldCBBY3Rpb25CYXIgY29udGV4dCBtb2RlIHdpdGggbm8gY2FsbGJhY2siKTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgQWN0aW9uTWVudSBtZW51ID0gbUNvbnRleHRNZW51cy5nZXQobW9kZSk7CisgICAgICAgIGlmIChtZW51ID09IG51bGwpIHsKKyAgICAgICAgICAgIC8vIEluaXRpYWxpemUgdGhlIG5ldyBtb2RlCisgICAgICAgICAgICBtZW51ID0gbmV3IEFjdGlvbk1lbnUoZ2V0Q29udGV4dCgpKTsKKworICAgICAgICAgICAgaWYgKCFjYWxsYmFjay5vbkNyZWF0ZUNvbnRleHRNb2RlKG1vZGUsIG1lbnUpKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICJBY3Rpb25CYXIgY2FsbGJhY2sgZG9lcyBub3Qga25vdyBob3cgdG8gY3JlYXRlIGNvbnRleHQgbW9kZSAiICsgbW9kZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtQ29udGV4dE1lbnVzLnB1dChtb2RlLCBtZW51KTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgaWYgKGNhbGxiYWNrLm9uUHJlcGFyZUNvbnRleHRNb2RlKG1vZGUsIG1lbnUpKSB7CisgICAgICAgICAgICAvLyBUT0RPIFNldCBtb2RlLCBhbmltYXRlLCBldGMuCisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgZXhpdENvbnRleHRNb2RlKCkgeworICAgICAgICAvLyBUT0RPIFR1cm4gb2ZmIGNvbnRleHQgbW9kZTsgZ28gYmFjayB0byBub3JtYWwuCisgICAgfQorICAgIAorICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uRmluaXNoSW5mbGF0ZSgpIHsKKyAgICAgICAgc3VwZXIub25GaW5pc2hJbmZsYXRlKCk7CisKKyAgICAgICAgaWYgKChtRGlzcGxheU9wdGlvbnMgJiBBY3Rpb25CYXIuRElTUExBWV9ISURFX0hPTUUpID09IDApIHsKKyAgICAgICAgICAgIGlmIChtTG9nbyAhPSBudWxsICYmIChtRGlzcGxheU9wdGlvbnMgJiBBY3Rpb25CYXIuRElTUExBWV9VU0VfTE9HTykgIT0gMCkgeworICAgICAgICAgICAgICAgIG1Mb2dvVmlldyA9IG5ldyBJbWFnZVZpZXcoZ2V0Q29udGV4dCgpKTsKKyAgICAgICAgICAgICAgICBtTG9nb1ZpZXcuc2V0QWRqdXN0Vmlld0JvdW5kcyh0cnVlKTsKKyAgICAgICAgICAgICAgICBtTG9nb1ZpZXcuc2V0TGF5b3V0UGFyYW1zKG5ldyBMYXlvdXRQYXJhbXMoTGF5b3V0UGFyYW1zLldSQVBfQ09OVEVOVCwKKyAgICAgICAgICAgICAgICAgICAgICAgIExheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQpKTsKKyAgICAgICAgICAgICAgICBtTG9nb1ZpZXcuc2V0SW1hZ2VEcmF3YWJsZShtTG9nbyk7CisgICAgICAgICAgICAgICAgbUxvZ29WaWV3LnNldENsaWNrYWJsZSh0cnVlKTsKKyAgICAgICAgICAgICAgICBtTG9nb1ZpZXcuc2V0Rm9jdXNhYmxlKHRydWUpOworICAgICAgICAgICAgICAgIG1Mb2dvVmlldy5zZXRPbkNsaWNrTGlzdGVuZXIobUhvbWVDbGlja0xpc3RlbmVyKTsKKyAgICAgICAgICAgICAgICBhZGRWaWV3KG1Mb2dvVmlldyk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKG1JY29uICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtSWNvblZpZXcgPSBuZXcgSW1hZ2VWaWV3KGdldENvbnRleHQoKSk7CisgICAgICAgICAgICAgICAgbUljb25WaWV3LnNldEFkanVzdFZpZXdCb3VuZHModHJ1ZSk7CisgICAgICAgICAgICAgICAgbUljb25WaWV3LnNldExheW91dFBhcmFtcyhuZXcgTGF5b3V0UGFyYW1zKExheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQsCisgICAgICAgICAgICAgICAgICAgICAgICBMYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UKSk7CisgICAgICAgICAgICAgICAgbUljb25WaWV3LnNldEltYWdlRHJhd2FibGUobUljb24pOworICAgICAgICAgICAgICAgIG1JY29uVmlldy5zZXRDbGlja2FibGUodHJ1ZSk7CisgICAgICAgICAgICAgICAgbUljb25WaWV3LnNldEZvY3VzYWJsZSh0cnVlKTsKKyAgICAgICAgICAgICAgICBtSWNvblZpZXcuc2V0T25DbGlja0xpc3RlbmVyKG1Ib21lQ2xpY2tMaXN0ZW5lcik7CisgICAgICAgICAgICAgICAgYWRkVmlldyhtSWNvblZpZXcpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgc3dpdGNoIChtTmF2aWdhdGlvbk1vZGUpIHsKKyAgICAgICAgY2FzZSBBY3Rpb25CYXIuTkFWSUdBVElPTl9NT0RFX1NUQU5EQVJEOgorICAgICAgICAgICAgaWYgKG1Mb2dvVmlldyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgaW5pdFRpdGxlKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIAorICAgICAgICBjYXNlIEFjdGlvbkJhci5OQVZJR0FUSU9OX01PREVfRFJPUERPV05fTElTVDoKKyAgICAgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgIkluZmxhdGluZyBkcm9wZG93biBsaXN0IG5hdmlnYXRpb24gaXNuJ3Qgc3VwcG9ydGVkIHlldCEiKTsKKyAgICAgICAgICAgIAorICAgICAgICBjYXNlIEFjdGlvbkJhci5OQVZJR0FUSU9OX01PREVfVEFCUzoKKyAgICAgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgIlRhYiBuYXZpZ2F0aW9uIGlzbid0IHN1cHBvcnRlZCB5ZXQhIik7CisgICAgICAgICAgICAKKyAgICAgICAgY2FzZSBBY3Rpb25CYXIuTkFWSUdBVElPTl9NT0RFX0NVU1RPTToKKyAgICAgICAgICAgIGlmIChtQ3VzdG9tTmF2VmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgYWRkVmlldyhtQ3VzdG9tTmF2Vmlldyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBwcml2YXRlIHZvaWQgaW5pdFRpdGxlKCkgeworICAgICAgICBMYXlvdXRJbmZsYXRlciBpbmZsYXRlciA9IExheW91dEluZmxhdGVyLmZyb20oZ2V0Q29udGV4dCgpKTsKKyAgICAgICAgbVRpdGxlVmlldyA9IChUZXh0VmlldykgaW5mbGF0ZXIuaW5mbGF0ZShSLmxheW91dC5hY3Rpb25fYmFyX3RpdGxlX2l0ZW0sIG51bGwpOworICAgICAgICBtVGl0bGVWaWV3LnNldExheW91dFBhcmFtcyhuZXcgTGF5b3V0UGFyYW1zKExheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQsCisgICAgICAgICAgICAgICAgTGF5b3V0UGFyYW1zLldSQVBfQ09OVEVOVCkpOworICAgICAgICBpZiAobVRpdGxlICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1UaXRsZVZpZXcuc2V0VGV4dChtVGl0bGUpOworICAgICAgICB9CisgICAgICAgIGFkZFZpZXcobVRpdGxlVmlldyk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgb25NZWFzdXJlKGludCB3aWR0aE1lYXN1cmVTcGVjLCBpbnQgaGVpZ2h0TWVhc3VyZVNwZWMpIHsKKyAgICAgICAgaW50IHdpZHRoTW9kZSA9IE1lYXN1cmVTcGVjLmdldE1vZGUod2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NpbmcpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgQWN0aW9uQmFyLk5BVklHQVRJT05fTU9ERV9EUk9QRE9XTl9MSVNUOgorICAgICAgICAgICAgaWYgKG1TcGlubmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtU3Bpbm5lci5tZWFzdXJlKAorICAgICAgICAgICAgICAgICAgICAgICAgTWVhc3VyZVNwZWMubWFrZU1lYXN1cmVTcGVjKGF2YWlsYWJsZVdpZHRoLCBNZWFzdXJlU3BlYy5FWEFDVExZKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIE1lYXN1cmVTcGVjLm1ha2VNZWFzdXJlU3BlYyhoZWlnaHQsIE1lYXN1cmVTcGVjLkVYQUNUTFkpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIEFjdGlvbkJhci5OQVZJR0FUSU9OX01PREVfQ1VTVE9NOgorICAgICAgICAgICAgaWYgKG1DdXN0b21OYXZWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtQ3VzdG9tTmF2Vmlldy5tZWFzdXJlKAorICAgICAgICAgICAgICAgICAgICAgICAgTWVhc3VyZVNwZWMubWFrZU1lYXN1cmVTcGVjKGF2YWlsYWJsZVdpZHRoLCBNZWFzdXJlU3BlYy5FWEFDVExZKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIE1lYXN1cmVTcGVjLm1ha2VNZWFzdXJlU3BlYyhoZWlnaHQsIE1lYXN1cmVTcGVjLkVYQUNUTFkpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgc2V0TWVhc3VyZWREaW1lbnNpb24oY29udGVudFdpZHRoLCBtQ29udGVudEhlaWdodCk7CisgICAgfQorCisgICAgcHJpdmF0ZSBpbnQgbWVhc3VyZUNoaWxkVmlldyhWaWV3IGNoaWxkLCBpbnQgYX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29udGVudEhlaWdodCkgKyBtU3BhY2luZzsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgc3dpdGNoIChtTmF2aWdhdGlvbk1vZGUpIHsKKyAgICAgICAgY2FzZSBBY3Rpb25CYXIuTkFWSUdBVElPTl9NT0RFX1NUQU5EQVJEOgorICAgICAgICAgICAgaWYgKG1UaXRsZVZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHggKz0gcG9zaXRpb25DaGlsZChtVGl0bGVWaWV3LCB4LCB5LCBjb250ZW50SGVpZ2h0KSArIG1TcGFjaW5nOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgQWN0aW9uQmFyLk5BVklHQVRJT05fTU9ERV9EUk9QRE9XTl9MSVNUOgorICAgICAgICAgICAgaWYgKG1TcGlubmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICB4ICs9IHBvc2l0aW9uQ2hpbGQobVNwaW5uZXIsIHgsIHksIGNvbnRlbnRIZWlnaHQpICsgbVNwYWNpbmc7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBBY3Rpb25CYXIuTkFWSUdBVElPTl9NT0RFX0NVU1RPTToKKyAgICAgICAgICAgIGlmIChtQ3VzdG9tTmF2VmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgeCArPSBwb3NpdGlvbkNoaWxkKG1DdXN0b21OYXZWaWV3LCB4LCB5LCBjb250ZW50SGVpZ2h0KSArIG1TcGFjaW5nOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICB4ID0gciAtIGwgLSBnZXRQYWRkaW5nUmlnaHQoKTsKKworICAgICAgICBpZiAobU1lbnVWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgIHggLT0gcG9zaXRpb25DaGlsZEludmVyc2UobU1lbnVWaWV3LCB4ICsgbUFjdGlvblNwYWNpbmcsIHksIG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9ydGVkT3BlcmF0aW9uRXhjZXB0aW9uKCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZHJhd0FSR0IoaW50IGEsIGludCByLCBpbnQgZywgaW50IGIpIHsKKyAgICAgICAgZHJhd0NvbG9yKChhICYgMHhGRikgPDwgMjQgfCAociAmIDB4RkYpIDw8IDE2IHwgKGcgJiAweEZGKSA8PCA4IHwgKGIgJiAweEZGKSk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZHJhd0JpdG1hcChCaXRtYXAgYml0bWFwLCBmbG9hdCBsZWZ0LCBmbG9hdCB0b3AsIFBhaW50IHBhaW50KSB7CisgICAgICAgIC8vIFRPRE86IEltcGxlbWVudAorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGRyYXdCaXRtYXAoQml0bWFwIGJpdG1hcCwgTWF0cml4IG1hdHJpeCwgUGFpbnQgcGFpbnQpIHsKKyAgICAgICAgLy8gVE9ETzogSW1wbGVtZW50CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZHJhd0JpdG1hcChCaXRtYXAgYml0bWFwLCBSZWN0IHNyYywgUmVjdCBkc3QsIFBhaW50IHBhaW50KSB7CisgICAgICAgIC8vIFRPRE86IEltcGxlbWVudAorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGRyYXdCaXRtYXAoQml0bWFwIGJpdG1hcCwgUmVjdCBzcmMsIFJlY3RGIGRzdCwgUGFpbnQgcGFpbnQpIHsKKyAgICAgICAgLy8gVE9ETzogSW1wbGVtZW50CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZHJhd0JpdG1hcChpbnRbXSBjb2xvcnMsIGludCBvZmZzZXQsIGludCBzdHJpZGUsIGZsb2F0IHgsIGZsb2F0IHksCisgICAgICAgICAgICBpbnQgd2lkdGgsIGludCBoZ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cihpbnQgZ2xWZXJzaW9uLCBib29sZWFuIHRyYW5zbHVjZW50KSB7CisgICAgICAgIHN3aXRjaCAoZ2xWZXJzaW9uKSB7CisgICAgICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBHbDEwUmVuZGVyZXIodHJhbnNsdWNlbnQpOworICAgICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICAgIHJldHVybiBuZXcgR2wyMFJlbmRlcmVyKHRyYW5zbHVjZW50KTsKKyAgICAgICAgfQorICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJVbmtub3duIEdMIHZlcnNpb246ICIgKyBnbFZlcnNpb24pOworICAgIH0KKworICAgIC8qKgorICAgICAqIEluZGljYXRlcyB3aGV0aGVyIGhhcmR3YXJlIGFjY2VsZXJhdGlvbiBpcyBjdXJyZW50bHkgZW5hYmxlZC4KKyAgICAgKiAKKyAgICAgKiBAcmV0dXJuIFRydWUgaWYgaGFyZHdhcmUgYWNjZWxlcmF0aW9uIGlzIGluIHVzZSwgZmFsc2Ugb3RoZXJ3aXNlLgorICAgICAqLworICAgIGJvb2xlYW4gaXNFbmFibGVkKCkgeworICAgICAgICByZXR1cm4gbUVuYWJsZWQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogSW5kaWNhdGVzIHdoZXRoZXIgaGFyZHdhcmUgYWNjZWxlcmF0aW9uIGlzIGN1cnJlbnRseSBlbmFibGVkLgorICAgICAqIAorICAgICAqIEBwYXJhbSBlbmFibGVkIFRydWUgaWYgdGhlIGhhcmR3YXJlIHJlbmRlcmVyIGlzIGluIHVzZSwgZmFsc2Ugb3RoZXJ3aXNlLgorICAgICAqLworICAgIHZvaWQgc2V0RW5hYmxlZChib29sZWFuIGVuYWJsZWQpIHsKKyAgICAgICAgbUVuYWJsZWQgPSBlbmFibGVkOworICAgIH0KKworICAgIC8qKgorICAgICAqIEluZGljYXRlcyB3aGV0aGVyIGhhcm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ZmlnOworCisgICAgICAgIEdMIG1HbDsKKyAgICAgICAgQ2FudmFzIG1DYW52YXM7CisKKyAgICAgICAgZmluYWwgaW50IG1HbFZlcnNpb247CisgICAgICAgIGZpbmFsIGJvb2xlYW4gbVRyYW5zbHVjZW50OworCisgICAgICAgIEdsUmVuZGVyZXIoaW50IGdsVmVyc2lvbiwgYm9vbGVhbiB0cmFuc2x1Y2VudCkgeworICAgICAgICAgICAgbUdsVmVyc2lvbiA9IGdsVmVyc2lvbjsKKyAgICAgICAgICAgIG1UcmFuc2x1Y2VudCA9IHRyYW5zbHVjZW50OworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIENoZWNrcyBmb3IgT3BlbkdMIGVycm9ycy4gSWYgYW4gZXJyb3IgaGFzIG9jY3VyZWQsIHtAbGluayAjZGVzdHJveSgpfQorICAgICAgICAgKiBpcyBpbnZva2VkIGFuZCB0aGUgcmVxdWVzdGVkIGZsYWcgaXMgdHVybmVkIG9mZi4gVGhlIGVycm9yIGNvZGUgaXMKKyAgICAgICAgICogYWxzbyBsb2dnZWQgYXMgYSB3YXJuaW5nLgorICAgICAgICAgKi8KKyAgICAgICAgdm9pZCBjaGVja0Vycm9ycygpIHsKKyAgICAgICAgICAgIGlmIChpc0VuYWJsZWQoKSkgeworICAgICAgICAgICAgICAgIGludCBlcnJvciA9IG1FZ2wuZWdsR2V0RXJyb3IoKTsKKyAgICAgICAgICAgICAgICBpZiAoZXJyb3IgIT0gRUdMMTAuRUdMX1NVQ0NFU1MpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gc29tZXRoaW5nIGJhZCBoYXMgaGFwcGVuZWQgcmV2ZXJ0IHRvCisgICAgICAgICAgICAgICAgICAgIC8vIG5vcm1hbCByZW5kZXJpbmcuCisgICAgICAgICAgICAgICAgICAgIGRlc3Ryb3koKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGVycm9yICE9IEVHTDExLkVHTF9DT05URVhUX0xPU1QpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlJ2xsIHRyeSBhZ2FpbiBpZiBpdCB3YXMgY29udGV4dCBsb3N0CisgICAgICAgICAgICAgICAgICAgICAgICBzZXRSZXF1ZXN0ZWQoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcsICJPcGVuR0wgZXJyb3I6ICIgKyBlcnJvcik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgYm9vbGVhbiBpbml0aWFsaXplKFN1cmZhY2VIb2xkZXIgaG9sZGVyKSB7CisgICAgICAgICAgICBpZiAoaXNSZXF1ZXN0ZWQoKSAmJiAhaXNFbmFibGVkKCkpIHsKKyAgICAgICAgICAgICAgICBpbml0aWFsaXplRWdsKCk7CisgICAgICAgICAgICAgICAgbUdsID0gY3JlYXRlRWdsU3VyZmFjZShob2xkZXIpOworCisgICAgICAgICAgICAgICAgaWYgKG1HbCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGludCBlcnIgPSBtRWdsLmVnbEdldEVycm9yKCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChlcnIgIT0gRUdMMTAuRUdMX1NVQ0NFU1MpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlc3Ryb3koKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNldFJlcXVlc3RlZChmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtQ2FudmFzID0gY3JlYXRlQ2FudmFzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUNhbnZhcyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0RW5hYmxlZCh0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoTE9HX1RBRywgIkhhcmR3YXJlIGFjY2VsZXJhdGVkIENhbnZhcyBjb3VsZCBub3QgYmUgY3JlYXRlZCIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1DYW52YXMgIT0gbnVsbDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBhYnN0cmFjdCBDYW52YXMgY3JlYXRlQ2FudmFzKCk7CisKKyAgICAgICAgdm9pZCBpbml0aWFsaXplRWdsKCkgeworICAgICAgICAgICAgbUVnbCA9IChFR0wxMCkgRUdMQ29udGV4dC5nZXRFR0woKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgLy8gR2V0IHRvIHRoZSBkZWZhdWx0IGRpc3BsYXkuCisgICAgICAgICAgICBtRWdsRGlzcGxheSA9IG1FZ2wuZWdsR2V0RGlzcGxheShFR0wxMC5FR0xfREVGQVVMVF9ESVNQTEFZKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKG1FZ2xEaXNwbGF5ID09IEVHTDEwLkVHTF9OT19ESVNQTEFZKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oImVnbEdldERpc3BsYXkgZmFpbGVkIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIC8vIFdlIGNhbiBub3cgaW5pdGlhbGl6ZSBFR0wgZm9yIHRoYXQgZGlzcGxheQorICAgICAgICAgICAgaW50W10gdmVyc2lvbiA9IG5ldyBpbnRbMl07CisgICAgICAgICAgICBpZiAoIW1FZ2wuZWdsSW5pdGlhbGl6ZShtRWdsRGlzcGxheSwgdmVyc2lvbikpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiZWdsSW5pdGlhbGl6ZSBmYWlsZWQiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1FZ2xDb25maWcgPSBnZXRDb25maWdDaG9vc2VyKG1HbFZlcnNpb24pLmNob29zZUNvbmZpZyhtRWdsLCBtRWdsRGlzcGxheSk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAqIENyZWF0ZSBhbiBFR0wgY29udGV4dC4gV2Ugd2FudCB0byBkbyB0aGlzIGFzIHJhcmVseSBhcyB3ZSBjYW4sIGJlY2F1c2UgYW4KKyAgICAgICAgICAgICogRUdMIGNvbnRleHQgaXMgYSBzb21ld2hhdCBoZWF2eSBvYmplY3QuCisgICAgICAgICAgICAqLworICAgICAgICAgICAgbUVnbENvbnRleHQgPSBjcmVhdGVDb250ZXh0KG1FZ2wsIG1FZ2xEaXNwbGF5LCBtRWdsQ29uZmlnKTsKKyAgICAgICAgfQorCisgICAgICAgIEdMIGNyZWF0ZUVnbFN1cmZhY2UoU3VyZmFjZUhvbGRlciBob2xkZXIpIHsKKyAgICAgICAgICAgIC8vIENoZWNrIHByZWNvbmRpdGlvbnMuCisgICAgICAgICAgICBpZiAobUVnbCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oImVnbCBub3QgaW5pdGlhbGl6ZWQiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtRWdsRGlzcGxheSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oImVnbERpc3BsYXkgbm90IGluaXRpYWxpemVkIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobUVnbENvbmZpZyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIm1FZ2xDb25maWcgbm90IGluaXRpYWxpemVkIik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgKiAgVGhlIHdpbmRvdyBzaXplIGhhcyBjaGFuZ2VkLCBzbyB3ZSBuZWVkIHRvIGNyZWF0ZSBhIG5ldworICAgICAgICAgICAgICogIHN1cmZhY2UuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmIChtRWdsU3VyZmFjZSAhPSBudWxsICYmIG1FZ2xTdXJmYWNlICE9IEVHTDEwLkVHTF9OT19TVVJGQUNFKSB7CisKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAqIFVuYmluZCBhbmQgZGVzdHJveSB0aGUgb2xkIEVHTCBzdXJmYWNlLCBpZgorICAgICAgICAgICAgICAgICAqIHRoZXJlIGlzIG9uZS4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBtRWdsLmVnbE1ha2VDdXJyZW50KG1FZ2xEaXNwbGF5LCBFR0wxMC5FR0xfTk9fU1VSRkFDRSwKKyAgICAgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9OT19TVVJGQUNFLCBFR0wxMC5FR0xfTk9fQ09OVEVYVCk7CisgICAgICAgICAgICAgICAgbUVnbC5lZ2xEZXN0cm95U3VyZmFjZShtRWdsRGlzcGxheSwgbUVnbFN1cmZhY2UpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBDcmVhdGUgYW4gRUdMIHN1cmZhY2Ugd2UgY2FuIHJlbmRlciBpbnRvLgorICAgICAgICAgICAgbUVnbFN1cmZhY2UgPSBtRWdsLmVnbENyZWF0ZVdpbmRvd1N1cmZhY2UobUVnbERpc3BsYXksIG1FZ2xDb25maWcsIGhvbGRlciwgbnVsbCk7CisKKyAgICAgICAgICAgIGlmIChtRWdsU3VyZmFjZSA9PSBudWxsIHx8IG1FZ2xTdXJmYWNlID09IEVHTDEwLkVHTF9OT19TVVJGQUNFKSB7CisgICAgICAgICAgICAgICAgaW50IGVycm9yID0gbUVnbC5lZ2xHZXRFcnJvcigpOworICAgICAgICAgICAgICAgIGlmIChlcnJvciA9PSBFR0wxMC5FR0xfQkFEX05BVElWRV9XSU5ET1cpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmUoIkVnbEhlbHBlciIsICJjcmVhdGVXaW5kb3dTdXJmYWNlIHJldHVybmVkIEVHTF9CQURfTkFUSVZFX1dJTkRPVy4iKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJjcmVhdGVXaW5kb3dTdXJmYWNlIGZhaWxlZCIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogQmVmb3JlIHdlIGNhbiBpc3N1ZSBHTCBjb21tYW5kcywgd2UgbmVlZCB0byBtYWtlIHN1cmUKKyAgICAgICAgICAgICAqIHRoZSBjb250ZXh0IGlzIGN1cnJlbnQgYW5kIGJvdW5kIHRvIGEgc3VyZmFjZS4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgaWYgKCFtRWdsLmVnbE1ha2VDdXJyZW50KG1FZ2xEaXNwbGF5LCBtRWdsU3VyZmFjZSwgbUVnbFN1cmZhY2UsIG1FZ2xDb250ZXh0KSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJlZ2xNYWtlQ3VycmVudCBmYWlsZWQiKTsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIG1FZ2xDb250ZXh0LmdldEdMKCk7CisgICAgICAgIH0KKworICAgICAgICBFR0xDb250ZXh0IGNyZWF0ZUNvbnRleHQoRUdMMTAgZWdsLCBFR0xEaXNwbGF5IGVnbERpc3BsYXksIEVHTENvbmZpZyBlZ2xDb25maWcpIHsKKyAgICAgICAgICAgIGludFtdIGF0dHJpYl9saXN0ID0geyBFR0xfQ09OVEVYVF9DTElFTlRfVkVSU0lPTiwgbUdsVmVyc2lvbiwgRUdMMTAuRUdMX05PTkUgfTsKKworICAgICAgICAgICAgcmV0dXJuIGVnbC5lZ2xDcmVhdGVDb250ZXh0KGVnbERpc3BsYXksIGVnbENvbmZpZywgRUdMMTAuRUdMX05PX0NPTlRFWFQsCisgICAgICAgICAgICAgICAgICAgIG1HbFZlcnNpb24gIT0gMCA/IGF0dHJpYl9saXN0IDogbnVsbCk7ICAgICAgICAgICAgCisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgdm9pZCBpbml0aWFsaXplSWZOZWVkZWQoaW50IHdpZHRoLCBpbnQgaGVpZ2h0LCBWaWV3LkF0dGFjaEluZm8gYXR0YWNoSW5mbywKKyAgICAgICAgICAgICAgICBTdXJmYWNlSG9sZGVyIGhvbGRlcikgeworCisgICAgICAgICAgICBpZiAoaXNSZXF1ZXN0ZWQoKSkgeworICAgICAgICAgICAgICAgIGNoZWNrRXJyb3JzKCk7CisgICAgICAgICAgICAgICAgc3VwZXIuaW5pdGlhbGl6ZUlmTmVlZGVkKHdpZHRoLCBoZWlnaHQsIGF0dGFjaEluZm8sIGhvbGRlcik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICB2b2lkIGRlc3Ryb3koKSB7CisgICAgICAgICAgICBpZiAoIWlzRW5hYmxlZCgpKSByZXR1cm47CisKKyAgICAgICAgICAgIG1FZ2wuZWdsTWFrZUN1cnJlbnQobUVnbERpc3BsYXksIEVHTDEwLkVHTF9OT19TVVJGQUNFLAorICAgICAgICAgICAgICAgICAgICBFR0wxMC5FR0xfTk9fU1VSRkFDRSwgRUdMMTAuRUdMX05PX0NPTlRFWFQpOworICAgICAgICAgICAgbUVnbC5lZ2xEZXN0cm95Q29udGV4dChtRWdsRGlzcGxheSwgbUVnbENvbnRleHQpOworICAgICAgICAgICAgbUVnbC5lZ2xEZXN0cm95U3VyZmFjZShtRWdsRGlzcGxheSwgbUVnbFN1cmZhY2UpOworICAgICAgICAgICAgbUVnbC5lZ2xUZXJtaW5hdGUobUVnbERpc3BsYXkpOworCisgICAgICAgICAgICBtRWdsQ29udGV4dCA9IG51bGw7CisgICAgICAgICAgICBtRWdsU3VyZmFjZSA9IG51bGw7CisgICAgICAgICAgICBtRWdsRGlzcGxheSA9IG51bGw7CisgICAgICAgICAgICBtRWdsID0gbnVsbDsKKyAgICAgICAgICAgIG1HbCA9IG51bGw7CisgICAgICAgICAgICBtQ2FudmFzID0gbnVsbDsKKworICAgICAgICAgICAgc2V0RW5hYmxlZChmYWxzZSk7CisgICAgICAgIH0gICAgICAgIAorICAgICAgICAKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHZvaWQgc2V0dXAoaW50IHdpZHRoLCBpbnQgaGVpZ2h0LCBWaWV3LkF0dGFjaEluZm8gYXR0YWNoSW5mbykgeworICAgICAgICAgICAgZmluYWwgZmxvYXQgc2NhbGUgPSBhdHRhY2hJbmZvLm1BcHBsaWNhdGlvblNjYWxlOworICAgICAgICAgICAgbUNhbnZhcy5zZXRWaWV3cG9ydCgoaW50KSAod2lkdGggKiBzY2FsZSArIDAuNWYpLCAoaW50KSAoaGVpZ2h0ICogc2NhbGUgKyAwLjVmKSk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGJvb2xlYW4gY2FuRHJhdygpIHsKKyAgICAgICAgICAgIHJldHVybiBtR2wgIT0gbnVsbCAmJiBtQ2FudmFzICE9IG51bGw7CisgICAgICAgIH0gICAgICAgIAorICAgICAgICAKKyAgICAgICAgdm9pZCBvblByZURyYXcoKSB7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogRGVmaW5lcyB0aGUgRUdMIGNvbmZpZ3VyYXRpb24gZm9yIHRoaXMgcmVuZGVyZXIuIFRoZSBkZWZhdWx0IGNvbmZpZ3VyYXRpb24KKyAgICAgICAgICogaXMgUkdCWCwgbm8gZGVwdGgsIG5vIHN0ZW5jaWwuCisgICAgICAgICAqIAorICAgICAgICAgKiBAcmV0dXJuIEFuIHtAbGluayBhbmRyb2lkLnZpZXcuSGFyZHdhcmVSZW5kZXJlci5HbFJlbmRlcmVyLkVnbENvbmZpZ0Nob29zZXJ9LgorICAgICAgICAgKiBAcGFyYW0gZ2xWZXJzaW9uCisgICAgICAgICAqLworICAgICAgICBFZ2xDb25maWdDaG9vc2VyIGdldENvbmZpZ0Nob29zZXIoaW50IGdsVmVyc2lvbikgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBDb21wb25lbnRTaXplQ2hvb3NlcihnbFZlcnNpb24sIDgsIDgsIDgsIG1UcmFuc2x1Y2VudCA/IDggOiAwLCAwLCAwKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICB2b2lkIGRyYXcoVmlldyB2aWV3LCBWaWV3LkF0dGFjaEluZm8gYXR0YWNoSW5mbywgQ29tcGF0aWJpbGl0eUluZm8uVHJhbnNsYXRvciB0cmFuc2xhdG9yLAorICAgICAgICAgICAgICAgIGludCB5b2ZmLCBib29sZWFuIHNjYWxpbmdSZXF1aXJlZCkgeworCisgICAgICAgICAgICBpZiAoY2FuRHJhdygpKSB7CisgICAgICAgICAgICAgICAgYXR0YWNoSW5mby5tRHJhd2luZ1RpbWUgPSBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKTsKKyAgICAgICAgICAgICAgICBhdHRhY2hJbmZvLm1JZ25vcmVEaXJ0eVN0YXRlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB2aWV3Lm1Qcml2YXRlRmxhZ3MgfD0gVmlldy5EUkFXTjsKKworICAgICAgICAgICAgICAgIG9uUHJlRHJhdygpOworCisgICAgICAgICAgICAgICAgQ2FudmFzIGNhbnZhcyA9IG1DYW52YXM7CisgICAgICAgICAgICAgICAgaW50IHNhdmVDb3VudCA9IGNhbnZhcy5zYXZlKENhbnZhcy5NQVRSSVhfU0FWRV9GTEFHKTsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDAsIC15b2ZmKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHRyYW5zbGF0b3IgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNsYXRvci50cmFuc2xhdGVDYW52YXMoY2FudmFzKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBjYW52YXMuc2V0U2NyZWVuRGVuc2l0eShzY2FsaW5nUmVxdWlyZWQgPyBEaXNwbGF5TWV0cmljcy5ERU5TSVRZX0RFVklDRSA6IDApOworICAgIAorICAgICAgICAgICAgICAgICAgICB2aWV3LmRyYXcoY2FudmFzKTsKKyAgICAgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgICAgICBjYW52YXMucmVzdG9yZVRvQ291bnQoc2F2ZUNvdW50KTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBhdHRhY2hJbmZvLm1JZ25vcmVEaXJ0eVN0YXRlID0gZmFsc2U7CisKKyAgICAgICAgICAgICAgICBtRWdsLmVnbFN3YXBCdWZmZXJzKG1FZ2xEaXNwbGF5LCBtRWdsU3VyZmFjZSk7CisgICAgICAgICAgICAgICAgY2hlY2tFcnJvcnMoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHN0YXRpYyBhYnN0cmFjdCBjbGFzcyBFZ2xDb25maWdDaG9vc2VyIHsKKyAgICAgICAgICAgIGZpbmFsIGludFtdIG1Db25maWdTcGVjOworICAgICAgICAgICAgcHJpdmF0ZSBmaW5hbCBpbnQgbUdsVmVyc2lvbjsKKworICAgICAgICAgICAgRWdsQ29uZmlnQ2hvb3NlcihpbnQgZ2xWZXJzaW9uLCBpbnRbXSBjb25maWdTcGVjKSB7CisgICAgICAgICAgICAgICAgbUdsVmVyc2lvbiA9IGdsVmVyc2lvbjsKKyAgICAgICAgICAgICAgICBtQ29uZmlnU3BlYyA9IGZpbHRlckNvbmZpZ1NwZWMoY29uZmlnU3BlYyk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIEVHTENvbmZpZyBjaG9vc2VDb25maWcoRUdMMTAgZWdsLCBFR0xEaXNwbGF5IGRpc3BsYXkpIHsKKyAgICAgICAgICAgICAgICBpbnRbXSBudW1fY29uZmlnID0gbmV3IGludFsxXTsKKyAgICAgICAgICAgICAgICBpZiAoIWVnbC5lZ2xDaG9vc2VDb25maWcoZGlzcGxheSwgbUNvbmZpZ1NwZWMsIG51bGwsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICBudW1fY29uZmlnKSkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJlZ2xDaG9vc2VDb25maWcgZmFpbGVkIik7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaW50IG51bUNvbmZpZ3MgPSBudW1fY29uZmlnWzBdOworCisgICAgICAgICAgICAgICAgaWYgKG51bUNvbmZpZ3MgPD0gMCkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICJObyBjb25maWdzIG1hdGNoIGNvbmZpZ1NwZWMiKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBFR0xDb25maWdbXSBjb25maWdzID0gbmV3IEVHTENvbmZpZ1tudW1Db25maWdzXTsKKyAgICAgICAgICAgICAgICBpZiAoIWVnbC5lZ2xDaG9vc2VDb25maWcoZGlzcGxheSwgbUNvbmZpZ1NwZWMsIGNvbmZpZ3MsIG51bUNvbmZpZ3MsCisgICAgICAgICAgICAgICAgICAgICAgICBudW1fY29uZmlnKSkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJlZ2xDaG9vc2VDb25maWcjMiBmYWlsZWQiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRUdMQ29uZmlnIGNvbmZpZyA9IGNob29zZUNvbmZpZyhlZ2wsIGRpc3BsYXksIGNvbmZpZ3MpOworICAgICAgICAgICAgICAgIGlmIChjb25maWcgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJObyBjb25maWcgY2hvc2VuIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBjb25maWc7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGFic3RyYWN0IEVHTENvbmZpZyBjaG9vc2VDb25maWcoRUdMMTAgZWdsLCBFR0xEaXNwbGF5IGRpc3BsYXksCisgICAgICAgICAgICAgICAgICAgIEVHTENvbmZpZ1tdIGNvbmZpZ3MpOworCisgICAgICAgICAgICBwcml2YXRlIGludFtdIGZpbHRlckNvbmZpZ1NwZWMoaW50W10gY29uZmlnU3BlYykgeworICAgICAgICAgICAgICAgIGlmIChtR2xWZXJzaW9uICE9IDIpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbmZpZ1NwZWM7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8qIFdlIGtub3cgbm9uZSBvZiB0aGUgc3ViY2xhc3NlcyBkZWZpbmUgRUdMX1JFTkRFUkFCTEVfVFlQRS4KKyAgICAgICAgICAgICAgICAgKiBBbmQgd2Uga25vdyB0aGUgY29uZmlnU3BlYyBpcyB3ZWxsIGZvcm1lZC4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBpbnQgbGVuID0gY29uZmlnU3BlYy5sZW5ndGg7CisgICAgICAgICAgICAgICAgaW50W10gbmV3Q29uZmlnU3BlYyA9IG5ldyBpbnRbbGVuICsgMl07CisgICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShjb25maWdTcGVjLCAwLCBuZXdDb25maWdTcGVjLCAwLCBsZW4tMSk7CisgICAgICAgICAgICAgICAgbmV3Q29uZmlnU3BlY1tsZW4tMV0gPSBFR0wxMC5FR0xfUkVOREVSQUJMRV9UWVBFOworICAgICAgICAgICAgICAgIG5ld0NvbmZpZ1NwZWNbbGVuXSA9IDQ7IC8qIEVHTF9PUEVOR0xfRVMyX0JJVCAqLworICAgICAgICAgICAgICAgIG5ld0NvbmZpZ1NwZWNbbGVuKzFdID0gRUdMMTAuRUdMX05PTkU7CisgICAgICAgICAgICAgICAgcmV0dXJuIG5ld0NvbmZpZ1NwZWM7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQ2hvb3NlIGEgY29uZmlndXJhdGlvbiB3aXRoIGV4YWN0bHkgdGhlIHNwZWNpZmllZCByLGcsYixhIHNpemVzLAorICAgICAgICAgKiBhbmQgYXQgbGVhc3QgdGhlIHNwZWNpZmllZCBkZXB0aCBhbmQgc3RlbmNpbCBzaXplcy4KKyAgICAgICAgICovCisgICAgICAgIHN0YXRpYyBjbGFzcyBDb21wb25lbnRTaXplQ2hvb3NlciBleHRlbmRzIEVnbENvbmZpZ0Nob29zZXIgeworICAgICAgICAgICAgcHJpdmF0ZSBpbnRbXSBtVmFsdWU7CisKKyAgICAgICAgICAgIHByaXZhdGUgaW50IG1SZWRTaXplOworICAgICAgICAgICAgcHJpdmF0ZSBpbnQgbUdyZWVuU2l6ZTsKKyAgICAgICAgICAgIHByaXZhdGUgaW50IG1CbHVlU2l6ZTsKKyAgICAgICAgICAgIHByaXZhdGUgaW50IG1BbHBoYVNpemU7CisgICAgICAgICAgICBwcml2YXRlIGludCBtRGVwdGhTaXplOworICAgICAgICAgICAgcHJpdmF0ZSBpbnQgbVN0ZW5jaWxTaXplOworCisgICAgICAgICAgICBDb21wb25lbnRTaXplQ2hvb3NlcihpbnQgZ2xWZXJzaW9uLCBpbnQgcmVkU2l6ZSwgaW50IGdyZWVuU2l6ZSwgaW50IGJsdWVTaXplLAorICAgICAgICAgICAgICAgICAgICBpbnQgYWxwaGFTaXplLCBpbnQgZGVwdGhTaXplLCBpbnQgc3RlbmNpbFNpemUpIHsKKyAgICAgICAgICAgICAgICBzdXBlcihnbFZlcnNpb24sIG5ldyBpbnRbXSB7CisgICAgICAgICAgICAgICAgICAgICAgICBFR0wxMC5FR0xfUkVEX1NJWkUsIHJlZFNpemUsCisgICAgICAgICAgICAgICAgICAgICAgICBFR0wxMC5FR0xfR1JFRU5fU0laRSwgZ3JlZW5TaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX0JMVUVfU0laRSwgYmx1ZVNpemUsCisgICAgICAgICAgICAgICAgICAgICAgICBFR0wxMC5FR0xfQUxQSEFfU0laRSwgYWxwaGFTaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX0RFUFRIX1NJWkUsIGRlcHRoU2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9TVEVOQ0lMX1NJWkUsIHN0ZW5jaWxTaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX05PTkUgfSk7CisgICAgICAgICAgICAgICAgbVZhbHVlID0gbmV3IGludFsxXTsKKyAgICAgICAgICAgICAgICBtUmVkU2l6ZSA9IHJlZFNpemU7CisgICAgICAgICAgICAgICAgbUdyZWVuU2l6ZSA9IGdyZWVuU2l6ZTsKKyAgICAgICAgICAgICAgICBtQmx1ZVNpemUgPSBibHVlU2l6ZTsKKyAgICAgICAgICAgICAgICBtQWxwaGFTaXplID0gYWxwaGFTaXplOworICAgICAgICAgICAgICAgIG1EZXB0aFNpemUgPSBkZXB0aFNpemU7CisgICAgICAgICAgICAgICAgbVN0ZW5jaWxTaXplID0gc3RlbmNpbFNpemU7CisgICAgICAgICAgIH0KKworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBFR0xDb25maWcgY2hvb3NlQ29uZmlnKEVHTDEwIGVnbCwgRUdMRGlzcGxheSBkaXNwbGF5LCBFR0xDb25maWdbXSBjb25maWdzKSB7CisgICAgICAgICAgICAgICAgZm9yIChFR0xDb25maWcgY29uZmlnIDogY29uZmlncykgeworICAgICAgICAgICAgICAgICAgICBpbnQgZCA9IGZpbmRDb25maWdBdHRyaWIoZWdsLCBkaXNwbGF5LCBjb25maWcsIEVHTDEwLkVHTF9ERVBUSF9TSVpFLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IHMgPSBmaW5kQ29uZmlnQXR0cmliKGVnbCwgZGlzcGxheSwgY29uZmlnLCBFR0wxMC5FR0xfU1RFTkNJTF9TSVpFLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKChkID49IG1EZXB0aFNpemUpICYmIChzID49IG1TdGVuY2lsU2l6ZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCByID0gZmluZENvbmZpZ0F0dHJpYihlZ2wsIGRpc3BsYXksIGNvbmZpZywgRUdMMTAuRUdMX1JFRF9TSVpFLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBnID0gZmluZENvbmZpZ0F0dHJpYihlZ2wsIGRpc3BsYXksIGNvbmZpZywgRUdMMTAuRUdMX0dSRUVOX1NJWkUsIDApOworICAgICAgICAgICAgICAgICAgICAgICAgaW50IGIgPSBmaW5kQ29uZmlnQXR0cmliKGVnbCwgZGlzcGxheSwgY29uZmlnLCBFR0wxMC5FR0xfQkxVRV9TSVpFLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBhID0gZmluZENvbmZpZ0F0dHJpYihlZ2wsIGRpc3BsYXksIGNvbmZpZywgRUdMMTAuRUdMX0FMUEhBX1NJWkUsIDApOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChyID09IG1SZWRTaXplKSAmJiAoZyA9PSBtR3JlZW5TaXplKSAmJiAoYiA9PSBtQmx1ZVNpemUpICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhID09IG1BbHBoYVNpemUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbmZpZzsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcHJpdmF0ZSBpbnQgZmluZENvbmZpZ0F0dHJpYihFR0wxMCBlZ2wsIEVHTERpc3BsYXkgZGlzcGxheSwKKyAgICAgICAgICAgICAgICAgICAgRUdMQ29uZmlnIGNvbmZpZywgaW50IGF0dHJpYnV0ZSwgaW50IGRlZmF1bHRWYWx1ZSkgeworCisgICAgICAgICAgICAgICAgaWYgKGVnbC5lZ2xHZXRDb25maWdBdHRyaWIoZGlzcGxheSwgY29uZmlnLCBhdHRyaWJ1dGUsIG1WYWx1ZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1WYWx1ZVswXTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICByZXR1cm4gZGVmYXVsdFZhbHVlOworICAgICAgICAgICAgfQorICAgICAgICB9ICAgICAgICAKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogSGFyZHdhcmUgcmVuZGVyZXIgdXNpbmcgT3BlbkdMIEVTIDIuMC4KKyAgICAgKi8KKyAgICBzdGF0aWMgY2xhc3MgR2wyMFJlbmRlcmVyIGV4dGVuZHMgR2xSZW5kZXJlciB7CisgICAgICAgIHByaXZhdGUgR0xFUzIwQ2FudmFzIG1HbENhbnZhczsKKworICAgICAgICBHbDIwUmVuZGVyZXIoYm9vbGVhbiB0cmFuc2x1Y2VudCkgeworICAgICAgICAgICAgc3VwZXIoMiwgdHJhbnNsdWNlbnQpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIENhbnZhcyBjcmVhdGVDYW52YXMoKSB7CisgICAgICAgICAgICByZXR1cm4gbUdsQ2FudmFzID0gbmV3IEdMRVMyMENhbnZhcyhtR2wsIG1UcmFuc2x1Y2VudCk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgdm9pZCBvblByZURyYXcoKSB7CisgICAgICAgICAgICBtR2xDYW52YXMub25QcmVEcmF3KCk7CisgICAgICAgIH0gICAgICAgIAorICAgIH0KKworICAgIC8qKgorICAgICAqIEhhcmR3YXJlIHJlbmRlcmVyIHVzaW5nIE9wZW5HTCBFUyAxLjAuCisgICAgICovCisgICAgQFN1cHByZXNzV2FybmluZ3MoeyJkZXByZWNhdGlvbiJ9KQorICAgIHN0YXRpYyBjbGFzcyBHbDEwUmVuZGVyZXIgZXh0ZW5kcyBHbFJlbmRlcmVyIHsKKyAgICAgICAgR2wxMFJlbmRlcmVyKGJvb2xlYW4gdHJhbnNsdWNlbnQpIHsKKyAgICAgICAgICAgIHN1cGVyKDEsIHRyYW5zbHVjZW50KTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBDYW52YXMgY3JlYXRlQ2FudmFzKCkgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBDYW52YXMobUdsKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICB2b2lkIGRlc3Ryb3koKSB7CisgICAgICAgICAgICBpZiAoaXNFbmFibGVkKCkpIHsKKyAgICAgICAgICAgICAgICBuYXRpdmVBYmFuZG9uR2xDYWNoZXMoKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc3VwZXIuZGVzdHJveSgpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHZvaWQgb25QcmVEcmF3KCkgeworICAgICAgICAgICAgR0wxMSBnbCA9IChHTDExKSBtR2w7CisgICAgICA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gICAgICAgICBuZXcgSGFzaE1hcDxTdHJpbmcsIENvbnN0cnVjdG9yPD8gZXh0ZW5kcyBWaWV3Pj4oKTsKICAgICAKICAgICBwcml2YXRlIEhhc2hNYXA8U3RyaW5nLCBCb29sZWFuPiBtRmlsdGVyTWFwOwogCkBAIC05Nyw2ICs5Nyw3IEBACiAgICAgICAgICAqIAogICAgICAgICAgKiBAcmV0dXJuIFRydWUgaWYgdGhpcyBjbGFzcyBpcyBhbGxvd2VkIHRvIGJlIGluZmxhdGVkLCBvciBmYWxzZSBvdGhlcndpc2UKICAgICAgICAgICovCisgICAgICAgIEBTdXBwcmVzc1dhcm5pbmdzKCJ1bmNoZWNrZWQiKQogICAgICAgICBib29sZWFuIG9uTG9hZENsYXNzKENsYXNzIGNsYXp6KTsKICAgICB9CiAgICAgCkBAIC0zNzksNyArMzgwLDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiVmlld0dyb3VwIHJvb3QgYW5kIGF0dGFjaFRvUm9vdD10cnVlIik7CiAgICAgICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgICAgICBySW5mbGF0ZShwYXJzZXIsIHJvb3QsIGF0dHJzKTsKKyAgICAgICAgICAgICAgICAgICAgckluZmxhdGUocGFyc2VyLCByb290LCBhdHRycywgZmFsc2UpOwogICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgIC8vIFRlbXAgaXMgdGhlIHJvb3QgdmlldyB0aGF0IHdhcyBmb3VuZCBpbiB0aGUgeG1sCiAgICAgICAgICAgICAgICAgICAgIFZpZXcgdGVtcCA9IGNyZWF0ZVZpZXdGcm9tVGFnKG5hbWUsIGF0dHJzKTsKQEAgLTQwNCw3ICs0MDUsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCItLS0tLT4gc3RhcnQgaW5mbGF0aW5nIGNoaWxkcmVuIik7CiAgICAgICAgICAgICAgICAgICAg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bnN0cnVjdG9yPD8gZXh0ZW5kcyBWaWV3PiBjb25zdHJ1Y3RvciA9IHNDb25zdHJ1Y3Rvck1hcC5nZXQobmFtZSk7CisgICAgICAgIENsYXNzPD8gZXh0ZW5kcyBWaWV3PiBjbGF6eiA9IG51bGw7CiAKICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgIGlmIChjb25zdHJ1Y3RvciA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgLy8gQ2xhc3Mgbm90IGZvdW5kIGluIHRoZSBjYWNoZSwgc2VlIGlmIGl0J3MgcmVhbCwgYW5kIHRyeSB0byBhZGQgaXQKICAgICAgICAgICAgICAgICBjbGF6eiA9IG1Db250ZXh0LmdldENsYXNzTG9hZGVyKCkubG9hZENsYXNzKAotICAgICAgICAgICAgICAgICAgICAgICAgcHJlZml4ICE9IG51bGwgPyAocHJlZml4ICsgbmFtZSkgOiBuYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHByZWZpeCAhPSBudWxsID8gKHByZWZpeCArIG5hbWUpIDogbmFtZSkuYXNTdWJjbGFzcyhWaWV3LmNsYXNzKTsKICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICBpZiAobUZpbHRlciAhPSBudWxsICYmIGNsYXp6ICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBhbGxvd2VkID0gbUZpbHRlci5vbkxvYWRDbGFzcyhjbGF6eik7CkBAIC00ODIsNyArNDgzLDcgQEAKICAgICAgICAgICAgICAgICAgICAgaWYgKGFsbG93ZWRTdGF0ZSA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBOZXcgY2xhc3MgLS0gcmVtZW1iZXIgd2hldGhlciBpdCBpcyBhbGxvd2VkCiAgICAgICAgICAgICAgICAgICAgICAgICBjbGF6eiA9IG1Db250ZXh0LmdldENsYXNzTG9hZGVyKCkubG9hZENsYXNzKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVmaXggIT0gbnVsbCA/IChwcmVmaXggKyBuYW1lKSA6IG5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVmaXggIT0gbnVsbCA/IChwcmVmaXggKyBuYW1lKSA6IG5hbWUpLmFzU3ViY2xhc3MoVmlldy5jbGFzcyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gYWxsb3dlZCA9IGNsYXp6ICE9IG51bGwgJiYgbUZpbHRlci5vbkxvYWRDbGFzcyhjbGF6eik7CiAgICAgICAgICAgICAgICAgICAgICAgICBtRmlsdGVyTWFwLnB1dChuYW1lLCBhbGxvd2VkKTsKQEAgLTQ5Nyw3ICs0OTgsNyBAQAogCiAgICAgICAgICAgICBPYmplY3RbXSBhcmdzID0gbUNvbnN0cnVjdG9yQXJnczsKICAgICAgICAgICAgIGFyZ3NbMV0gPSBhdHRyczsKLSAgICAgICAgICAgIHJldHVybiAoVmlldykgY29uc3RydWN0b3IubmV3SW5zdGFuY2UoYXJncyk7CisgICAgICAgICAgICByZXR1cm4gY29uc3RydWN0b3IubmV3SW5zdGFuY2UoYXJncyk7CiAKICAgICAgICAgfSBjYXRjaCAoTm9TdWNoTWV0aG9kRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgIEluZmxhdGVFeGNlcHRpb24gaWUgPSBuZXcgSW5mbGF0ZUV4Y2VwdGlvbihhdHRycy5nZXRQb3NpdGlvbkRlc2NyaXB0aW9uKCkKQEAgLTUwNiw2ICs1MDcsMTMgQEAKICAgICAgICAgICAgIGllLmluaXRDYXVzZShlKTsKICAgICAgICAgICAgIHRocm93IGllOwogCisgICAgICAgIH0gY2F0Y2ggKENsYXNzQ2FzdEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAvLyBJZiBsb2FkZWQgY2xhc3MgaXMgbm90IGEgVmlldyBzdWJjbGFzcworICAgICAgICAgICAgSW5mbGF0ZUV4Y2VwdGlvbiBp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AgICAgICAgICAgICAgICB2aWV3R3JvdXAuYWRkVmlldyh2aWV3LCBwYXJhbXMpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKLSAgICAgICAgcGFyZW50Lm9uRmluaXNoSW5mbGF0ZSgpOworICAgICAgICBpZiAoZmluaXNoSW5mbGF0ZSkgcGFyZW50Lm9uRmluaXNoSW5mbGF0ZSgpOwogICAgIH0KIAogICAgIHByaXZhdGUgdm9pZCBwYXJzZVJlcXVlc3RGb2N1cyhYbWxQdWxsUGFyc2VyIHBhcnNlciwgVmlldyBwYXJlbnQpCkBAIC02NzQsNyArNjgyLDcgQEAKIAogICAgICAgICAgICAgICAgICAgICBpZiAoVEFHX01FUkdFLmVxdWFscyhjaGlsZE5hbWUpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJbmZsYXRlIGFsbCBjaGlsZHJlbi4KLSAgICAgICAgICAgICAgICAgICAgICAgIHJJbmZsYXRlKGNoaWxkUGFyc2VyLCBwYXJlbnQsIGNoaWxkQXR0cnMpOworICAgICAgICAgICAgICAgICAgICAgICAgckluZmxhdGUoY2hpbGRQYXJzZXIsIHBhcmVudCwgY2hpbGRBdHRycywgZmFsc2UpOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgVmlldyB2aWV3ID0gY3JlYXRlVmlld0Zyb21UYWcoY2hpbGROYW1lLCBjaGlsZEF0dHJzKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFZpZXdHcm91cCBncm91cCA9IChWaWV3R3JvdXApIHBhcmVudDsKQEAgLTY5OSw3ICs3MDcsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJbmZsYXRlIGFsbCBjaGlsZHJlbi4KLSAgICAgICAgICAgICAgICAgICAgICAgIHJJbmZsYXRlKGNoaWxkUGFyc2VyLCB2aWV3LCBjaGlsZEF0dHJzKTsKKy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nUuTWVudUl0ZW1JbXBsOworCiAvKioKICAqIFRoaXMgY2xhc3MgaXMgdXNlZCB0byBpbnN0YW50aWF0ZSBtZW51IFhNTCBmaWxlcyBpbnRvIE1lbnUgb2JqZWN0cy4KICAqIDxwPgpAQCAtMTY2LDYgKzE2Nyw0MSBAQAogICAgICAgICB9CiAgICAgfQogICAgIAorICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIEluZmxhdGVkT25NZW51SXRlbUNsaWNrTGlzdGVuZXIKKyAgICAgICAgICAgIGltcGxlbWVudHMgTWVudUl0ZW0uT25NZW51SXRlbUNsaWNrTGlzdGVuZXIgeworICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBDbGFzc1tdIFBBUkFNX1RZUEVTID0gbmV3IENsYXNzW10geyBNZW51SXRlbS5jbGFzcyB9OworICAgICAgICAKKyAgICAgICAgcHJpdmF0ZSBDb250ZXh0IG1Db250ZXh0OworICAgICAgICBwcml2YXRlIE1ldGhvZCBtTWV0aG9kOworICAgICAgICAKKyAgICAgICAgcHVibGljIEluZmxhdGVkT25NZW51SXRlbUNsaWNrTGlzdGVuZXIoQ29udGV4dCBjb250ZXh0LCBTdHJpbmcgbWV0aG9kTmFtZSkgeworICAgICAgICAgICAgbUNvbnRleHQgPSBjb250ZXh0OworICAgICAgICAgICAgQ2xhc3MgYyA9IGNvbnRleHQuZ2V0Q2xhc3MoKTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgbU1ldGhvZCA9IGMuZ2V0TWV0aG9kKG1ldGhvZE5hbWUsIFBBUkFNX1RZUEVTKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgSW5mbGF0ZUV4Y2VwdGlvbiBleCA9IG5ldyBJbmZsYXRlRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgIkNvdWxkbid0IHJlc29sdmUgbWVudSBpdGVtIG9uQ2xpY2sgaGFuZGxlciAiICsgbWV0aG9kTmFtZSArCisgICAgICAgICAgICAgICAgICAgICAgICAiIGluIGNsYXNzICIgKyBjLmdldE5hbWUoKSk7CisgICAgICAgICAgICAgICAgZXguaW5pdENhdXNlKGUpOworICAgICAgICAgICAgICAgIHRocm93IGV4OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBwdWJsaWMgYm9vbGVhbiBvbk1lbnVJdGVtQ2xpY2soTWVudUl0ZW0gaXRlbSkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBpZiAobU1ldGhvZC5nZXRSZXR1cm5UeXBlKCkgPT0gQm9vbGVhbi5UWVBFKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAoQm9vbGVhbikgbU1ldGhvZC5pbnZva2UobUNvbnRleHQsIGl0ZW0pOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIG1NZXRob2QuaW52b2tlKG1Db250ZXh0LCBpdGVtKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbihlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICAKICAgICAvKioKICAgICAgKiBTdGF0ZSBmb3IgdGhlIGN1cnJlbnQgbWVudS4KICAgICAgKiA8cD4KQEAgLTIwNSw2ICsyNDEsMTYgQEAKICAgICAgICAgcHJpdmF0ZSBib29sZWFuIGl0ZW1WaXNpYmxlOwogICAgICAgICBwcml2YXRlIGJvb2xlYW4gaXRlbUVuYWJsZWQ7CiAgICAgICAgIAorICAgICAgICAvKioKKyAgICAgICAgICogU3luYyB0byBhdHRycy54bWwgZW51bToKKyAgICAgICAgICogLSAwOiBuZXZlcgorICAgICAgICAgKiAtI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cmluZyhjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5NZW51SXRlbV9vbkNsaWNrKTsKICAgICAgICAgICAgIAogICAgICAgICAgICAgYS5yZWN5Y2xlKCk7CiAgICAgICAgICAgICAKQEAgLTI5OSw5ICszNDcsMTggQEAKICAgICAgICAgICAgICAgICAuc2V0SWNvbihpdGVtSWNvblJlc0lkKQogICAgICAgICAgICAgICAgIC5zZXRBbHBoYWJldGljU2hvcnRjdXQoaXRlbUFscGhhYmV0aWNTaG9ydGN1dCkKICAgICAgICAgICAgICAgICAuc2V0TnVtZXJpY1Nob3J0Y3V0KGl0ZW1OdW1lcmljU2hvcnRjdXQpOworICAgICAgICAgICAgCisgICAgICAgICAgICBpZiAoaXRlbUxpc3RlbmVyTWV0aG9kTmFtZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaXRlbS5zZXRPbk1lbnVJdGVtQ2xpY2tMaXN0ZW5lcigKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBJbmZsYXRlZE9uTWVudUl0ZW1DbGlja0xpc3RlbmVyKG1Db250ZXh0LCBpdGVtTGlzdGVuZXJNZXRob2ROYW1lKSk7CisgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIGlmIChpdGVtQ2hlY2thYmxlID49IDIpIHsKLSAgICAgICAgICAgICAgICAoKE1lbnVJdGVtSW1wbCkgaXRlbSkuc2V0RXhjbHVzaXZlQ2hlY2thYmxlKHRydWUpOworICAgICAgICAgICAgaWYgKGl0ZW0gaW5zdGFuY2VvZiBNZW51SXRlbUltcGwpIHsKKyAgICAgICAgICAgICAgICBNZW51SXRlbUltcGwgaW1wbCA9IChNZW51SXRlbUltcGwpIGl0ZW07CisgICAgICAgICAgICAgICAgaWYgKGl0ZW1DaGVja2FibGUgPj0gMikgeworICAgICAgICAgICAgICAgICAgICBpbXBsLnNldEV4Y2x1c2l2ZUNoZWNrYWJsZSh0cnVlKTsKKyAgICAgICAgICAgICAgICB9CisgICA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KQEAgLTE1MjAsNyArMTU1MCwxMSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgaW52YWxpZGF0ZShjbCwgY3QsIGNyLCBjYik7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBhLmdldEludmFsaWRhdGVSZWdpb24oMCwgMCwgY3IgLSBjbCwgY2IgLSBjdCwgcmVnaW9uLCB0cmFuc2Zvcm1Ub0FwcGx5KTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1JbnZhbGlkYXRlUmVnaW9uID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1JbnZhbGlkYXRlUmVnaW9uID0gbmV3IFJlY3RGKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZmluYWwgUmVjdEYgcmVnaW9uID0gbUludmFsaWRhdGVSZWdpb247CisgICAgICAgICAgICAgICAgICAgIGEuZ2V0SW52YWxpZGF0ZVJlZ2lvbigwLCAwLCBjciAtIGNsLCBjYiAtIGN0LCByZWdpb24sIGludmFsaWRhdGlvblRyYW5zZm9ybSk7CiAKICAgICAgICAgICAgICAgICAgICAgLy8gVGhlIGNoaWxkIG5lZWQgdG8gZHJhdyBhbiBhbmltYXRpb24sIHBvdGVudGlhbGx5IG9mZnNjcmVlbiwgc28KICAgICAgICAgICAgICAgICAgICAgLy8gbWFrZSBzdXJlIHdlIGRvIG5vdCBjYW5jZWwgaW52YWxpZGF0ZSByZXF1ZXN0cwpAQCAtMTUzMyw5ICsxNTY3LDYgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfSBlbHNlIGlmICgoZmxhZ3MgJiBGTEFHX1NVUFBPUlRfU1RBVElDX1RSQU5TRk9STUFUSU9OUykgPT0KICAgICAgICAgICAgICAgICBGTEFHX1NVUFBPUlRfU1RBVElDX1RSQU5TRk9STUFUSU9OUykgewotICAgICAgICAgICAgaWYgKG1DaGlsZFRyY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gICAgICAgICAqLwotICAgICAgICBpbnRbXSB2ZXJzaW9uID0gbmV3IGludFsyXTsKLSAgICAgICAgZWdsLmVnbEluaXRpYWxpemUoZWdsRGlzcGxheSwgdmVyc2lvbik7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogU3BlY2lmeSBhIGNvbmZpZ3VyYXRpb24gZm9yIG91ciBvcGVuZ2wgc2Vzc2lvbgotICAgICAgICAgKiBhbmQgZ3JhYiB0aGUgZmlyc3QgY29uZmlndXJhdGlvbiB0aGF0IG1hdGNoZXMgaXMKLSAgICAgICAgICovCi0gICAgICAgIGZpbmFsIGludFtdIGNvbmZpZ1NwZWMgPSB7Ci0gICAgICAgICAgICAgICAgRUdMMTAuRUdMX1JFRF9TSVpFLCAgICAgIDUsCi0gICAgICAgICAgICAgICAgRUdMMTAuRUdMX0dSRUVOX1NJWkUsICAgIDYsCi0gICAgICAgICAgICAgICAgRUdMMTAuRUdMX0JMVUVfU0laRSwgICAgIDUsCi0gICAgICAgICAgICAgICAgRUdMMTAuRUdMX0RFUFRIX1NJWkUsICAgIDAsCi0gICAgICAgICAgICAgICAgRUdMMTAuRUdMX05PTkUKLSAgICAgICAgfTsKLSAgICAgICAgZmluYWwgRUdMQ29uZmlnW10gY29uZmlncyA9IG5ldyBFR0xDb25maWdbMV07Ci0gICAgICAgIGZpbmFsIGludFtdIG51bV9jb25maWcgPSBuZXcgaW50WzFdOwotICAgICAgICBlZ2wuZWdsQ2hvb3NlQ29uZmlnKGVnbERpc3BsYXksIGNvbmZpZ1NwZWMsIGNvbmZpZ3MsIDEsIG51bV9jb25maWcpOwotICAgICAgICBmaW5hbCBFR0xDb25maWcgY29uZmlnID0gY29uZmlnc1swXTsKLQotICAgICAgICAvKgotICAgICAgICAgKiBDcmVhdGUgYW4gT3BlbkdMIEVTIGNvbnRleHQuIFRoaXMgbXVzdCBiZSBkb25lIG9ubHkgb25jZSwgYW4KLSAgICAgICAgICogT3BlbkdMIGNvbnRleHQgaXMgYSBzb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NFU1MpIHsKLSAgICAgICAgICAgICAgICAvLyBzb21ldGhpbmcgYmFkIGhhcyBoYXBwZW5lZCByZXZlcnQgdG8KLSAgICAgICAgICAgICAgICAvLyBub3JtYWwgcmVuZGVyaW5nLgotICAgICAgICAgICAgICAgIGRlc3Ryb3lHTCgpOwotICAgICAgICAgICAgICAgIGlmIChlcnIgIT0gRUdMMTEuRUdMX0NPTlRFWFRfTE9TVCkgewotICAgICAgICAgICAgICAgICAgICAvLyB3ZSdsbCB0cnkgYWdhaW4gaWYgaXQgd2FzIGNvbnRleHQgbG9zdAotICAgICAgICAgICAgICAgICAgICBtR2xXYW50ZWQgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KICAgICAvKioKICAgICAgKiBXZSBoYXZlIG9uZSBjaGlsZAogICAgICAqLwotICAgIHB1YmxpYyB2b2lkIHNldFZpZXcoVmlldyB2aWV3LCBXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcyBhdHRycywKLSAgICAgICAgICAgIFZpZXcgcGFuZWxQYXJlbnRWaWV3KSB7CisgICAgcHVibGljIHZvaWQgc2V0VmlldyhWaWV3IHZpZXcsIFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zIGF0dHJzLCBWaWV3IHBhbmVsUGFyZW50VmlldykgewogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIGlmIChtVmlldyA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgbVZpZXcgPSB2aWV3OwogICAgICAgICAgICAgICAgIG1XaW5kb3dBdHRyaWJ1dGVzLmNvcHlGcm9tKGF0dHJzKTsKICAgICAgICAgICAgICAgICBhdHRycyA9IG1XaW5kb3dBdHRyaWJ1dGVzOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGVuYWJsZUhhcmR3YXJlQWNjZWxlcmF0aW9uKHZpZXcsIGF0dHJzKTsKK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G1Vc2VHTCkgewotICAgICAgICAgICAgICAgICAgICBkZXN0cm95R0woKTsKKyAgICAgICAgICAgICAgICBpZiAobUh3UmVuZGVyZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtSHdSZW5kZXJlci5kZXN0cm95KCk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKHZpZXdWaXNpYmlsaXR5ID09IFZpZXcuR09ORSkgewpAQCAtODk5LDEwICs3OTUsMTIgQEAKIAogICAgICAgICBmaW5hbCBib29sZWFuIGNvbXB1dGVzSW50ZXJuYWxJbnNldHMgPQogICAgICAgICAgICAgICAgIGF0dGFjaEluZm8ubVRyZWVPYnNlcnZlci5oYXNDb21wdXRlSW50ZXJuYWxJbnNldHNMaXN0ZW5lcnMoKTsKKwogICAgICAgICBib29sZWFuIGluc2V0c1BlbmRpbmcgPSBmYWxzZTsKICAgICAgICAgaW50IHJlbGF5b3V0UmVzdWx0ID0gMDsKLSAgICAgICAgaWYgKG1GaXJzdCB8fCB3aW5kb3dTaG91bGRSZXNpemUgfHwgaW5zZXRzQ2hhbmdlZAotICAgICAgICAgICAgICAgIHx8IHZpZXdWaXNpYmlsaXR5Q2hhbmdlZCB8fCBwYXJhbXMgIT0gbnVsbCkgeworCisgICAgICAgIGlmIChtRmlyc3QgfHwgd2luZG93U2hvdWxkUmVzaXplIHx8IGluc2V0c0NoYW5nZWQgfHwKKyAgICAgICAgICAgICAgICB2aWV3VmlzaWJpbGl0eUNoYW5nZWQgfHwgcGFyYW1zICE9IG51bGwpIHsKIAogICAgICAgICAgICAgaWYgKHZpZXdWaXNpYmlsaXR5ID09IFZpZXcuVklTSUJMRSkgewogICAgICAgICAgICAgICAgIC8vIElmIHRoaXMgd2luZG93IGlzIGdpdmluZyBpbnRlcm5hbCBpbnNldHMgdG8gdGhlIHdpbmRvdwpAQCAtOTE0LDE1ICs4MTIsNyBAQAogICAgICAgICAgICAgICAgIC8vIHdpbmRvdywgd2FpdGluZyB1bnRpbCB3ZSBjYW4gZmluaXNoIGxheWluZyBvdXQgdGhpcyB3aW5kb3cKICAgICAgICAgICAgICAgICAvLyBhbmQgZ2V0IGJhY2sgdG8gdGhlIHdpbmRvdyBtYW5hZ2VyIHdpdGggdGhlIHVsdGltYXRlbHkKICAgICAgICAgICAgICAgICAvLyBjb21wdXRlZCBpbnNldHMuCi0gICAgICAgICAgICAgICAgaW5zZXRzUGVuZGluZyA9IGNvbXB1dGVzSW50ZXJuYWxJbnNldHMKLSAgICAgICAgICAgICAgICAgICAgICAgICYmIChtRmlyc3QgfHwgdmlld1Zpc2liaWxpdHlDaGFuZ2VkKTsKLQotICAgICAgICAgICAgICAgIGlmIChtV2luZG93QXR0cmlidXRlcy5tZW1vcnlUeXBlID09IFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zLk1FTU9SWV9UWVBFX0dQVSkgewotICAgICAgICAgICAgICAgICAgICBpZiAocGFyYW1zID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcyA9IG1XaW5kb3dBdHRyaWJ1dGVzOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG1HbFdhbnRlZCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGluc2V0c1BlbmRpbmcgPSBjb21wdXRlc0ludGVybmFsSW5zZXRzICYmIChtRmlyc3QgfHwgdmlld1Zpc2liaWxpdHlDaGFuZ2VkKTsKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgaWYgKG1TdXJmYWNlSG9sZGVyICE9IG51bGwpIHsKQEAgLTkzMSwxMSArODIxLDEyIEBACiAgICAgICAgICAgICAgICAgbHAuZm9ybWF0ID0gbVN1cmZhY2VIb2xkZXIuZ2V0UmVxdWVzdGVkRm9ybWF0KCk7CiAgICAgICAgICAgICAgICAgbHAudHlwZSA9IG1TdXJmYWNlSG9sZGVyLmdldFJlcXVlc3RlZFR5cGUoKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAotICAgICAgICAgICAgYm9vbGVhbiBpbml0aWFsaXplZCA9IGZhbHNlOworCisgICAgICAgICAgICBib29sZWFuIGh3SW50aWFsaXplZCA9IGZhbHNlOwogICAgICAgICAgICAgYm9vbGVhbiBjb250ZW50SW5zZXRzQ2hhbmdlZCA9IGZhbHNlOwogICAgICAgICAgICAgYm9vbGVhbiB2aXNpYmxlSW5zZXRzQ2hhbmdlZDsKICAgICAgICAgICAgIGJvb2xlYW4gaGFkU3VyZmFjZSA9IG1TdXJmYWNlLmlzVmFsaWQoKTsKKwogICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICBpbnQgZmwgPSAwOwogICAgICAgICAgICAgICAgIGlmIChwYXJhbXMgIT0gbnVsbCkgewpAQCAtOTk1LDkgKzg4Niw4IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBmdWxsUmVkcmF3TmVlZGVkID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgIG1QcmV2aW91c1RyYW5zcGFyZW50UmVnaW9uLnNldEVtcHR5KCk7CiAKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtR2xXYW50ZWQgJiYgIW1Vc2VHTCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaXRpYWxpemVHTCgpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaXRpYWxpemVkID0gbUdsQ2FudmFzICE9IG51bGw7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUh3UmVuZGVyZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGh3SW50aWFsaXplZCA9IG1Id1JlbmRlcmVyLmluaXRpYWxpemUobUhvbGRlcik7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFtU3VyZmFjZS5pc1ZhbGlkKCkpIHsKQEAgLTEwNzUsOSArOTY1LDggQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICAKLSAgICAgICAgICAgIGlmIChpbml0aWFsaXplZCkgewotICAgICAgICAgICAgICAgIG1HbENhbnZhcy5zZXRWaWV3cG9ydCgoaW50KSAobVdpZHRoICogYXBwU2NhbGUgKyAwLjVmKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIChpbnQpIChtSGVpZ2h0ICogYXBwU2NhbGUgKyAwLjVmKSk7CisgICAgICAgICAgICBpZiAoaHdJbnRpYWxpemVkKSB7CisgICAgICAgICAgICAgICAgbUh3UmVuZGVyZXIuc2V0dXAobVdpZHRoLCBtSGVpZ2h0LCBtQXR0YWNoSW5mbyk7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIGJvb2xlYW4gZm9jdXNDaGFuZ2VkRHVlVG9Ub3VjaE1vZGUgPSBlbnN1cmVUb3VjaE1vZGVMb2NhbGx5KApAQCAtMTMzOCw3ICsxMjI3LDggQEAKICAgICAgICAgaWYgKCFzRmlyc3REcmF3Q29tcGxldGUpIHsKICAgICAgICAgICAgIHN5bmNocm9uaXplZCAoc0ZpcnN0RHJhd0hhbmRsZXJzKSB7CiAgICAgICAgICAgICAgICAgc0ZpcnN0RHJhd0NvbXBsZXRlID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8c0ZpcnN0RHJhd0hhbmRsZXJzLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICAgICAgZmluYWwgaW50IGNvdW50ID0gc0ZpcnN0RHJhd0hhbmRsZXJzLnNpemUoKTsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaTwgY291bnQ7IGkrKykgewogICAgICAgICAgICAgICAgICAgICBwb3N0KHNGaXJzdERyYXdIYW5kbGVycy5nZXQoaSkpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KQEAgLTEzNzIsNTMgKzEyNjIsMTYgQEAKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogICAgICAgICAKLSAgICAgICAgaWYgKG1Vc2VHTCkgeworICAgICAgICBpZiAobUh3UmVuZGVyZXIgIT0gbnVsbCAmJiBtSHdSZW5kZXJlci5pc0VuYWJsZWQoKSkgewogICAgICAgICAgICAgaWYgKCFkaXJ0eS5pc0VtcHR5KCkpIHsKLSAgICAgICAgICAgICAgICBDYW52YXMgY2FudmFzID0gbUdsQ2FudmFzOwotICAgICAgICAgICAgICAgIGlmIChtR0wgIT0gbnVsbCAmJiBjYW52YXMgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBtR0wuZ2xEaXNhYmxlKEdMX1NDSVNTT1JfVEVTVCk7Ci0gICAgICAgICAgICAgICAgICAgIG1HTC5nbENsZWFyQ29sb3IoMCwgMCwgMCwgMCk7Ci0gICAgICAgICAgICAgICAgICAgIG1HTC5nbENsZWFyKEdMX0NPTE9SX0JVRkZFUl9CSVQpOwotICAgICAgICAgICAgICAgICAgICBtR0wuZ2xFbmFibGUoR0xfU0NJU1NPUl9URVNUKTsKLQotICAgICAgICAgICAgICAgICAgICBtQXR0YWNoSW5mby5tRHJhd2luZ1RpbWUgPSBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKTsKLSAgICAgICAgICAgICAgICAgICAgbUF0dGFjaEluZm8ubUlnbm9yZURpcnR5U3RhdGUgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICBtVmlldy5tUHJpdmF0ZUZsYWdzIHw9IFZpZXcuRFJBV047Ci0KLSAgICAgICAgICAgICAgICAgICAgaW50IHNhdmVDb3VudCA9IGNhbnZhcy5zYXZlKENhbnZhcy5NQVRSSVhfU0FWRV9GTEFHKTsKLSAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMCwgLXlvZmYpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1UcmFuc2xhdG9yICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVHJhbnNsYXRvci50cmFuc2xhdGVDYW52YXMoY2FudmFzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGNhbnZhcy5zZXRTY3JlZW5EZW5zaXR5KHNjYWxpbmdSZXF1aXJlZAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IERpc3BsYXlNZXRyaWNzLkRFTlNJVFlfREVWSUNFIDogMCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtVmlldy5kcmF3KGNhbnZhcyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoQ29uZmlnLkRFQlVHICYmIFZpZXdEZWJ1Zy5jb25zaXN0ZW5jeUNoZWNrRW5hYmxlZCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1WaWV3LmRpc3BhdGNoQ29uc2lzdGVuY3lDaGVjayhWaWV3RGVidWcuQ09OU0lTVEVOQ1lfRFJBV0lORyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMucmVzdG9yZVRvQ291bnQoc2F2ZUNvdW50KTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIG1BdHRhY2hJbmZvLm1JZ25vcmVEaXJ0eVN0YXRlID0gZmFsc2U7Ci0KLSAgICAgICAgICAgICAgICAgICAgbUVnbC5lZ2xTd2FwQnVmZmVycyhtRWdsRGlzcGxheSwgbUVnbFN1cmZhY2UpOwotICAgICAgICAgICAgICAgICAgICBjaGVja0VnbEVycm9ycygpOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChTSE9XX0ZQUyB8fCBDb25maWcuREVCVUcgJiYgVmlld0RlYnVnLnNob3dGcHMpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCBub3cgPSAoaW50KVN5c3RlbUNsb2NrLmVsYXBzZWRSZWFsdGltZSgpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNEcmF3VGltZSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlU2hvd0ZQUyhjYW52YXMsIG5vdyAtIHNEcmF3VGltZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBzRHJhd1RpbWUgPSBub3c7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbUh3UmVuZGVyZXIuZHJhdyhtVmlldywgbUF0dGFjaEluZm8sIG1UcmFuc2xhdG9yLCB5b2ZmLCBzY2FsaW5nUmVxdWlyZWQpOwogICAgICAgICAgICAgfQorCiAgICAgICAgICAgICBpZiAoc2Nyb2xsaW5nKSB7CiAgICAgICAgICAgICAgICAgbUZ1bGxSZWRyYXdOZWVkZWQgPSB0cnVlOwogICAgICAgICAgICAgICAgIHNjaGVkdWxlVHJhdmVyc2FscygpOwogICAgICAgICAgICAgfQorCiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KIApAQCAtMTczMCw4ICsxNTgzLDYgQEAKICAgICB9CiAKICAgICB2b2lkIGRpc3BhdGNoRGV0YWNoZWRGcm9tV2luZG93KCkgewotICAgICAgICBpZiAoQ29uZmlnLkxPR1YpIExvZy52KCJWaWV3Um9vdCIsICJEZXRhY2hpbmcgaW4gIiArIHRoaXMgKyAiIG9mICIgKyBtU3VyZmFjZSk7Ci0KICAgICAgICAgaWYgKG1WaWV3ICE9IG51bGwpIHsKICAgICAgICAgICAgIG1WaWV3LmRpc3BhdGNoRGV0YWNoZWRGcm9tV2luZG93KCk7CiAgICAgICAgIH0KQEAgLTE3NDAsOCArMTU5MSw4IEBACiAgICAgICAgIG1BdHRhY2hJbmZvLm1Sb290VmlldyA9IG51bGw7CiAgICAgICAgIG1BdHRhY2hJbmZvLm1TdXJmYWNlID0gbnVsbDsKIAotICAgICAgICBpZiAobVVzZUdMKSB7Ci0gICAgICAgICAgICBkZXN0cm95R0woKTsKKyAgICAgICAgaWYgKG1Id1JlbmRlcmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1Id1JlbmRlcmVyLmRlc3Ryb3koKTsKICAgICAgICAgfQogICAgICAgICBtU3VyZmFjZS5yZWxlYXNlKCk7CiAKQEAgLTE4NzIsOCArMTcyMywxMCBAQAogICAgICAgICAgICAgICAgIGV2ZW50ID0gZ2V0UGVuZGluZ1BvaW50ZXJNb3Rpb25FdmVudCgpOwogCiAgICAgICAgICAgICAgICAgaWYgKE1FQVNVUkVfTEFURU5DWSAmJiBldmVudCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGx0LnNhbXBsZSgiOSBDbGllbnQgZ290IGV2ZW50cyAgICAgICIsIFN5c3RlbS5uYW5vVGltZSgpIC0gZXZlbnQuZ2V0RXZlbnRUaW1lTmFubygpKTsKLSAgICAgICAgICAgICAgICAgICAgbHQuc2FtcGxlKCI4IENsaWVudCBnZXR0aW5nIGV2ZW50cyAgIiwgdGltZUJlZm9yZUdldHRpbmdFdmVudHMgLSBldmVudC5nZXRFdmVudFRpbWVOYW5vKCkpOworICAgICAgICAgICAgICAgICAgICBsdC5zYW1wbGUoIjkgQ2xpZW50IGdvdCBldmVudHMgICAgICAiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5uYW5vVGltZSgpIC0gZXZlbnQuZ2V0RXZlbnRUaW1lTmFubygpKTsKKyAgICAgICAgICAgICAgICAgICAgbHQuc2FtcGxlKCI4IENsaWVudCBnZXR0aW5nIGV2ZW50cyAgIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lQmVmb3JlR2V0dGluZ0V2ZW50cyAtIGV2ZW50LmdldEV2ZW50VGltZU5hbm8oKSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGNhbGxXaGVuRG9uZSA9IGZhbHNlOwogICAgICAgICAgICAgfQpAQCAtMTg5NiwxMSArMTc0OSwxMyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQub2Zmc2V0TG9jYXRpb24oMCwgbUN1clNjcm9sbFkpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGlmIChNRUFTVVJFX0xBVEVOQ1kpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGx0LnNhbXBsZSgiQSBEaXNwYXRjaGluZyBUb3VjaEV2ZW50cyIsIFN5c3RlbS5uYW5vVGltZSgpIC0gZXZlbnQuZ2V0RXZlbnRUaW1lTmFubygpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGx0LnNhbXBsZSgiQSBEaXNwYXRjaGluZyBUb3VjaEV2ZW50cyIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5uYW5vVGltZSgpIC0gZXZlbnQuZ2V0RXZlbnRUaW1lTmFubygpKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBoYW5kbGVkID0gbVZpZXcuZGlzcGF0Y2hUb3VjaEV2ZW50KGV2ZW50KTsKICAgICAgICAgICAgICAgICAgICAgaWYgKE1FQVNVUkVfTEFURU5DWSkgewotICAgICAgICAgICAgICAgICAgICAgICAgbHQuc2FtcGxlKCJCIERpc3BhdGNoZWQgVG91Y2hFdmVudHMgIiwgU3lzdGVtLm5hbm9UaW1lKCkgLSBldmVudC5nZXRFdmVudFRpbWVOYW5vKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgbHQuc2FtcGxlKCJCIERpc3BhdGNoZWQgVG91Y2hFdmVudHMgIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3lzdGVtLm5hbm9UaW1lKCkgLSBldmVudC5nZXRFdmVudFRpbWVOYW5vKCkpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGlmICghaGFuZGxlZCAmJiBpc0Rvd24pIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGludCBlZGdlU2xvcCA9IG1WaWV3Q29uZmlndXJhdGlvbi5nZXRTY2FsZWRFZGdlU2xvcCgpOwpAQCAtMjAwNSwxOCArMTg2MCw4IEBACiAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gaW5Ub3VjaE1vZGUgPSBtc2cuYXJnMiAhPSAwOwogICAgICAgICAgICAgICAgICAgICBlbnN1cmVUb3VjaE1vZGVMb2NhbGx5KGluVG91Y2hNb2RlKTsKIAotICAgICAgICAgICAgICAgICAgICBpZiAobUdsV2FudGVkKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjaGVja0VnbEVycm9ycygpOwotICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2UgbG9zdCB0aGUgZ2wgY29udGV4dCwgc28gcmVjcmVhdGUgaXQuCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobUdsV2FudGVkICYmICFtVXNlR0wpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbml0aWFsaXplR0woKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUdsQ2FudmFzICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgYXBwU2NhbGUgPSBtQXR0YWNoSW5mby5tQXBwbGljYXRpb25TY2FsZTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUdsQ2FudmFzLnNldFZpZXdwb3J0KAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpbnQpIChtV2lkdGggKiBhcHBTY2FsZSArIDAuNWYpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpbnQpIChtSGVpZ2h0ICogYXBwU2NhbGUgKyAwLjVmKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAobUh3UmVuZGVyZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbUh3UmVuZGVyZXIuaW5pdGlhbGl6ZUlmTmVlZGVkKG1XaWR0aCwgbUhlaWdodCwgbUF0dGFjaEluZm8sIG1Ib2xkZXIpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogCkBAIC0yMDY2LDggKzE5MTEsNyBAQAogICAgICAgICAgICAgaWYgKChldmVudC5nZXRGbGFncygpJktleUV2ZW50LkZMQUdfRlJPTV9TWVNURU0pICE9IDApIHsKICAgICAgICAgICAgICAgICAvLyBUaGUgSU1FIGlzIHRyeWluZyB0byBzYXkgdGhpcyBldmVudCBpcyBmcm9tIHRoZQogICAgICAgICAgICAgICAgIC8vIHN5c3RlbSEgIEJhZCBiYWQgYmFkIQotICAgICAgICAgICAgICAgIGV2ZW50ID0gS2V5RXZlbnQuY2hhbmdlRmxhZ3MoZXZlbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICBldmVudC5nZXRGbGFncygpJn5LZXlFdmVudC5GTEFHX0ZST01fU1lTVEVNKTsKKyAgICAgICAgICAgICAgICBldmVudCA9IEtleUV2ZW50LmNoYW5nZUZsYWdzKGV2ZW50LCBldmVudC5nZXRGbGFncygpICYgfktleUV2ZW50LkZMQUdfRlJPTV9TWVNURU0pOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgZGVsaXZlcktleUV2ZW50VG9WaWV3SGllcmFyY2h5KChLZXlFdmVudCltc2cub2JqLCBmYWxzZSk7CiAgICAgICAgIH0gYnJlYWs7CkBAIC0yNTU1LDggKzIzOTksNyBAQAogICAgIHByaXZhdGUgdm9pZCBkZWxpdmVyS2V5RXZlbnQoS2V5RXZlbnQgZXZlbnQsIGJvb2xlYW4gc2VuZERvbmUpIHsKICAgICAgICAgLy8gSWYgbVZpZXcgaXMgbnVsbCwgd2UganVzdCBjb25zdW1lIHRoZSBrZXkgZXZlbnQgYmVjYXVzZSBpdCBkb2Vzbid0CiAgICAgICAgIC8vIG1ha2Ugc2Vuc2UgdG8gZG8gYW55dGhpbmcgZWxzZSB3aXRoIGl0LgotICAgICAgICBib29sZWFuIGhhbmRsZWQgPSBtVmlldyAhPSBudWxsCi0gICAgICAgICAgICAgICAgPyBtVmlldy5kaXNwYXRjaEtleUV2ZW50UHJlSW1lKGV2ZW50KSA6IHRydWU7CisgICAgICAgIGJvb2xlYW4gaGFuZGxlZCA9IG1WaWV3ID09IG51bGwgfHwgbVZpZXcuZGlzcGF0Y2hLZXlFdmVudFByZUltZShldmVudCk7CiAgICAgICAgIGlmIChoYW5kbGVkKSB7CiAgICAgICAgICAgICBpZiAoc2VuZERvbmUpIHsKICAgICAgICAgICAgICAgICBpZiAoTE9DQUxfTE9HVikgTG9nLnYoCkBAIC0yNTkwLDcgKzI0MzMsNiBAQAogICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBzZW5kRG9uZSA9IHNlcSA+PSAwOwogICAgICAgICAgICAgaWYgKCFoYW5kbGVkKSB7CiAgICAgICAgICAgICAgICAgZGVsaXZlcktleUV2ZW50VG9WaWV3SGllcmFyY2h5KGV2ZW50LCBzZW5kRG9uZSk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfSBlbHNlIGlmIChzZW5kRG9uZSkgewogICAgICAgICAgICAgICAgIGlmIChMT0NBTF9MT0dWKSBMb2cudigKICAgICAgICAgICAgICAgICAgICAgICAgICJWaWV3Um9vdCIsICJUZWxsaW5nIHdpbmRvdyBtYW5hZ2VyIGtleSBpcyBmaW5pc2hlZCIpOwpAQCAtMjc5MSw3ICsyNjMzLDcgQEAKIAogICAgIHZvaWQgZG9EaWUoKSB7CiAgICAgICAgIGNoZWNrVGhyZWFkKCk7Ci0gICAgICAgIGlmIChDb25maWcuTE9HVikgTG9nLnYoIlZpZXdSb290IiwgIkRJRSBpbiAiICsgdGhpcyArICIgb2YgIiArIG1TdXJmYWNlKTsKKyAgICAgICAgaWYgKExPQ0FMX0xPR1YpIExvZy52KCJWaWV3Um9vdCIsICJESUUgaW4gIiArIHRoaXMgKyAiIG9mICIgKyBtU3VyZmFjZSk7CiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgaWYgKG1BZGRlZCAmJiAhbUZpcnN0KSB7CiAgICAgICAgICAgICAgICAgaW50IHZpZXdWaXNpYmlsaXR5ID0gbVZpZXcuZ2V0VmlzaWJpbGl0eSgpOwpAQCAtMjg5OSwxMyArMjc0MSwxMiBAQAogICAgICAgICBpZiAoZXZlbnQuZ2V0QWN0aW9uKCkgPT0gS2V5RXZlbnQuQUNUSU9OX0RPV04pIHsKICAgICAgICAgICAgIC8vbm9pbnNwZWN0aW9uIENvbnN0YW50Q29uZGl0aW9ucwogICAgICAgICAgICAgaWYgKGZhbHNlICYmIGV2ZW50LmdldEtleUNvZGUoKSA9PSBLZXlFdmVudC5LRVlDT0RFX0NBTUVSQSkgewotICAgICAgICAgICAgICAgIGlmIChDb25maWcuTE9HRCkgTG9nLmQoImtleWRpc3AiLAotICAgICAgICAgICAgICAgICAgICAgICAgIj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSIpOwotICAgICAgICAgICAgICAgIGlmIChDb25maWcuTE9HRCkgTG9nLmQoImtleWRpc3AiLCAiRm9jdXNlZCB2aWV3IEhpZXJhcmNoeSBpczoiKTsKKyAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZCgia2V5ZGlzcCIsICI9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0iKTsKKyAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZCgia2V5ZGlzcCIsICJGb2N1c2VkIHZpZXcgSGllcmFyY2h5IGlzOiIpOworCiAgICAgICAgICAgICAgICAgZGVidWcoKTsKIAotICAgICAgICAgICAgICAgIGlmIChDb25maWcuTE9HRCkgTG9nLmQoImtleWRpc3AiLAotICAgICAgICAgICAgICAgICAgICAgICAgIj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSIpOworICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKCJrZXlkaXNwIiwgIj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSIpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKQEAgLTM1NTgsOCArMzM5OSw0IEBACiAgICAgfQogCiAgICAgcHJpdmF0ZSBzdGF0aWMgbmF0aXZlIHZvaWQgbmF0aXZlU2hvd0ZQUyhDYW52YXMgY2FudmFzLCBpbnQgZHVyYXRpb25NaWxsaXMpOwotCi0gICAgLy8gaW5mb3JtIHNraWEgdG8ganVzdCBhYmFuZG9uIGl0cyB0ZXh0dXJlIGNhY2hlIElEcwotICAgIC8vIGRvZXNuJ3QgY2FsbCBnbERlbGV0ZVRleHR1cmVzCi0gICAgcHJpdmF0ZSBzdGF0aWMgbmF0aXZlIHZvaWQgbmF0aXZlQWJhbmRvbkdsQ2FjaGVzKCk7CiB9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC92aWV3L1dpbmRvdy5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvdmlldy9XaW5kb3cuamF2YQppbmRleCBmNDA3MzRiLi45YjMxYjljIDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC92aWV3L1dpbmRvdy5qYXZhCisrKyBiL2NvcmUvamF2YS9hbmRyb2lkL3ZpZXcvV2luZG93LmphdmEKQEAgLTYxLDYgKzYxLDEzIEBACiAgICAgICAgIEBoaWRlCiAgICAgKi8KICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGRUFUVVJFX09QRU5HTCA9IDg7CisgICAgLyoqCisgICAgICogRmxhZyBmb3IgZW5hYmxpbmcgdGhlIEFjdGlvbiBCYXIuCisgICA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GhhdmUgbm8gYWNjZXNzaWJpbGl0eQorICogc2NyaXB0IHRvIGluamVjdC4KKyAqLworY2xhc3MgQWNjZXNzaWJpbGl0eUluamVjdG9yIHsKKworICAgIC8vIEhhbmRsZSB0byB0aGUgV2ViVmlldyB0aGlzIGluamVjdG9yIGlzIGFzc29jaWF0ZWQgd2l0aC4KKyAgICBwcml2YXRlIGZpbmFsIFdlYlZpZXcgbVdlYlZpZXc7CisKKyAgICAvKioKKyAgICAgKiBDcmVhdGVzIGEgbmV3IGluamVjdG9yIGFzc29jaWF0ZWQgd2l0aCBhIGdpdmVuIFZ3ZWJWaWV3LgorICAgICAqCisgICAgICogQHBhcmFtIHdlYlZpZXcgVGhlIGFzc29jaWF0ZWQgV2ViVmlldy4KKyAgICAgKi8KKyAgICBwdWJsaWMgQWNjZXNzaWJpbGl0eUluamVjdG9yKFdlYlZpZXcgd2ViVmlldykgeworICAgICAgICBtV2ViVmlldyA9IHdlYlZpZXc7CisgICAgfQorCisgICAgLyoqCisgICAgICogUHJvY2Vzc2VzIGEga2V5IGRvd24gPGNvZGU+ZXZlbnQ8L2NvZGU+LgorICAgICAqCisgICAgICogQHJldHVybiBUcnVlIGlmIHRoZSBldmVudCB3YXMgcHJvY2Vzc2VkLgorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIG9uS2V5RXZlbnQoS2V5RXZlbnQgZXZlbnQpIHsKKworICAgICAgICAvLyBhcyBhIHByb29mIG9mIGNvbmNlcHQgbGV0IHVzIGRvIHRoZSBzaW1wbGVzdCBleGFtcGxlCisKKyAgICAgICAgaWYgKGV2ZW50LmdldEFjdGlvbigpICE9IEtleUV2ZW50LkFDVElPTl9VUCkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgaW50IGtleUNvZGUgPSBldmVudC5nZXRLZXlDb2RlKCk7CisKKyAgICAgICAgc3dpdGNoIChrZXlDb2RlKSB7CisgICAgICAgICAgICBjYXNlIEtleUV2ZW50L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oYW5kbGluZyBXZWJDb3JlIC0+IFVJIHRocmVhZCBtZXNzYWdpbmcuIEFsbApAQCAtNTAwLDE4ICs1MDIsMzIgQEAKICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHVybCA9IG1zZy5nZXREYXRhKCkuZ2V0U3RyaW5nKCJ1cmwiKTsKICAgICAgICAgICAgICAgICAgICAgaWYgKCFtV2ViQ2hyb21lQ2xpZW50Lm9uSnNBbGVydChtV2ViVmlldywgdXJsLCBtZXNzYWdlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9ubHkgZGlzcGxheSB0aGUgYWxlcnQgZGlhbG9nIGlmIHRoZSBtQ29udGV4dCBpcworICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWN0aXZpdHkgYW5kIGl0cyB3aW5kb3cgaGFzIHRoZSBmb2N1cy4KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghKG1Db250ZXh0IGluc3RhbmNlb2YgQWN0aXZpdHkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICEoKEFjdGl2aXR5KSBtQ29udGV4dCkuaGFzV2luZG93Rm9jdXMoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcy5jYW5jZWwoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXMuc2V0UmVhZHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBBbGVydERpYWxvZy5CdWlsZGVyKG1Db250ZXh0KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc2V0VGl0bGUoZ2V0SnNEaWFsb2dUaXRsZSh1cmwpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc2V0TWVzc2FnZShtZXNzYWdlKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc2V0UG9zaXRpdmVCdXR0b24oUi5zdHJpbmcub2ssCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEFsZXJ0RGlhbG9nLk9uQ2xpY2tMaXN0ZW5lcigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgRGlhbG9nSW50ZXJmYWNlLk9uQ2xpY2tMaXN0ZW5lcigpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25DbGljaygKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEaWFsb2dJbnRlcmZhY2UgZGlhbG9nLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB3aGljaCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzLmNvbmZpcm0oKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRDYW5jZWxhYmxlKGZhbHNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc2V0T25DYW5jZWxMaXN0ZW5lcigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgRGlhbG9nSW50ZXJmYWNlLk9uQ2FuY2VsTGlzdGVuZXIoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2FuY2VsKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERpYWxvZ0ludGVyZmFjZSBkaWFsb2cpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcy5jYW5jZWwoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zaG93KCk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgcmVzLnNldFJlYWR5KCk7CkBAIC01MjUsNiArNTQxLDE0IEBACiAgICAgICAgICAgICAgICAgICAgIFN0cmluZyB1cmwgPSBtc2cuZ2V0RGF0YSgpLmdldFN0cmluZygidXJsIik7CiAgICAgICAgICAgICAgICAgICAgIGlmICghbVdlYkNocm9tZUNsaWVudC5vbkpzQ29uZmlybShtV2ViVmlldywgdXJsLCBtZXNzYWdlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9ubHkgZGlzcGxheSB0aGUgYWxlcnQgZGlhbG9nIGlmIHRoZSBtQ29udGV4dCBpcworICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWN0aXZpdHkgYW5kIGl0cyB3aW5kb3cgaGFzIHRoZSBmb2N1cy4KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghKG1Db250ZXh0IGluc3RhbmNlb2YgQWN0aXZpdHkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICEoKEFjdGl2aXR5KSBtQ29udGV4dCkuaGFzV2luZG93Rm9jdXMoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcy5jYW5jZWwoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXMuc2V0UmVhZHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBBbGVydERpYWxvZy5CdWlsZGVyKG1Db250ZXh0KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc2V0VGl0bGUoZ2V0SnNEaWFsb2dUaXRsZSh1cmwpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc2V0TWVzc2FnZShtZXNzYWdlKQpAQCAtNTY1LDYgKzU4OSwxNCBAQAogICAgICAgICAgICAgICAgICAgICBTdHJpbmcgdXJsID0gbXNnLmdldERhdGEoKS5nZXRTdHJpbmcoInVybCIpOwogICAgICAgICAgICAgICAgICAgICBpZiAoIW1XZWJDaHJvbWVDbGllbnQub25Kc1Byb21wdChtV2ViVmlldywgdXJsLCBtZXNzYWdlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsLCByZXMpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBvbmx5IGRpc3BsYXkgdGhlIGFsZXJ0IGRpYWxvZyBpZiB0aGUgbUNvbnRleHQgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIEFjdGl2aXR5IGFuZCBpdHMgd2luZG93IGhhcyB0aGUgZm9jdXMuCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIShtQ29udGV4dCBpbnN0YW5jZW9mIEFjdGl2aXR5KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAhKChBY3Rpdml0eSkgbUNvbnRleHQpLmhhc1dpbmRvd0ZvY3VzKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXMuY2FuY2VsKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzLnNldFJlYWR5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBMYXlvdXRJbmZsYXRlciBmYWN0b3J5ID0gTGF5b3V0SW5mbGF0ZXIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmZyb20obUNvbnRleHQpOwogICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgVmlldyB2aWV3ID0gZmFjdG9yeS5pbmZsYXRlKFIubGF5b3V0LmpzX3Byb21wdCwKQEAgLTYxNiw2ICs2NDgsMTQgQEAKICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHVybCA9IG1zZy5nZXREYXRhKCkuZ2V0U3RyaW5nKCJ1cmwiKTsKICAgICAgICAgICAgICAgICAgICAgaWYgKCFtV2ViQ2hyb21lQ2xpZW50Lm9uSnNCZWZvcmVVbmxvYWQobVdlYlZpZXcsIHVybCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlLCByZXMpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBvbmx5IGRpc3BsYXkgdGhlIGFsZXJ0IGRpYWxvZyBpZiB0aGUgbUNvbnRleHQgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIEFjdGl2aXR5IGFuZCBpdHMgd2luZG93IGhhcyB0aGUgZm9jdXMuCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIShtQ29udGV4dCBpbnN0YW5jZW9mIEFjdGl2aXR5KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAhKChBY3Rpdml0eSkgbUNvbnRleHQpLmhhc1dpbmRvd0ZvY3VzKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXMuY2FuY2VsKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzLnNldFJlYWR5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgbSA9IG1Db250ZXh0LmdldFN0cmluZygKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUi5zdHJpbmcuanNfZGlhbG9nX2JlZm9yZV91bmxvYWQsIG1lc3NhZ2UpOwog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3MoKSBuZWVkcyBpdAorICAgICAgICAgICAgaWYgKG1MYXRlc3RQcm9ncmVzcyA9PSBuZXdQcm9ncmVzcykgewogICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIG1MYXRlc3RQcm9ncmVzcyA9IG5ld1Byb2dyZXNzOworICAgICAgICAgICAgaWYgKG1XZWJDaHJvbWVDbGllbnQgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmICghbVByb2dyZXNzVXBkYXRlUGVuZGluZykgewogICAgICAgICAgICAgICAgIHNlbmRFbXB0eU1lc3NhZ2UoUFJPR1JFU1MpOwogICAgICAgICAgICAgICAgIG1Qcm9ncmVzc1VwZGF0ZVBlbmRpbmcgPSB0cnVlOwpAQCAtMTA5OCw3ICsxMTQ0LDcgQEAKICAgICAgICAgfQogICAgIH0KIAotICAgIHB1YmxpYyBXZWJWaWV3IGNyZWF0ZVdpbmRvdyhib29sZWFuIGRpYWxvZywgYm9vbGVhbiB1c2VyR2VzdHVyZSkgeworICAgIHB1YmxpYyBCcm93c2VyRnJhbWUgY3JlYXRlV2luZG93KGJvb2xlYW4gZGlhbG9nLCBib29sZWFuIHVzZXJHZXN0dXJlKSB7CiAgICAgICAgIC8vIERvIGFuIHVuc3luY2hyb25pemVkIHF1aWNrIGNoZWNrIHRvIGF2b2lkIHBvc3RpbmcgaWYgbm8gY2FsbGJhY2sgaGFzCiAgICAgICAgIC8vIGJlZW4gc2V0LgogICAgICAgICBpZiAobVdlYkNocm9tZUNsaWVudCA9PSBudWxsKSB7CkBAIC0xMTIyLDkgKzExNjgsMTUgQEAKIAogICAgICAgICBXZWJWaWV3IHcgPSB0cmFuc3BvcnQuZ2V0V2ViVmlldygpOwogICAgICAgICBpZiAodyAhPSBudWxsKSB7Ci0gICAgICAgICAgICB3LmdldFdlYlZpZXdDb3JlKCkuaW5pdGlhbGl6ZVN1Yndpbm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KKyAgICAgICAgICAgICAgICAvLyBDaGVjayB0aGF0IHRoZSBwcm92aWRlcnMgYXJlIHN0aWxsIGF2YWlsYWJsZSBhZnRlciB3ZSByZS1yZWdpc3Rlci4KKyAgICAgICAgICAgICAgICBtYXliZVJlcG9ydEVycm9yKCJUaGUgbGFzdCBsb2NhdGlvbiBwcm92aWRlciBpcyBubyBsb25nZXIgYXZhaWxhYmxlIik7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CkBAIC0xNTYsMTEgKzE1OSwxNiBAQAogICAgICAqLwogICAgIHByaXZhdGUgdm9pZCByZWdpc3RlckZvckxvY2F0aW9uVXBkYXRlcygpIHsKICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIG1Mb2NhdGlvbk1hbmFnZXIucmVxdWVzdExvY2F0aW9uVXBkYXRlcyhMb2NhdGlvbk1hbmFnZXIuTkVUV09SS19QUk9WSURFUiwgMCwgMCwgdGhpcyk7Ci0gICAgICAgICAgICBtSXNOZXR3b3JrUHJvdmlkZXJBdmFpbGFibGUgPSB0cnVlOworICAgICAgICAgICAgLy8gUmVnaXN0cmF0aW9uIG1heSBmYWlsIGlmIHByb3ZpZGVycyBhcmUgbm90IHByZXNlbnQgb24gdGhlIGRldmljZS4KKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgbUxvY2F0aW9uTWFuYWdlci5yZXF1ZXN0TG9jYXRpb25VcGRhdGVzKExvY2F0aW9uTWFuYWdlci5ORVRXT1JLX1BST1ZJREVSLCAwLCAwLCB0aGlzKTsKKyAgICAgICAgICAgICAgICBtSXNOZXR3b3JrUHJvdmlkZXJBdmFpbGFibGUgPSB0cnVlOworICAgICAgICAgICAgfSBjYXRjaChJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24gZSkgeyB9CiAgICAgICAgICAgICBpZiAobUlzR3BzRW5hYmxlZCkgewotICAgICAgICAgICAgICAgIG1Mb2NhdGlvbk1hbmFnZXIucmVxdWVzdExvY2F0aW9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ZSBzdGF0aWMgZmluYWwgaW50IFRJTUVVUERBVEVfUEVSSU9EID0gMjUwOyAgLy8gbXMKKyAgICAvLyBUaGUgdGltZXIgZm9yIHRpbWV1cGF0ZSBldmVudHMuCisgICAgLy8gU2VlIGh0dHA6Ly93d3cud2hhdHdnLm9yZy9zcGVjcy93ZWItYXBwcy9jdXJyZW50LXdvcmsvI2V2ZW50LW1lZGlhLXRpbWV1cGRhdGUKKyAgICBwcml2YXRlIFRpbWVyIG1UaW1lcjsKKyAgICBwcml2YXRlIGZpbmFsIGNsYXNzIFRpbWV1cGRhdGVUYXNrIGV4dGVuZHMgVGltZXJUYXNrIHsKKyAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgSFRNTDVBdWRpby50aGlzLm9idGFpbk1lc3NhZ2UoVElNRVVQREFURSkuc2VuZFRvVGFyZ2V0KCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBoYW5kbGVNZXNzYWdlKE1lc3NhZ2UgbXNnKSB7CisgICAgICAgIHN3aXRjaCAobXNnLndoYXQpIHsKKyAgICAgICAgICAgIGNhc2UgVElNRVVQREFURTogeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChtU3RhdGUgIT0gRVJST1IgJiYgbU1lZGlhUGxheWVyLmlzUGxheWluZygpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgcG9zaXRpb24gPSBtTWVkaWFQbGF5ZXIuZ2V0Q3VycmVudFBvc2l0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVPblRpbWV1cGRhdGUocG9zaXRpb24sIG1OYXRpdmVQb2ludGVyKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIG1TdGF0ZSA9IEVSUk9SOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8vIGV2ZW50IGxpc3RlbmVycyBmb3IgTWVkaWFQbGF5ZXIKKyAgICAvLyBUaG9zZSBhcmUgY2FsbGVkIGZyb20gdGhlIHNhbWUgdGhyZWFkIHdlIGNyZWF0ZWQgdGhlIE1lZGlhUGxheWVyCisgICAgLy8gKGkuZS4gdGhlIHdlYnZpZXdjb3JlIHRocmVhZCBoZXJlKQorCisgICAgLy8gTWVkaWFQbGF5ZXIuT25CdWZmZXJpbmdVcGRhdGVMaXN0ZW5lcgorICAgIHB1YmxpYyB2b2lkIG9uQnVmZmVyaW5nVXBkYXRlKE1lZGlhUGxheWVyIG1wLCBpbnQgcGVyY2VudCkgeworICAgICAgICBuYXRpdmVPbkJ1ZmZlcmluZyhwZXJjZW50LCBtTmF0aXZlUG9pbnRlcik7CisgICAgfQorCisgICAgLy8gTWVkaWFQbGF5ZXIuT25Db21wbGV0aW9uTGlzdGVuZXI7CisgICAgcHVibGljIHZvaWQgb25Db21wbGV0aW9uKE1lZGlhUGxheWVyIG1wKSB7CisgICAgICAgIHJlc2V0TWVkaWFQbGF5ZXIoKTsKKyAgICAgICAgbVN0YXRlID0gSURMRTsKKyAgICAgICAgbmF0aXZlT25FbmRlZChtTmF0aXZlUG9pbnRlcik7CisgICAgfQorCisgICAgLy8gTWVkaWFQbGF5ZXIuT25FcnJvckxpc3RlbmVyCisgICAgcHVibGljIGJvb2xlYW4gb25FcnJvcihNZWRpYVBsYXllciBtcCwgaW50IHdoYXQsIGludCBleHRyYSkgeworICAgICAgICBtU3RhdGUgPSBFUlJPUjsKKyAgICAgICAgcmVzZXRNZWRpYVBsYXllcigpOworICAgICAgICBtU3RhdGUgPSBJRExFOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgLy8gTWVkaWFQbGF5ZXIuT25QcmVwYXJlZExpc3RlbmVyCisgICAgcHVibGljIHZvaWQgb25QcmVwYXJlZChNZWRpYVBsYXllciBtcCkgeworICAgICAgICBtU3RhdGUgPSBQUkVQQVJFRDsKKyAgICAgICAgaWYgKG1UaW1lciAhPSBudWxsKSB7CisgICAgICAgICAgICBtVGltZXIuc2NoZWR1bGUobmV3IFRpbWV1cGRhdGVUYXNrKCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVElNRVVQREFURV9QRVJJT0QsIFRJTUVVUERBVEVfUEVSSU9EKTsKKyAgICAgICAgfQorICAgICAgICBuYXRpdmVPblByZXBhcmVkKG1wLmdldER1cmF0aW9uKCksIDAsIDAsIG1OYXRpdmVQb2ludGVyKTsKKyAgICAgICAgaWYgKG1Bc2tUb1BsYXkpIHsKKyAgICAgICAgICAgIG1Bc2tUb1BsYXkgPSBmYWxzZTsKKyAgICAgICAgICAgIHBsYXkoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8vIE1lZGlhUGxheWVyLk9uU2Vla0NvbXBsZXRlTGlzdGVuZXIKKyAgICBwdWJsaWMgdm9pZCBvblNlZWtDb21wbGV0ZShNZWRpYVBsYXllciBtcCkgeworICAgICAgICBuYXRpdmVPblRpbWV1cGRhdGUobXAuZ2V0Q3VycmVudFBvc2l0aW9uKCksIG1OYXRpdmVQb2ludGVyKTsKKyAgICB9CisKKworICAgIC8qKgorICAgICAqIEBwYXJhbSBuYXRpdmVQdHIgaXMgdGhlIEMrKyBwb2ludGVyIHRvIHRoZSBNZWRpYVBsYXllclByaXZhdGUgb2JqZWN0LgorICAgICAqLworICAgIHB1YmxpYyBIVE1MNUF1ZGlvKGludCBuYXRpdmVQdHIpIHsKKyAgICAgICAgLy8gU2F2ZSB0aGUgbmF0aXZlIHB0cgorICAgICAgICBtTmF0aXZlUG9pbnRlciA9IG5hdGl2ZVB0cjsKKyAgICAgICAgcmVzZXRNZWRpYVBsYXllcigpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCByZXNldE1lZGlhUGxheWVyKCkgeworICAgICAgICBpZiAobU1lZGlhUGxheWVyID09IG51bGwpIHsKKyAgICAgICAgICAgIG1NZWRpYVBsYXllciA9IG5ldyBNZWRpYVBsYXllcigpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbU1lZGlhUGxheWVyLnJlc2V0KCk7CisgICAgICAgIH0KKyAgICAgICAgbU1lZGlhUGxheWVyLnNldE9uQnVmZmVyaW5nVXBkYXRlTGlzdGVuZXIodGhpcyk7CisgICAgICAgIG1NZWRpYVBsYXllci5zZXRPbkNvbXBsZXRpb25MaXN0ZW5lcih0aGlzKTsKKyAgICAgICAgbU1lZGlhUGxheWVyLnNldE9uRXJyb3JMaXN0ZW5lcih0aGlzKTsKKyAgICAgICAgbU1lZGlhUGxheWVyLnNldE9uUHJlcGFyZWRMaXN0ZW5lcih0aGlzKTsKKyAgICAgICAgbU1lZGlhUGxheWVyLnNldE9uU2Vla0NvbXBsZXRlTGlzdGVuZXIodGhpcyk7CisKKyAgICAgICAgaWYgKG1UaW1lciAhPSBudWxsKSB7CisgICAgICAgICAgICBtVGltZXIuY2FuY2VsKCk7CisgICAgICAgIH0KKyAgICAgICAgbVRpbWVyID0gbmV3IFRpbWVyKCk7CisgICAgICAgIG1TdGF0ZSA9IElETEU7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHNldERhdGFTb3VyY2UoU3RyaW5nIHVybCkgeworICAgICAgICBtVXJsID0gdXJsOworICAgICAgICB0cnkgeworICAgICAgICAgICAgaWYgKG1TdGF0ZSAhPSBJRExFKSB7CisgICAgICAgICAgICAgICAgcmVzZXRNZWRpYVBsYXllcigpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbU1lZGlhUGxheWVyLnNldERhdGFTb3VyY2UodXJsKTsKKyAgICAgICAgICAgIG1TdGF0ZSA9IElOSVRJQUxJWkVEOworICAgICAgICAgICAgbU1lZGlhUGxheWVyLnByZXBhcmVBc3luYygpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShMT0dUQUcsICJjb3VsZG4ndCBsb2FkIHRoZSByZXNvdXJjZTogIiArIHVybCArICIgZXhjOiAiICsgZSk7CisgICAgICAgICAgICByZXNldE1lZGlhUGxheWVyKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgcGxheSgpIHsKKyAgICAgICAgaWYgKChtU3RhdGUgPT0gRVJST1IgfHwgbVN0YXRlID09IElETEUpICYmIG1VcmwgIT0gbnVsbCkgeworICAgICAgICAgICAgcmVzZXRNZWRpYVBsYXllcigpOworICAgICAgICAgICAgc2V0RGF0YVNvdXJjZShtVXJsKTsKKyAgICAgICAgICAgIG1Bc2tUb1BsYXkgPSB0cnVlOworICAgICAgICB9CisKKyAgICAgICAgaWYgKG1TdGF0ZSA+PSBQUkVQQVJFRCkgeworICAgICAgICAgICAgbU1lZGlhUGxheWVyLnN0YXJ0KCk7CisgICAgICAgICAgICBtU3RhdGUgPSBTVEFSVEVEOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHBhdXNlKCkgeworICAgICAgICBpZiAobVN0YXRlID09IFNUQVJURUQpIHsKKyAgICAgICAgICAgIGlmIChtVGltZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1UaW1lci5wdXJnZSgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbU1lZGlhUGxheWVyLnBhdXNlKCk7CisgICAgICAgICAgICBtU3RhdGUgPSBQQVVTRUQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgc2VlayhpbnQgbXNlYykgeworICAgICAgICBpZiAobVN0YXRlID49IFBSRVBBUkVEKSB7CisgICAgICAgICAgICBtTWVkaWFQbGF5ZXIuc2Vla1RvKG1zZWMpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHRlYXJkb3duKCkgeworICAgICAgICBtTWVkaWFQbGF5ZXIucmVsZWFzZ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AgICAqLwpAQCAtMTA3LDYgKzEyNSw3IEBACiAgICAgICAgIGlmICgrK3NQbGF0Zm9ybU5vdGlmaWNhdGlvbkVuYWJsZVJlZkNvdW50ID09IDEpIHsKICAgICAgICAgICAgIGlmIChzTmV0d29yayAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgc05ldHdvcmsubVJlcXVlc3RRdWV1ZS5lbmFibGVQbGF0Zm9ybU5vdGlmaWNhdGlvbnMoKTsKKyAgICAgICAgICAgICAgICBzTmV0d29yay5tb25pdG9yUm9hbWluZygpOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBzUGxhdGZvcm1Ob3RpZmljYXRpb25zID0gdHJ1ZTsKICAgICAgICAgICAgIH0KQEAgLTEyMSw2ICsxNDAsNyBAQAogICAgICAgICBpZiAoLS1zUGxhdGZvcm1Ob3RpZmljYXRpb25FbmFibGVSZWZDb3VudCA9PSAwKSB7CiAgICAgICAgICAgICBpZiAoc05ldHdvcmsgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIHNOZXR3b3JrLm1SZXF1ZXN0UXVldWUuZGlzYWJsZVBsYXRmb3JtTm90aWZpY2F0aW9ucygpOworICAgICAgICAgICAgICAgIHNOZXR3b3JrLnN0b3BNb25pdG9yaW5nUm9hbWluZygpOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBzUGxhdGZvcm1Ob3RpZmljYXRpb25zID0gZmFsc2U7CiAgICAgICAgICAgICB9CkBAIC0xMzYsMTIgKzE1NiwzOSBAQAogICAgICAgICAgICAgQXNzZXJ0LmFzc2VydFRydWUoVGhyZWFkLmN1cnJlbnRUaHJlYWQoKS4KICAgICAgICAgICAgICAgICAgICAgZ2V0TmFtZSgpLmVxdWFscyhXZWJWaWV3Q29yZS5USFJFQURfTkFNRSkpOwogICAgICAgICB9CisgICAgICAgIG1Db250ZXh0ID0gY29udGV4dDsKICAgICAgICAgbVNzbEVycm9ySGFuZGxlciA9IG5ldyBTc2xFcnJvckhhbmRsZXIoKTsKICAgICAgICAgbUh0dHBBdXRoSGFuZGxlciA9IG5ldyBIdHRwQXV0aEhhbmRsZXIodGhpcyk7CiAKICAgICAgICAgbVJlcXVlc3RRdWV1ZSA9IG5ldyBSZXF1ZXN0UXVldWUoY29udGV4dCk7CiAgICAgfQogCisgICAgcHJpdmF0ZSBjbGFzcyBSb2FtaW5nTW9uaXRvciBleHRlbmRzIEJyb2FkY2FzdFJlY2VpdmVyIHsKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIG9uUmVjZWl2ZShDb250ZXh0IGNvbnRleHQsIEludGVudCBpbnRlbnQpIHsKKyAgICAgICAgICAgIGlmICghQ29ubmVjdGl2aXR5TWFuYWdlci5DT05ORUNUSVZJVFlfQUNUSU9OLmVxdWFscyhpbnRlbnQuZ2V0QWN0aW9uKCkpKQorICAgICAgICAgICAgICAgIHJldHVybjsKKworICAgICAgICAgICAgTmV0d29ya0luZm8gaW5mbyA9IChOZXR3b3JrSW5mbylpbnRlbnQuZ2V0UGFyY2VsYWJsZUV4dHJhKENvbm5lY3Rpdml0eU1hbmFnZXIuRVhUUkFfTkVUV09SS19JTkZPKTsKKyAgICAgICAgICAgIGlmIChpbmZvICE9IG51bGwpCisgICAgICAgICAgICAgICAgbVJvYW1pbmcgPSBpbmZvLmlzUm9hbWluZygpOworICAgICAgICB9OworICAgIH07CisKKyAgICBwcml2YXRlIHZvaWQgbW9uaXRvclJvYW1pbmcoKSB7CisgICAgICAgIG1Sb2FtaW5nTW9uaXRvciA9IG5ldyBSb2FtaW5nTW9uaXRvcigpOworICAgICAgICBJbnRlbnRGaWx0ZXIgZmlsdGVyID0gbmV3IEludGVudEZpbHRlcigpOworICAgICAgICBmaWx0ZXIuYWRkQWN0aW9uKENvbm5lY3Rpdml0eU1hbmFnZXIuQ09OTkVDVElWSVRZX0FDVElPTik7CisgICAgICAgIG1Db250ZXh0LnJlZ2lzdGVyUmVjZWl2ZXIoc05ldHdvcmsubVJvYW1pbmdNb25pdG9yLCBmaWx0ZXIpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBzdG9wTW9uaXRvcmluZ1JvYW1pbmcoKSB7CisgICAgICAgIGlmIChtUm9hbWluZ01vbml0b3IgIT0gbnVsbCkgeworICAgICAgICAgICAgbUNvbnRleHQudW5yZWdpc3RlclJlY2VpdmVyKG1Sb2FtaW5nTW9uaXRvcik7CisgICAgICAgICAgICBtUm9hbWluZ01vbml0b3IgPSBudWxsOworICAgICAgICB9CisgICAgfQorCiAgICAgLyoqCiAgICAgICogUmVxdWVzdCBhIHVybCBmcm9tIGVpdGhlciB0aGUgbmV0d29yayBvciB0aGUgZmlsZSBzeXN0ZW0uCiAgICAgICogQHBhcmFtIHVybCBUaGUgdXJsIHRvIGxvYWQuCkBAIC0xNzAsNiArMjE3LDExIEBACiAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KIAorICAgICAgICAvLyBJZiB0aGlzIGlzIGEgcHJlZmV0Y2gsIGFib3J0IGl0IGlmIHdlJ3JlIHJvYW1pbmcuCisgICAgICAgIGlmIChtUm9hbWluZyAmJiBoZWFkZXJzLmNvbnRhaW5zS2V5KCJYLU1veiIpICYmICJwcmVmZXRjaCIuZXF1YWxzKGhlYWRlcnMuZ2V0KCJYLU1veiIpKSkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKICAgICAgICAgLyogRklYTUU6IHRoaXMgaXMgbGFtZS4gIFBhc3MgYW4gSW5wdXRTdHJlYW0gaW4sIHJhdGhlciB0aGFuCiAgICAgICAgICAgIG1ha2luZyB0aGlzIGxhbWUgb25lIGhlcmUgKi8KICAgICAgICAgSW5wdXRTdHJlYW0gYm9keVByb3ZpZGVyID0gbnVsbDsKZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL3dlYmtpdC9XZWJDaHJvbWVDbGllbnQuamF2YSBiL2NvcmUvamF2YS9h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mluYWwgU3RyaW5nIGxhbmd1YWdlID0gbG9jYWxlLmdldExhbmd1YWdlKCk7Ci0gICAgICAgIGlmIChsYW5ndWFnZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICBidWZmZXIuYXBwZW5kKGxhbmd1YWdlKTsKLSAgICAgICAgICAgIGZpbmFsIFN0cmluZyBjb3VudHJ5ID0gbG9jYWxlLmdldENvdW50cnkoKTsKLSAgICAgICAgICAgIGlmIChjb3VudHJ5ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBidWZmZXIuYXBwZW5kKCItIik7Ci0gICAgICAgICAgICAgICAgYnVmZmVyLmFwcGVuZChjb3VudHJ5KTsKKyAgICAgICAgU3RyaW5nQnVpbGRlciBidWZmZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOworICAgICAgICBhZGRMb2NhbGVUb0h0dHBBY2NlcHRMYW5ndWFnZShidWZmZXIsIGxvY2FsZSk7CisKKyAgICAgICAgaWYgKCFMb2NhbGUuVVMuZXF1YWxzKGxvY2FsZSkpIHsKKyAgICAgICAgICAgIGlmIChidWZmZXIubGVuZ3RoKCkgPiAwKSB7CisgICAgICAgICAgICAgICAgYnVmZmVyLmFwcGVuZCgiLCAiKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBpZiAoIWxvY2FsZS5lcXVhbHMoTG9jYWxlLlVTKSkgewotICAgICAgICAgICAgYnVmZmVyLmFwcGVuZCgiLCAiKTsKLSAgICAgICAgICAgIGphdmEudXRpbC5Mb2NhbGUgdXMgPSBMb2NhbGUuVVM7Ci0gICAgICAgICAgICBpZiAodXMuZ2V0TGFuZ3VhZ2UoKSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgYnVmZmVyLmFwcGVuZCh1cy5nZXRMYW5ndWFnZSgpKTsKLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgY291bnRyeSA9IHVzLmdldENvdW50cnkoKTsKLSAgICAgICAgICAgICAgICBpZiAoY291bnRyeSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1ZmZlci5hcHBlbmQoIi0iKTsKLSAgICAgICAgICAgICAgICAgICAgYnVmZmVyLmFwcGVuZChjb3VudHJ5KTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9CisgICAgICAgICAgICBidWZmZXIuYXBwZW5kKEFDQ0VQVF9MQU5HX0ZPUl9VU19MT0NBTEUpOwogICAgICAgICB9CiAKICAgICAgICAgcmV0dXJuIGJ1ZmZlci50b1N0cmluZygpOwogICAgIH0KLSAgICAKKworICAgIC8qKgorICAgICAqIENvbnZlcnQgb2Jzb2xldGUgbGFuZ3VhZ2UgY29kZXMsIGluY2x1ZGluZyBIZWJyZXcvSW5kb25lc2lhbi9ZaWRkaXNoLAorICAgICAqIHRvIG5ldyBzdGFuZGFyZC4KKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBTdHJpbmcgY29udmVydE9ic29sZXRlTGFuZ3VhZ2VDb2RlVG9OZXcoU3RyaW5nIGxhbmdDb2RlKSB7CisgICAgICAgIGlmIChsYW5nQ29kZSA9PSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgICAgICBpZiAoIml3Ii5lcXVhbHMobGFuZ0NvZGUpKSB7CisgICAgICAgICAgICAvLyBIZWJyZXcKKyAgICAgICAgICAgIHJldHVybiAiaGUiOworICAgICAgICB9IGVsc2UgaWYgKCJpbiIuZXF1YWxzKGxhbmdDb2RlKSkgeworICAgICAgICAgICAgLy8gSW5kb25lc2lhbgorICAgICAgICAgICAgcmV0dXJuICJpZCI7CisgICAgICAgIH0gZWxzZSBpZiAoImppIi5lcXVhbHMobGFuZ0NvZGUpKSB7CisgICAgICAgICAgICAvLyBZaWRkaXNoCisgICAgICAgICAgICByZXR1cm4gInlpIjsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbGFuZ0NvZGU7CisgICAgfQorCisgICAgcHJpdmF0ZSBzdGF0aWMgdm9pZCBhZGRMb2NhbGVUb0h0dHBBY2NlcHRMYW5ndWFnZShTdHJpbmdCdWlsZGVyIGJ1aWxkZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2NhbGUgbG9jYWxlKSB7CisgICAgICAgIFN0cmluZyBsYW5ndWFnZSA9IGNvbnZlcnRPYnNvbGV0ZUxhbmd1YWdlQ29kZVRvTmV3KGxvY2FsZS5nZXRMYW5ndWFnZSgpKTsKKyAgICAgICAgaWYgKGxhbmd1YWdlICE9IG51bGwpIHsKKyAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGxhbmd1YWdlKTsKKyAgICAgICAgICAgIFN0cmluZyBjb3VudHJ5ID0gbG9jYWxlLmdldENvdW50cnkoKTsKKyAgICAgICAgICAgIGlmIChjb3VudHJ5ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiLSIpOworICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGNvdW50cnkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCiAgICAgLyoqCiAgICAgICogTG9va3MgYXQgc0xvY2FsZSBhbmQgbUNvbnRleHQgYW5kIHJldHVybnMgY3VycmVudCBVc2VyQWdlbnQgU3RyaW5nLgogICAgICAqIEByZXR1cm4gQ3VycmVudCBVc2VyQWdlbnQgU3RyaW5nLgpAQCAtMzc5LDExICs0MDQsMTEgQEAKICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIC8vIGRlZmF1bHQgdG8gIjEuMCIKICAgICAgICAgICAgIGJ1ZmZlci5hcHBlbmQoIjEuMCIpOwotICAgICAgICB9ICAKKyAgICAgICAgfQogICAgICAgICBidWZmZXIuYXBwZW5kKCI7ICIpOwogICAgICAgICBmaW5hbCBTdHJpbmcgbGFuZ3VhZ2UgPSBsb2NhbGUuZ2V0TGFuZ3VhZ2UoKTsKICAgICAgICAgaWYg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gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBmbG9hdCBtYXhTY3JvbGxYID0gKGZsb2F0KSBUb3VjaC5nZXRNYXhTY3JvbGxYKHRoaXMsIGxheW91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU2Nyb2xsWSk7CiAgICAgICAgICAgICAgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9URVhUX1ZJRVcpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgIm9uVG91Y2hFdmVudCB4PSIgKyBtU2Nyb2xsWCArICIgeT0iCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbVNjcm9sbFkgKyAiIG1heFg9IiArIG1heFNjcm9sbFgpOwpAQCAtNjY3LDYgKzY4NSw3IEBACiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICBTZWxlY3Rpb24uc2V0U2VsZWN0aW9uKHRleHQsIHNlbGVjdGlvbiwgc2VsZWN0aW9uKTsKICAgICAgICAgfQorICAgICAgICBpZiAobVdlYlZpZXcgIT0gbnVsbCkgbVdlYlZpZXcuaW5jcmVtZW50VGV4dEdlbmVyYXRpb24oKTsKICAgICB9CiAKICAgICAvKioKQEAgLTkxOSwxNCArOTM4LDQgQEAKICAgICAvKiBwYWNrYWdlICovIHZvaWQgdXBkYXRlQ2FjaGVkVGV4dGZpZWxkKCkgewogICAgICAgICBtV2ViVmlldy51cGRhdGVDYWNoZWRUZXh0ZmllbGQoZ2V0VGV4dCgpLnRvU3RyaW5nKCkpOwogICAgIH0KLQotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyBib29sZWFuIHJlcXVlc3RSZWN0YW5nbGVPblNjcmVlbihSZWN0IHJlY3RhbmdsZSkgewotICAgICAgICAvLyBkb24ndCBzY3JvbGwgd2hpbGUgaW4gem9vbSBhbmltYXRpb24uIFdoZW4gaXQgaXMgZG9uZSwgd2Ugd2lsbCBhZGp1c3QKLSAgICAgICAgLy8gdG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sdXNNaW51c1pvb21Db250cm9scyA9IChab29tQ29udHJvbHMpIGZpbmRWaWV3QnlJZCgKLSAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC56b29tQ29udHJvbHMpOwotICAgICAgICAgICAgZmluZFZpZXdCeUlkKGNvbS5hbmRyb2lkLmludGVybmFsLlIuaWQuem9vbU1hZ25pZnkpLnNldFZpc2liaWxpdHkoCi0gICAgICAgICAgICAgICAgICAgIFZpZXcuR09ORSk7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCBzaG93KGJvb2xlYW4gc2hvd1pvb20sIGJvb2xlYW4gY2FuWm9vbU91dCkgewotICAgICAgICAgICAgbVBsdXNNaW51c1pvb21Db250cm9scy5zZXRWaXNpYmlsaXR5KAotICAgICAgICAgICAgICAgICAgICBzaG93Wm9vbSA/IFZpZXcuVklTSUJMRSA6IFZpZXcuR09ORSk7Ci0gICAgICAgICAgICBmYWRlKFZpZXcuVklTSUJMRSwgMC4wZiwgMS4wZik7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCBoaWRlKCkgewotICAgICAgICAgICAgZmFkZShWaWV3LkdPTkUsIDEuMGYsIDAuMGYpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHJpdmF0ZSB2b2lkIGZhZGUoaW50IHZpc2liaWxpdHksIGZsb2F0IHN0YXJ0QWxwaGEsIGZsb2F0IGVuZEFscGhhKSB7Ci0gICAgICAgICAgICBBbHBoYUFuaW1hdGlvbiBhbmltID0gbmV3IEFscGhhQW5pbWF0aW9uKHN0YXJ0QWxwaGEsIGVuZEFscGhhKTsKLSAgICAgICAgICAgIGFuaW0uc2V0RHVyYXRpb24oNTAwKTsKLSAgICAgICAgICAgIHN0YXJ0QW5pbWF0aW9uKGFuaW0pOwotICAgICAgICAgICAgc2V0VmlzaWJpbGl0eSh2aXNpYmlsaXR5KTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1Ymxp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WdodAorICAgIHByaXZhdGUgUGFpbnQgbVRvdWNoSGlnaHRsaWdodFBhaW50OworICAgIC8vIGRlYnVnIG9ubHkKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBib29sZWFuIERFQlVHX1RPVUNIX0hJR0hMSUdIVCA9IHRydWU7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IFRPVUNIX0hJR0hMSUdIVF9FTEFQU0VfVElNRSA9IDIwMDA7CisgICAgcHJpdmF0ZSBQYWludCBtVG91Y2hDcm9zc0hhaXJDb2xvcjsKKyAgICBwcml2YXRlIGludCBtVG91Y2hIaWdobGlnaHRYOworICAgIHByaXZhdGUgaW50IG1Ub3VjaEhpZ2hsaWdodFk7CiAKICAgICAvKgogICAgICAqIFByaXZhdGUgbWVzc2FnZSBpZHMKQEAgLTYwNiw3ICs1NzAsNyBAQAogICAgIHN0YXRpYyBmaW5hbCBpbnQgV0VCQ09SRV9JTklUSUFMSVpFRF9NU0dfSUQgICAgICAgICA9IDEwNzsKICAgICBzdGF0aWMgZmluYWwgaW50IFVQREFURV9URVhURklFTERfVEVYVF9NU0dfSUQgICAgICAgPSAxMDg7CiAgICAgc3RhdGljIGZpbmFsIGludCBVUERBVEVfWk9PTV9SQU5HRSAgICAgICAgICAgICAgICAgID0gMTA5OwotICAgIHN0YXRpYyBmaW5hbCBpbnQgTU9WRV9PVVRfT0ZfUExVR0lOICAgICAgICAgICAgICAgICA9IDExMDsKKyAgICBzdGF0aWMgZmluYWwgaW50IFVOSEFORExFRF9OQVZfS0VZICAgICAgICAgICAgICAgICAgPSAxMTA7CiAgICAgc3RhdGljIGZpbmFsIGludCBDTEVBUl9URVhUX0VOVFJZICAgICAgICAgICAgICAgICAgID0gMTExOwogICAgIHN0YXRpYyBmaW5hbCBpbnQgVVBEQVRFX1RFWFRfU0VMRUNUSU9OX01TR19JRCAgICAgICA9IDExMjsKICAgICBzdGF0aWMgZmluYWwgaW50IFNIT1dfUkVDVF9NU0dfSUQ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VQREFURV9aT09NX1JBTkdFIiwgLy8gICAgICAgICAgICAgID0gMTA5OwotICAgICAgICAiTU9WRV9PVVRfT0ZfUExVR0lOIiwgLy8gICAgICAgICAgICAgPSAxMTA7CisgICAgICAgICJVTkhBTkRMRURfTkFWX0tFWSIsIC8vICAgICAgICAgICAgICA9IDExMDsKICAgICAgICAgIkNMRUFSX1RFWFRfRU5UUlkiLCAvLyAgICAgICAgICAgICAgID0gMTExOwogICAgICAgICAiVVBEQVRFX1RFWFRfU0VMRUNUSU9OX01TR19JRCIsIC8vICAgPSAxMTI7CiAgICAgICAgICJTSE9XX1JFQ1RfTVNHX0lEIiwgLy8gICAgICAgICAgICAgICA9IDExMzsKQEAgLTY3Myw3ICs2MzksOSBAQAogICAgICAgICAiRklORF9BR0FJTiIsIC8vICAgICAgICAgICAgICAgICAgICAgPSAxMjY7CiAgICAgICAgICJDRU5URVJfRklUX1JFQ1QiLCAvLyAgICAgICAgICAgICAgICA9IDEyNzsKICAgICAgICAgIlJFUVVFU1RfS0VZQk9BUkRfV0lUSF9TRUxFQ1RJT05fTVNHX0lEIiwgLy8gPSAxMjg7Ci0gICAgICAgICJTRVRfU0NST0xMQkFSX01PREVTIiAvLyAgICAgICAgICAgICA9IDEyOTsKKyAgICAgICAgIlNFVF9TQ1JPTExCQVJfTU9ERVMiLCAvLyAgICAgICAgICAgID0gMTI5OworICAgICAgICAiU0VMRUNUSU9OX1NUUklOR19DSEFOR0VEIiwgLy8gICAgICAgPSAxMzA7CisgICAgICAgICJTRVRfVE9VQ0hfSElHSExJR0hUX1JFQ1RTIiAvLyAgICAgICA9IDEzMTsKICAgICB9OwogCiAgICAgLy8gSWYgdGhlIHNpdGUgZG9lc24ndCB1c2UgdGhlIHZpZXdwb3J0IG1ldGEgdGFnIHRvIHNwZWNpZnkgdGhlIHZpZXdwb3J0LApAQCAtNjg2LDQ5ICs2NTQsOSBAQAogICAgIC8vIHRoZSBtaW5pbXVtIHByZWZlcnJlZCB3aWR0aCBpc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0dXJuOwotICAgICAgICBib29sZWFuIGNhblpvb21JbiA9IG1BY3R1YWxTY2FsZSA8IG1NYXhab29tU2NhbGU7Ci0gICAgICAgIGJvb2xlYW4gY2FuWm9vbU91dCA9IG1BY3R1YWxTY2FsZSA+IG1NaW5ab29tU2NhbGUgJiYgIW1Jblpvb21PdmVydmlldzsKLSAgICAgICAgaWYgKCFjYW5ab29tSW4gJiYgIWNhblpvb21PdXQpIHsKLSAgICAgICAgICAgIC8vIEhpZGUgdGhlIHpvb20gaW4gYW5kIG91dCBidXR0b25zLCBhcyB3ZWxsIGFzIHRoZSBmaXQgdG8gcGFnZQotICAgICAgICAgICAgLy8gYnV0dG9uLCBpZiB0aGUgcGFnZSBjYW5ub3Qgem9vbQotICAgICAgICAgICAgbVpvb21CdXR0b25zQ29udHJvbGxlci5nZXRab29tQ29udHJvbHMoKS5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAvLyBTZXQgZWFjaCBvbmUgaW5kaXZpZHVhbGx5LCBhcyBhIHBhZ2UgbWF5IGJlIGFibGUgdG8gem9vbSBpbgotICAgICAgICAgICAgLy8gb3Igb3V0LgotICAgICAgICAgICAgbVpvb21CdXR0b25zQ29udHJvbGxlci5zZXRab29tSW5FbmFibGVkKGNhblpvb21Jbik7Ci0gICAgICAgICAgICBtWm9vbUJ1dHRvbnNDb250cm9sbGVyLnNldFpvb21PdXRFbmFibGVkKGNhblpvb21PdXQpOwotICAgICAgICB9CisgICAgICAgIG1ab29tTWFuYWdlci51cGRhdGVNdWx0aVRvdWNoU3VwcG9ydChjb250ZXh0KTsKICAgICB9CiAKICAgICBwcml2YXRlIHZvaWQgaW5pdCgpIHsKQEAgLTk5MiwzNCArODgyLDM1IEBACiAgICAgICAgIC8vIHVzZSBvbmUgbGluZSBoZWlnaHQsIDE2IGJhc2VkIG9uIG91ciBjdXJyZW50IGRlZmF1bHQgZm9udCwgZm9yIGhvdwog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d2lucy4KKyAgICAgKgorICAgICAqIEBwYXJhbSBqYXZhc2NyaXB0SW50ZXJmYWNlcyBBIG1hcCB3aXRoIGludGVyZmFjZXMgdG8gYmUgZXhwb3NlZCB0byBKYXZhU2NyaXB0LgorICAgICAqLworICAgIHByaXZhdGUgdm9pZCBleHBvc2VBY2Nlc3NpYmlsaXR5SmF2YVNjcmlwdEFwaShNYXA8U3RyaW5nLCBPYmplY3Q+IGphdmFzY3JpcHRJbnRlcmZhY2VzKSB7CisgICAgICAgIGlmIChqYXZhc2NyaXB0SW50ZXJmYWNlcy5jb250YWluc0tleShBTElBU19BQ0NFU1NJQklMSVRZX0pTX0lOVEVSRkFDRSkpIHsKKyAgICAgICAgICAgIExvZy53KExPR1RBRywgIkphdmFTY3JpcHQgaW50ZXJmYWNlIG1hcHBlZCB0byBcIiIgKyBBTElBU19BQ0NFU1NJQklMSVRZX0pTX0lOVEVSRkFDRQorICAgICAgICAgICAgICAgICAgICArICJcIiBvdmVycmlkZXMgdGhlIGFjY2Vzc2liaWxpdHkgQVBJIEphdmFTY3JpcHQgaW50ZXJmYWNlLiBObyBhY2Nlc3NpYmlsaXR5IgorICAgICAgICAgICAgICAgICAgICArICJBUEkgd2lsbCBiZSBleHBvc2VkIHRvIEphdmFTY3JpcHQhIik7CisgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KKworICAgICAgICAvLyBleHBvc2UgdGhlIFRUUyBmb3Igbm93IC4uLgorICAgICAgICBqYXZhc2NyaXB0SW50ZXJmYWNlcy5wdXQoQUxJQVNfQUNDRVNTSUJJTElUWV9KU19JTlRFUkZBQ0UsCisgICAgICAgICAgICAgICAgbmV3IFRleHRUb1NwZWVjaChnZXRDb250ZXh0KCksIG51bGwpKTsKKyAgICB9CisKKyAgICAvKiBwYWNrYWdlICovdm9pZCB1cGRhdGVEZWZhdWx0Wm9vbURlbnNpdHkoaW50IHpvb21EZW5zaXR5KSB7CisgICAgICAgIGZpbmFsIGZsb2F0IGRlbnNpdHkgPSBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXREaXNwbGF5TWV0cmljcygpLmRlbnNpdHkKKyAgICAgICAgICAgICAgICAqIDEwMCAvIHpvb21EZW5zaXR5OworICAgICAgICBtTmF2U2xvcCA9IChpbnQpICgxNiAqIGRlbnNpdHkpOworICAgICAgICBtWm9vbU1hbmFnZXIudXBkYXRlRGVmYXVsdFpvb21EZW5zaXR5KGRlbnNpdHkpOwogICAgIH0KIAogICAgIC8qIHBhY2thZ2UgKi8gYm9vbGVhbiBvblNhdmVQYXNzd29yZChTdHJpbmcgc2NoZW1lUGx1c0hvc3QsIFN0cmluZyB1c2VybmFtZSwKQEAgLTExMzYsMTQgKzEwMjcsMTQgQEAKICAgICAgKiByZXR1cm5zIHRoZSBoZWlnaHQgb2YgdGhlIHRpdGxlYmFydmlldyAoaWYgYW55KS4gRG9lcyBub3QgY2FyZSBhYm91dAogICAgICAqIHNjcm9sbGluZwogICAgICAqLwotICAgIHByaXZhdGUgaW50IGdldFRpdGxlSGVpZ2h0KCkgeworICAgIGludCBnZXRUaXRsZUhlaWdodCgpIHsKICAgICAgICAgcmV0dXJuIG1UaXRsZUJhciAhPSBudWxsID8gbVRpdGxlQmFyLmdldEhlaWdodCgpIDogMDsKICAgICB9CiAKICAgICAvKgogICAgICAqIFJldHVybiB0aGUgYW1vdW50IG9mIHRoZSB0aXRsZWJhcnZpZXcgKGlmIGFueSkgdGhhdCBpcyB2aXNpYmxlCiAgICAgICovCi0gICAgcHJpdmF0ZSBpbnQgZ2V0VmlzaWJsZVRpdGxlSGVpZ2h0KCkgeworICAgIGludCBnZXRWaXNpYmxlVGl0bGVIZWlnaHQoKSB7CiAgICAgICAgIHJldHVybiBNYXRoLm1heChnZXRUaXRsZUhlaWdodCgpIC0gbVNjcm9sbFksIDApOwogICAgIH0KIApAQCAtMTQwNCwyOSArMTI5NSwyMyBAQAogICAgICAgICAvLyBub3cgdXBkYXRlIHRoZSBidW5kbGUKICAgICAgICAgY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jYWxlSW5QZXJjZW50KTsKICAgICB9CiAKICAgICAvKioKQEAgLTE4NzUsMTMgKzE3NjAsNyBAQAogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAgICAgICAgIGNsZWFyVGV4dEVudHJ5KGZhbHNlKTsKLSAgICAgICAgaWYgKGdldFNldHRpbmdzKCkuZ2V0QnVpbHRJblpvb21Db250cm9scygpKSB7Ci0gICAgICAgICAgICBnZXRab29tQnV0dG9uc0NvbnRyb2xsZXIoKS5zZXRWaXNpYmxlKHRydWUpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhtWm9vbUNvbnRyb2xSdW5uYWJsZSk7Ci0gICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucG9zdERlbGF5ZWQobVpvb21Db250cm9sUnVubmFibGUsCi0gICAgICAgICAgICAgICAgICAgIFpPT01fQ09OVFJPTFNfVElNRU9VVCk7Ci0gICAgICAgIH0KKyAgICAgICAgbVpvb21NYW5hZ2VyLmludm9rZVpvb21QaWNrZXIoKTsKICAgICB9CiAKICAgICAvKioKQEAgLTE5OTYsNyArMTg3NSw3IEBACiAgICAgICAgIG1zZy5zZW5kVG9UYXJnZXQoKTsKICAgICB9CiAKLSAgICBwcml2YXRlIHN0YXRpYyBpbnQgcGluTG9jKGludCB4LCBpbnQgdmlld01heCwgaW50IGRvY01heCkgeworICAgIHN0YXRpYyBpbnQgcGluTG9jKGludCB4LCBpbnQgdmlld01heCwgaW50IGRvY01heCkgewogLy8gICAgICAgIExvZy5kKExPR1RBRywgIi0tIHBpbkxvYyAiICsgeCArICIgIiArIHZpZXdNYXggKyAiICIgKyBkb2NNYXgpOwogICAgICAgICBpZiAoZG9jTWF4IDwgdmlld01heCkgeyAgIC8vIHRoZSBkb2MgaGFzIHJvb20gb24gdGhlIHNpZGVzIGZvciAiYmxhbmsiCiAgICAgICAgICAgICAvLyBwaW4gdGhlIHNob3J0IGRvY3VtZW50IHRvIHRoZSB0b3AvbGVmdCBvZiB0aGUgc2NyZWVuCkBAIC0yMDEzLDEyICsxODkyLDEyIEBACiAgICAgfQogCiAgICAgLy8gRXhwZWN0cyB4IGluIHZpZXcgY29vcmRpbmF0ZXMKLSAgICBwcml2YXRlIGludCBwaW5Mb2NYKGludCB4KSB7CisgICAgaW50IHBpbkxvY1goaW50IHgpIHsKICAgICAgICAgcmV0dXJuIHBpbkxvYyh4LCBnZXRWaWV3V2lkdGgoKSwgY29tcHV0ZUhvcml6b250YWxTY3JvbGxSYW5nZSgpKTsKICAgICB9CiAKICAgICAvLyBFeHBlY3RzIHkgaW4gdmlldyBjb29yZGluYXRlcwotICAgIHByaXZhdGUgaW50IHBpbkxvY1koaW50IHkpIHsKKyAgICBpbnQgcGluTG9jWShpbnQgeSkgewogICAgICAgICByZXR1cm4gcGluTG9jKHksIGdldFZpZXdIZWlnaHRXaXRoVGl0bGUoKSwKICAgICAgICAgICAgICAgICAgICAgICBjb21wdXRlVmVydGljYWxTY3JvbGxSYW5nZSgpICsgZ2V0VGl0bGVIZWlnaHQoKSk7CiAgICAgfQpAQCAtMjA2OCw3ICsxOTQ3LDcgQEAKICAgICAgKiBoZWlnaHQuCiAgICAgICovCiAgICAgcHJpdmF0ZSBpbnQgdmlld1RvQ29udGVudERpbWVuc2lvbihpbnQgZCkgewotICAgICAgICByZXR1cm4gTWF0aC5yb3VuZChkICogbUludkFjdHVhbFNjYWxlKTsKKyAgICAgICAgcmV0dXJuIE1hdGgucm91bmQoZCAqIG1ab29tTWFuYWdlci5nZXRJbnZTY2FsZSgpKTsKICAgICB9CiAKICAgICAvKioKQEAgLTIwOTQsNyArMTk3Myw3IEBACiAgICAgICogUmV0dXJucyB0aGUgcmVzdWx0IGFzIGEgZmxvYXQuCiAgICAgICovCiAgICAgcHJpdmF0ZSBmbG9hdCB2aWV3VG9Db250ZW50WGYoaW50IHgpIHsKLSAgICAgICAgcmV0dXJuIHggKiBtSW52QWN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AgICAgICAgICAgICAgc2VuZFZpZXdTaXplWm9vbSgpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAvLyB1cGRhdGUgb3VyIHNjcm9sbCBzbyB3ZSBkb24ndCBhcHBlYXIgdG8ganVtcAotICAgICAgICAgICAgICAgIC8vIGkuZS4ga2VlcCB0aGUgY2VudGVyIG9mIHRoZSBkb2MgaW4gdGhlIGNlbnRlciBvZiB0aGUgdmlldwotCi0gICAgICAgICAgICAgICAgaW50IG9sZFggPSBtU2Nyb2xsWDsKLSAgICAgICAgICAgICAgICBpbnQgb2xkWSA9IG1TY3JvbGxZOwotICAgICAgICAgICAgICAgIGZsb2F0IHJhdGlvID0gc2NhbGUgKiBtSW52QWN0dWFsU2NhbGU7ICAgLy8gb2xkIGludmVyc2UKLSAgICAgICAgICAgICAgICBmbG9hdCBzeCA9IHJhdGlvICogb2xkWCArIChyYXRpbyAtIDEpICogbVpvb21DZW50ZXJYOwotICAgICAgICAgICAgICAgIGZsb2F0IHN5ID0gcmF0aW8gKiBvbGRZICsgKHJhdGlvIC0gMSkKLSAgICAgICAgICAgICAgICAgICAgICAgICogKG1ab29tQ2VudGVyWSAtIGdldFRpdGxlSGVpZ2h0KCkpOwotCi0gICAgICAgICAgICAgICAgLy8gbm93IHVwZGF0ZSBvdXIgbmV3IHNjYWxlIGFuZCBpbnZlcnNlCi0gICAgICAgICAgICAgICAgaWYgKHNjYWxlICE9IG1BY3R1YWxTY2FsZSAmJiAhbVByZXZpZXdab29tT25seSkgewotICAgICAgICAgICAgICAgICAgICBtQ2FsbGJhY2tQcm94eS5vblNjYWxlQ2hhbmdlZChtQWN0dWFsU2NhbGUsIHNjYWxlKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbUFjdHVhbFNjYWxlID0gc2NhbGU7Ci0gICAgICAgICAgICAgICAgbUludkFjdHVhbFNjYWxlID0gMSAvIHNjYWxlOwotCi0gICAgICAgICAgICAgICAgLy8g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ICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgIH0KICAgICAgICAgcmV0dXJuIGZhbHNlOwpAQCAtMjQxOCwxMiArMjIyNywxMiBAQAogICAgICAgICBpZiAobURyYXdIaXN0b3J5KSB7CiAgICAgICAgICAgICByZXR1cm4gbUhpc3RvcnlXaWR0aDsKICAgICAgICAgfSBlbHNlIGlmIChtSG9yaXpvbnRhbFNjcm9sbEJhck1vZGUgPT0gU0NST0xMQkFSX0FMV0FZU09GRgotICAgICAgICAgICAgICAgICYmIChtQWN0dWFsU2NhbGUgLSBtTWluWm9vbVNjYWxlIDw9IE1JTklNVU1fU0NBTEVfSU5DUkVNRU5UKSkgeworICAgICAgICAgICAgICAgICYmICFtWm9vbU1hbmFnZXIuY2FuWm9vbU91dCgpKSB7CiAgICAgICAgICAgICAvLyBvbmx5IGhvbm9yIHRoZSBzY3JvbGxiYXIgbW9kZSB3aGVuIGl0IGlzIGF0IG1pbmltdW0gem9vbSBsZXZlbAogICAgICAgICAgICAgcmV0dXJuIGNvbXB1dGVIb3Jpem9udGFsU2Nyb2xsRXh0ZW50KCk7CiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAvLyB0byBhdm9pZCByb3VuZGluZyBlcnJvciBjYXVzZWQgdW5uZWNlc3Nhcnkgc2Nyb2xsYmFyLCB1c2UgZmxvb3IKLSAgICAgICAgICAgIHJldHVybiAoaW50KSBNYXRoLmZsb29yKG1Db250ZW50V2lkdGggKiBtQWN0dWFsU2NhbGUpOworICAgICAgICAgICAgcmV0dXJuIChpbnQpIE1hdGguZmxvb3IobUNvbnRlbnRXaWR0aCAqIG1ab29tTWFuYWdlci5nZXRTY2FsZSgpKTsKICAgICAgICAgfQogICAgIH0KIApAQCAtMjQzMiwxMiArMjI0MSwxMiBAQAogICAgICAgICBpZiAobURyYXdIaXN0b3J5KSB7CiAgICAgICAgICAgICByZXR1cm4gbUhpc3RvcnlIZWlnaHQ7CiAgICAgICAgIH0gZWxzZSBpZ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gICAgICAgIHNlbmRWaWV3U2l6ZVpvb20oKTsKKyAgICAgICAgICAgIHNlbmRWaWV3U2l6ZVpvb20oZmFsc2UpOwogICAgICAgICB9CiAgICAgfQogCkBAIC0zMTQ0LDcgKzI5NzIsNyBAQAogICAgICAqICAgICAgICAgc2V0dGluZ3MuCiAgICAgICovCiAgICAgcHVibGljIFdlYlNldHRpbmdzIGdldFNldHRpbmdzKCkgewotICAgICAgICByZXR1cm4gbVdlYlZpZXdDb3JlLmdldFNldHRpbmdzKCk7CisgICAgICAgIHJldHVybiAobVdlYlZpZXdDb3JlICE9IG51bGwpID8gbVdlYlZpZXdDb3JlLmdldFNldHRpbmdzKCkgOiBudWxsOwogICAgIH0KIAogICAgIC8qKgpAQCAtMzI4NSw3ICszMTEzLDQ3IEBACiAgICAgICAgIGlmIChBVVRPX1JFRFJBV19IQUNLICYmIG1BdXRvUmVkcmF3KSB7CiAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7CiAgICAgICAgIH0KKyAgICAgICAgaWYgKGluRWRpdGluZ01vZGUoKSkgbVdlYlRleHRWaWV3Lm9uRHJhd1N1YnN0aXR1dGUoKTsKICAgICAgICAgbVdlYlZpZXdDb3JlLnNpZ25hbFJlcGFpbnREb25lKCk7CisKKyAgICAgICAgLy8gcGFpbnQgdGhlIGhpZ2hsaWdodCBpbiB0aGUgZW5kCisgICAgICAgIGlmICghbVRvdWNoSGlnaGxpZ2h0UmVnaW9uLmlzRW1wdHkoKSkgeworICAgICAgICAgICAgaWYgKG1Ub3VjaEhpZ2h0bGlnaHRQYWludCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgbVRvdWNoSGlnaHRsaWdodFBhaW50ID0gbmV3IFBhaW50KCk7CisgICAgICAgICAgICAgICAgbVRvdWNoSGlnaHRsaWdodFBhaW50LnNldENvbG9yKG1IaWdodGxpZ2h0Q29sb3IpOworICAgICAgICAgICAgICAgIG1Ub3VjaEhpZ2h0bGlnaHRQYWludC5zZXRBbnRpQWxpYXModHJ1ZSk7CisgICAgICAgICAgICAgICAgbVRvdWNoSGlnaHRsaWdodFBhaW50LnNldFBhdGhFZmZlY3QobmV3IENvcm5lclBhdGhFZmZlY3QoCisgICAgICAgICAgICAgICAgICAgICAgICBUT1VDSF9ISUdITElHSFRfQVJDKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjYW52YXMuZHJhd1BhdGgobVRvdWNoSGlnaGxpZ2h0UmVnaW9uLmdldEJvdW5kYXJ5UGF0aCgpLAorICAgICAgICAgICAgICAgICAgICBtVG91Y2hIaWdodGxpZ2h0UGFpbnQpOworICAgICAgICB9CisgICAgICAgIGlmIChERUJVR19UT1VDSF9ISUdITElHSFQpIHsKKyAgICAgICAgICAgIGlmIChnZXRTZXR0aW5ncygpLmdldE5hdkR1bXAoKSkgeworICAgICAgICAgICAgICAgIGlmICgobVRvdWNoSGlnaGxpZ2h0WCB8IG1Ub3VjaEhpZ2hsaWdodFkpICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1Ub3VjaENyb3NzSGFpckNvbG9yID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaENyb3NzSGFpckNvbG9yID0gbmV3IFBhaW50KCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hDcm9zc0hhaXJDb2xvci5zZXRDb2xvcihDb2xvci5SRUQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGNhbnZhcy5kcmF3TGluZShtVG91Y2hIaWdobGlnaHRYIC0gbU5hdlNsb3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoSGlnaGxpZ2h0WSAtIG1OYXZTbG9wLCBtVG91Y2hIaWdobGlnaHRYCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIG1OYXZTbG9wICsgMSwgbVRvdWNoSGlnaGxpZ2h0WSArIG1OYXZTbG9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIDEsIG1Ub3VjaENyb3NzSGFpckNvbG9yKTsKKyAgICAgICAgICAgICAgICAgICAgY2FudmFzLmRyYXdMaW5lKG1Ub3VjaEhpZ2hsaWdodFggKyBtTmF2U2xvcCArIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoSGlnaGxpZ2h0WSAtIG1OYXZTbG9wLCBtVG91Y2hIaWdobGlnaHRYCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1OYXZTbG9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaEhpZ2hsaWdodFkgKyBtTmF2U2xvcCArIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoQ3Jvc3NIYWlyQ29sb3IpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCByZW1vdmVUb3VjaEhpZ2hsaWdodChib29sZWFuIHJlbW92ZVBlbmRpbmdNZXNzYWdlKSB7CisgICAgICAgIGlmIChyZW1vdmVQZW5kaW5nTWVzc2FnZSkgeworICAgICAgICAgICAgbVdlYlZpZXdDb3JlLnJlbW92ZU1lc3NhZ2VzKEV2ZW50SHViLkdFVF9UT1VDSF9ISUdITElHSFRfUkVDVFMpOworICAgICAgICB9CisgICAgICAgIG1XZWJWaWV3Q29yZS5zZW5kTWVzc2FnZShFdmVudEh1Yi5SRU1PVkVfVE9VQ0hfSElHSExJR0hUX1JFQ1RTKTsKICAgICB9CiAKICAgICBAT3ZlcnJpZGUKQEAgLTMzMDYsMjcgKzMxNzQsMzUgQEAKICAgICAgICAgICAgIC8vIFNlbmQgdGhlIGNsaWNrIHNvIHRoYXQgdGhlIHRleHRmaWVsZCBpcyBpbiBmb2N1cwogICAgICAgICAgICAgY2VudGVyS2V5UHJlc3NPblRleHRGaWVsZCgpOwogICAgICAgICAgICAgcmVidWlsZFdlYlRleHRWaWV3KCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBjbGVhclRleHRFbnRyeSh0cnVlKTsKICAgICAgICAgfQogICAgICAgICBpZiAoaW5FZGl0aW5nTW9kZSgpKSB7CiAgICAgICAgICAgICByZXR1cm4gbVdlYlRleHRWaWV3LnBlcmZvcm1Mb25nQ2xpY2soKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHJldHVybiBzdXBlci5wZXJmb3JtTG9uZ0NsaWNrKCk7CiAgICAgICAgIH0KKyAgICAgICAgLyogaWYgbG9uZyBjbGljayBicmluZ3MgdXAgYSBjb250ZXh0IG1lbnUsIHRoZSBzdXBlciBmdW5jdGlvbgorICAgICAgICAgKiByZXR1cm5zIHRydWUgYW5kIHdlJ3JlIGRvbmUuIE90aGVyd2lzZSwgbm90aGluZyBoYXBwZW5lZCB3aGVuCisgICAgICAgICAqIHRoZSB1c2VyIGNsaWNrZWQuICovCisgICAgICAgIGlmIChzdXBlci5wZXJmb3JtTG9uZ0NsaWNrKCkpIHsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIC8qIEluIHRoZSBjYXNlIHdoZXJlIHRoZSBhcHBsaWNhdGlvbiBoYXNuJ3QgYWxyZWFkeSBoYW5kbGVkIHRoZSBsb25nCisgICAgICAgICAqIGNsaWNrIGFjdGlvbiwgbG9vayBmb3IgYSB3b3JkIHVuZGVyIHRoZSAgY2xpY2suIElmIG9uZSBpcyBmb3VuZCwKKyAgICAgICAgICogYW5pbWF0ZSB0aGUgdGV4dCBzZWxlY3Rpb24gaW50byB2aWV3LgorICAgICAgICAgKiBGSVhNRTogbm8gYW5pbWF0aW9uIGNvZGUgeWV0ICovCisgICAgICAgIGlmIChtU2VsZWN0aW5nVGV4dCkgcmV0dXJuIGZhbHNlOyAvLyBsb25nIGNsaWNrIGRvZXMgbm90aGluZyBvbiBzZWxlY3Rpb24KKyAgICAgICAgaW50IHggPSB2aWV3VG9Db250ZW50WCgo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9ncmVzcygpOwogICAgICAgICBib29sZWFuIGFuaW1hdGVTY3JvbGwgPSAoKCFtU2Nyb2xsZXIuaXNGaW5pc2hlZCgpCiAgICAgICAgICAgICAgICAgfHwgbVZlbG9jaXR5VHJhY2tlciAhPSBudWxsKQogICAgICAgICAgICAgICAgICYmIChtVG91Y2hNb2RlICE9IFRPVUNIX0RSQUdfTU9ERSB8fApAQCAtMzM5MSw1OSArMzI5Myw5IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgaWYgKGFuaW1hdGVab29tKSB7Ci0gICAgICAgICAgICBmbG9hdCB6b29tU2NhbGU7Ci0gICAgICAgICAgICBpbnQgaW50ZXJ2YWwgPSAoaW50KSAoU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCkgLSBtWm9vbVN0YXJ0KTsKLSAgICAgICAgICAgIGlmIChpbnRlcnZhbCA8IFpPT01fQU5JTUFUSU9OX0xFTkdUSCkgewotICAgICAgICAgICAgICAgIGZsb2F0IHJhdGlvID0gKGZsb2F0KSBpbnRlcnZhbCAvIFpPT01fQU5JTUFUSU9OX0xFTkdUSDsKLSAgICAgICAgICAgICAgICB6b29tU2NhbGUgPSAxLjBmIC8gKG1JbnZJbml0aWFsWm9vbVNjYWxlCi0gICAgICAgICAgICAgICAgICAgICAgICArIChtSW52RmluYWxab29tU2NhbGUgLSBtSW52SW5pdGlhbFpvb21TY2FsZSkgKiByYXRpbyk7Ci0gICAgICAgICAgICAgICAgaW52YWxpZGF0ZSgpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICB6b29tU2NhbGUgPSBtWm9vbVNjYWxlOwotICAgICAgICAgICAgICAgIC8vIHNldCBtWm9vbVNjYWxlIHRvIGJlIDAgYXMgd2UgaGF2ZSBkb25lIGFuaW1hdGlvbgotICAgICAgICAgICAgICAgIG1ab29tU2NhbGUgPSAwOwotICAgICAgICAgICAgICAgIFdlYlZpZXdDb3JlLnJlc3VtZVVwZGF0ZVBpY3R1cmUobVdlYlZpZXdDb3JlKTsKLSAgICAgICAgICAgICAgICAvLyBjYWxsIGludmFsaWRhdGUoKSBhZ2FpbiB0byBkcmF3IHdpdGggdGhlIGZpbmFsIGZpbHRlcnMKLSAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7Ci0gICAgICAgICAgICAgICAgaWYgKG1OZWVkVG9BZGp1c3RXZWJUZXh0VmlldykgewotICAgICAgICAgICAgICAgICAgICBtTmVlZFRvQWRqdXN0V2ViVGV4dFZpZXcgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGRpZFVwZGF0ZVRleHRWaWV3Qm91bmRzKGZhbHNlKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG5hdGl2ZUZvY3VzQ2FuZGlkYXRlSXNQYXNzd29yZCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiBpdCBpcyBhIHBhc3N3b3JkIGZpZWxkLCBzdGFydCBkcmF3aW5nIHRoZQotICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2ViVGV4dFZpZXcgb25jZSBhZ2Fpbi4KLSAgICAgICAgICAgICAgICAgICAgICAgIG1XZWJUZXh0Vmlldy5zZXRJblBhc3N3b3JkKHRydWUpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgLy8gY2FsY3VsYXRlIHRoZSBpbnRlcm1lZGlhdGUgc2Nyb2xsIHBvc2l0aW9uLiBBcyB3ZSBuZWVkIHRvIHVzZQotICAgICAgICAgICAgLy8gem9vbVNjYWxlLCB3ZSBjYW4ndCB1c2UgcGluTG9jWC9ZIGRpcmVjdGx5LiBDb3B5IHRoZSBsb2dpYyBoZXJlLgotICAgICAgICAgICAgZmxvYXQgc2NhbGUgPSB6b29tU2NhbGUgKiBtSW52SW5pdGlhbFpvb21TY2FsZTsKLSAgICAgICAgICAgIGludCB0eCA9IE1hdGgucm91bmQoc2NhbGUgKiAobUluaXRpYWxTY3JvbGxYICsgbVpvb21DZW50ZXJYKQotICAgICAgICAgICAgICAgICAgICAtIG1ab29tQ2VudGVyWCk7Ci0gICAgICAgICAgICB0eCA9IC1waW5Mb2ModHgsIGdldFZpZXdXaWR0aCgpLCBNYXRoLnJvdW5kKG1Db250ZW50V2lkdGgKLSAgICAgICAgICAgICAgICAgICAgKiB6b29tU2NhbGUpKSArIG1TY3JvbGxYOwotICAgICAgICAgICAgaW50IHRpdGxlSGVpZ2h0ID0gZ2V0VGl0bGVIZWlnaHQoKTsKLSAgICAgICAgICAgIGludCB0eSA9IE1hdGgucm91bmQoc2NhbGUKLSAgICAgICAgICAgICAgICAgICAgKiAobUluaXRpYWxTY3JvbGxZICsgbVpvb21DZW50ZXJZIC0gdGl0bGVIZWlnaHQpCi0gICAgICAgICAgICAgICAgICAgIC0gKG1ab29tQ2VudGVyWSAtIHRpdGxlSGVpZ2h0KSk7Ci0gICAgICAgICAgICB0eSA9IC0odHkgPD0gdGl0bGVIZWlnaHQgPyBNYXRoLm1heCh0eSwgMCkgOiBwaW5Mb2ModHkKLSAgICAgICAgICAgICAgICAgICAgLSB0aXRsZUhlaWdodCwgZ2V0Vmlld0hlaWdodCgpLCBNYXRoLnJvdW5kKG1Db250ZW50SGVpZ2h0Ci0gICAgICAgICAgICAgICAgICAgICogem9vbVNjYWxlKSkgKyB0aXRsZUhlaWdodCkgKyBtU2Nyb2xsWTsKLSAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUodHgsIHR5KTsKLSAgICAgICAgICAgIGNhbnZhcy5zY2FsZSh6b29tU2NhbGUsIHpvb21TY2FsZSk7Ci0gICAgICAgICAgICBpZiAoaW5FZGl0aW5nTW9kZSgpICYmICFtTmVlZFRvQWRqdXN0V2ViVGV4dFZpZXcKLSAgICAgICAgICAgICAgICAgICAgJiYgbVpvb21TY2FsZSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgLy8gVGhlIFdlYlRleHRWaWV3IGlzIHVwLiAgS2VlcCB0cmFjayBvZiB0aGlzIHNvIHdlIGNhbiBhZGp1c3QKLSAgICAgICAgICAgICAgICAvLyBpdHMgc2l6ZSBhbmQgcGxhY2VtZW50IHdoZW4gd2UgZmluaXNoIHpvb21pbmcKLSAgICAgICAgICAgICAgICBtTmVlZFRvQWRqdXN0V2ViVGV4dFZpZXcgPSB0cnVlOwotICAgICAgICAgICAgICAgIC8vIElmIGl0IGlzIGluIHBhc3N3b3JkIG1vZGUsIHR1cm4gaXQgb2ZmIHNvIGl0IGRvZXMgbm90IGRyYXcKLSAgICAgICAgICAgICAgICAvLyBtaXNwbGFjZWQuCi0gICAgICAgICAgICAgICAgaWYgKG5hdGl2ZUZvY3VzQ2FuZGlkYXRlSXNQYXNzd29yZCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1XZWJUZXh0Vmlldy5zZXRJblBhc3N3b3JkKGZhbHNlKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9CisgICAgICAgICAgICBtWm9vbU1hbmFnZXIuYW5pbWF0ZVpvb20oY2FudmFzKTsKICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGNhbnZhcy5zY2FsZShtQWN0dWFsU2NhbGUsIG1BY3R1YWxTY2FsZSk7CisgICAgICAgICAgICBjYW52YXMuc2NhbGUobVpvb21NYW5hZ2VyLmdldFNjYWxlKCksIG1ab29tTWFuYWdlci5nZXRTY2FsZSgpKTsKICAgICAgICAgfQogCiAgICAgICAgIGJvb2xlYW4gVUlBbmltYXRpb25zUnVubmluZyA9IGZhbHNlOwpAQCAtMzQ1NiwyNSArMzMwOCwyNSBAQAogICAgICAgICAgICAgaW52YWxpZGF0ZSgpOwogICAgICAgICB9CiAgICAgICAgIG1XZWJWaWV3Q29yZS5kcmF3Q29udGVudFBpY3R1cmUoY2FudmFzLCBjb2xvciwKLSAgICAgICAgICAgICAgICAoYW5pbWF0ZVpvb20gfHwgbVByZXZpZXdab29tT25seSB8fCBVSUFuaW1hdGlvbnNSdW5uaW5nKSwKKyAgICAgICAgICAgICAgICAobVpvb21NYW5hZ2VyLmlzWm9vbUFuaW1hdGluZygpIHx8IFVJQW5pbWF0aW9uc1J1bm5pbmcpLAogICAgICAgICAgICAgICAgIGFuaW1hdGVTY3JvbGwpOwogICAgICAgICBpZiAobU5hdGl2ZUNsYXNzID09IDApIHJldHVybjsKICAgICAgICAgLy8gZGVjaWRlIHdoaWNoIGFkb3JubWVudHMgdG8gZHJhdwogICAgICAgICBpbnQgZXh0cmFzID0gRFJBV19FWFRSQVNfTk9ORTsKKyAgICAgICAgaWYgKERlYnVnRmxhZ3MuV0VCX1ZJRVcpIHsKKyAgICAgICAgICAgIExvZy52KExPR1RBRywgIm1GaW5kSXNVcD0iICsgbUZpbmRJc1VwCisgICAgICAgICAgICAgICAgICAgICsgIiBtU2VsZWN0aW5nVGV4dD0iICsgbVNlbGVjdGluZ1RleHQKKyAgICAgICAgICAgICAgICAgICAgKyAiIG5hdGl2ZVBhZ2VTaG91bGRIYW5kbGVTaGlmdEFuZEFycm93cygpPSIKKyAgICAgICAgICAgICAgICAgICAgKyBuYXRpdmVQYWdlU2hvdWxkSGFuZGxlU2hpZnRBbmRBcnJvd3MoKQorICAgICAgICAgICAgICAgICAgICArICIgYW5pbWF0ZVpvb209IiArIGFuaW1hdGVab29tKTsKKyAgICAgICAgfQogICAgICAgICBpZiAobUZpbmRJc1VwKSB7Ci0gICAgICAgICAgICAvLyBXaGVuIHRoZSBGaW5kRGlhbG9nIGlzIHVwLCBvbmx5IGRyYXcgdGhlIG1hdGNoZXMgaWYgd2UgYXJlIG5vdCBpbgotICAgICAgICAgICAgLy8gdGhlIHByb2Nlc3Mgb2Ygc2Nyb2xsaW5nIHRoZW0gaW50byB2aWV3LgotICAgICAgICAgICAgaWYgKCFhbmltYXRlU2Nyb2xsKSB7Ci0gICAgICAgICAgICAgICAgZXh0cmFzID0gRFJBV19FWFRSQVNfRklORDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIGlmIChtU2hpZnRJc1ByZXNzZWQgJiYgIW5hdGl2ZUZvY3VzSXNQbHVnaW4oKSkgewotICAgICAgICAgICAgaWYgKCFhbmltYXRlWm9vbSAmJiAhbVByZXZpZXdab29tT25seSkgewotICAgICAgICAgICAgICAgIGV4dHJhcyA9IERSQVdfRVhUUkFTX1NFTEVDVElPTjsKLSAgICAgICAgICAgICAgICBuYXRpdmVTZXRTZWxlY3Rpb25SZWdpb24obVRvdWNoU2VsZWN0aW9uIHx8IG1FeHRlbmRTZWxlY3Rpb24pOwotICAgICAgICAgICAgICAgIG5hdGl2ZVNldFNlbGVjdGlvblBvaW50ZXIoIW1Ub3VjaFNlbGVjdGlvbiwgbUludkFjdHVhbFNjYWxlLAotICAgICAgICAgICAgICAgICAgICAgICAgbVNlbGVjdFgsIG1TZWxlY3RZIC0gZ2V0VGl0bGVIZWlnaHQoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIG1FeHRlbmRTZWxlY3Rpb24pOwotICAgICAgICAgICAgfQorICAgICAgICAgICAgZXh0cmFzID0gRFJBV19FWFRSQVNfRklORDsKKyAgICAgICAgfSBlbHNlIGlmIChtU2VsZWN0aW5nVGV4dCkgeworICAgICAgICAgICAgZXh0cmFzID0gRFJBV19FWFRSQVNfU0VMRUNUSU9OOworICAgICAgICAgICAgbmF0aXZlU2V0U2VsZWN0aW9uUG9pbnRlcihtRHJhd1NlbGVjdGlvblBvaW50ZXIsCisgICAgICAgICAgICAgICAgICAgIG1ab29tTWFuYWdlci5nZXRJbnZTY2FsZSgpLAorICAgICAgICAgICAgICAgICAgICBtU2VsZWN0WCwgbVNlbGVjdFkgLSBnZXRUaXRsZUhlaWdodCgpKTsKICAgICAgICAgfSBlbHNlIGlmIChkcmF3Q3Vyc29yUmluZykgewogICAgICAgICAgICAgZXh0cmFzID0gRFJBV19FWFRSQVNfQ1VSU09SX1JJTkc7CiAgICAgICAgIH0KQEAgLTM0ODMsMTEgKz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JldHVybiBmYWxzZTsKICAgICAgICAgfQogCiAgICAgICAgIGlmIChrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfU0hJRlRfTEVGVAogICAgICAgICAgICAgICAgIHx8IGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9TSElGVF9SSUdIVCkgewotICAgICAgICAgICAgaWYgKG5hdGl2ZUZvY3VzSXNQbHVnaW4oKSkgeworICAgICAgICAgICAgaWYgKG5hdGl2ZVBhZ2VTaG91bGRIYW5kbGVTaGlmdEFuZEFycm93cygpKSB7CiAgICAgICAgICAgICAgICAgbVNoaWZ0SXNQcmVzc2VkID0gdHJ1ZTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoIW5hdGl2ZUN1cnNvcldhbnRzS2V5RXZlbnRzKCkgJiYgIW1TaGlmdElzUHJlc3NlZCkgewotICAgICAgICAgICAgICAgIHNldFVwU2VsZWN0WFkoKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoIW5hdGl2ZUN1cnNvcldhbnRzS2V5RXZlbnRzKCkgJiYgIW1TZWxlY3RpbmdUZXh0KSB7CisgICAgICAgICAgICAgICAgc2V0VXBTZWxlY3QoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCkBAIC0zODQ0LDExICszNjk2LDExIEBACiAgICAgICAgIGlmIChrZXlDb2RlID49IEtleUV2ZW50LktFWUNPREVfRFBBRF9VUAogICAgICAgICAgICAgICAgICYmIGtleUNvZGUgPD0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1JJR0hUKSB7CiAgICAgICAgICAgICBzd2l0Y2hPdXREcmF3SGlzdG9yeSgpOwotICAgICAgICAgICAgaWYgKG5hdGl2ZUZvY3VzSXNQbHVnaW4oKSkgewotICAgICAgICAgICAgICAgIGxldFBsdWdpbkhhbmRsZU5hdktleShrZXlDb2RlLCBldmVudC5nZXRFdmVudFRpbWUoKSwgdHJ1ZSk7CisgICAgICAgICAgICBpZiAobmF0aXZlUGFnZVNob3VsZEhhbmRsZVNoaWZ0QW5kQXJyb3dzKCkpIHsKKyAgICAgICAgICAgICAgICBsZXRQYWdlSGFuZGxlTmF2S2V5KGtleUNvZGUsIGV2ZW50LmdldEV2ZW50VGltZSgpLCB0cnVlKTsKICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChtU2hpZnRJc1ByZXNzZWQpIHsKKyAgICAgICAgICAgIGlmIChtU2VsZWN0aW5nVGV4dCkgewogICAgICAgICAgICAgICAgIGludCB4UmF0ZSA9IGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX0xFRlQKICAgICAgICAgICAgICAgICAgICAgPyAtMSA6IGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1JJR0hUID8gMSA6IDA7CiAgICAgICAgICAgICAgICAgaW50IHlSYXRlID0ga2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX0RQQURfVVAgPwpAQCAtMzg2OCw3ICszNzIwLDcgQEAKICAgICAgICAgaWYgKGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX0NFTlRFUikgewogICAgICAgICAgICAgc3dpdGNoT3V0RHJhd0hpc3RvcnkoKTsKICAgICAgICAgICAgIGlmIChldmVudC5nZXRSZXBlYXRDb3VudCgpID09IDApIHsKLSAgICAgICAgICAgICAgICBpZiAobVNoaWZ0SXNQcmVzc2VkICYmICFuYXRpdmVGb2N1c0lzUGx1Z2luKCkpIHsKKyAgICAgICAgICAgICAgICBpZiAobVNlbGVjdGluZ1RleHQpIHsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7IC8vIGRpc2NhcmQgcHJlc3MgaWYgY29weSBpbiBwcm9ncmVzcwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBtR290Q2VudGVyRG93biA9IHRydWU7CkBAIC0zODg2LDEwICszNzM4LDggQEAKICAgICAgICAgaWY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HkudWlPdmVycmlkZUtleUV2ZW50KGV2ZW50KQorICAgICAgICAgICAgICAgIHx8IChtQWNjZXNzaWJpbGl0eUluamVjdG9yICE9IG51bGwgJiYgbUFjY2Vzc2liaWxpdHlJbmplY3Rvci5vbktleUV2ZW50KGV2ZW50KSkpIHsKICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQogCiAgICAgICAgIGlmIChrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfU0hJRlRfTEVGVAogICAgICAgICAgICAgICAgIHx8IGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9TSElGVF9SSUdIVCkgewotICAgICAgICAgICAgaWYgKG5hdGl2ZUZvY3VzSXNQbHVnaW4oKSkgeworICAgICAgICAgICAgaWYgKG5hdGl2ZVBhZ2VTaG91bGRIYW5kbGVTaGlmdEFuZEFycm93cygpKSB7CiAgICAgICAgICAgICAgICAgbVNoaWZ0SXNQcmVzc2VkID0gZmFsc2U7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGNvbW1pdENvcHkoKSkgeworICAgICAgICAgICAgfSBlbHNlIGlmIChjb3B5U2VsZWN0aW9uKCkpIHsKKyAgICAgICAgICAgICAgICBzZWxlY3Rpb25Eb25lKCk7CiAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIAogICAgICAgICBpZiAoa2V5Q29kZSA+PSBLZXlFdmVudC5LRVlDT0RFX0RQQURfVVAKICAgICAgICAgICAgICAgICAmJiBrZXlDb2RlIDw9IEtleUV2ZW50LktFWUNPREVfRFBBRF9SSUdIVCkgewotICAgICAgICAgICAgaWYgKG5hdGl2ZUZvY3VzSXNQbHVnaW4oKSkgewotICAgICAgICAgICAgICAgIGxldFBsdWdpbkhhbmRsZU5hdktleShrZXlDb2RlLCBldmVudC5nZXRFdmVudFRpbWUoKSwgZmFsc2UpOworICAgICAgICAgICAgaWYgKG5hdGl2ZVBhZ2VTaG91bGRIYW5kbGVTaGlmdEFuZEFycm93cygpKSB7CisgICAgICAgICAgICAgICAgbGV0UGFnZUhhbmRsZU5hdktleShrZXlDb2RlLCBldmVudC5nZXRFdmVudFRpbWUoKSwgZmFsc2UpOwogICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgLy8gYWx3YXlzIGhhbmRsZSB0aGUgbmF2aWdhdGlvbiBrZXlzIGluIHRoZSBVSSB0aHJlYWQKQEAgLTQwMDAsMTEgKzM4NTQsMTMgQEAKICAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhMT05HX1BSRVNTX0NFTlRFUik7CiAgICAgICAgICAgICBtR290Q2VudGVyRG93biA9IGZhbHNlOwogCi0gICAgICAgICAgICBpZiAobVNoaWZ0SXNQcmVzc2VkICYmICFuYXRpdmVGb2N1c0lzUGx1Z2luKCkpIHsKKyAgICAgICAgICAgIGlmIChtU2VsZWN0aW5nVGV4dCkgewogICAgICAgICAgICAgICAgIGlmIChtRXh0ZW5kU2VsZWN0aW9uKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvbW1pdENvcHkoKTsKKyAgICAgICAgICAgICAgICAgICAgY29weVNlbGVjdGlvbigpOworICAgICAgICAgICAgICAgICAgICBzZWxlY3Rpb25Eb25lKCk7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgbUV4dGVuZFNlbGVjdGlvbiA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVNldEV4dGVuZFNlbGVjdGlvbigpOwogICAgICAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7IC8vIGRyYXcgdGhlIGktYmVhbSBpbnN0ZWFkIG9mIHRoZSBhcnJvdwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsgLy8gZGlzY2FyZCBwcmVzcyBpZiBjb3B5IGluIHByb2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dERpYWxvZ0Rpc21pc3NlZCgpIHsKKyAgICAgICAgbVNlbGVjdGluZ1RleHQgPSBmYWxzZTsKKyAgICAgICAgV2ViVmlld0NvcmUucmVzdW1lVXBkYXRlUGljdHVyZShtV2ViVmlld0NvcmUpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEBoaWRlIHBlbmRpbmcgQVBJIGNvdW5jaWwgYXBwcm92YWwuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2VsZWN0aW9uRG9uZSgpIHsKKyAgICAgICAgaWYgKG1TZWxlY3RpbmdUZXh0KSB7CisgICAgICAgICAgICBnZXRXZWJDaHJvbWVDbGllbnQoKS5vblNlbGVjdGlvbkRvbmUoKTsKKyAgICAgICAgICAgIGludmFsaWRhdGUoKTsgLy8gcmVkcmF3IHdpdGhvdXQgc2VsZWN0aW9uCisgICAgICAgICAgICBub3RpZnlTZWxlY3REaWFsb2dEaXNtaXNzZWQoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEBoaWRlIHBlbmRpbmcgQVBJIGNvdW5jaWwgYXBwcm92YWwuCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gY29weVNlbGVjdGlvbigpIHsKICAgICAgICAgYm9vbGVhbiBjb3BpZWRTb21ldGhpbmcgPSBmYWxzZTsKLSAgICAgICAgaWYgKG1FeHRlbmRTZWxlY3Rpb24pIHsKLSAgICAgICAgICAgIFN0cmluZyBzZWxlY3Rpb24gPSBuYXRpdmVHZXRTZWxlY3Rpb24oKTsKLSAgICAgICAgICAgIGlmIChzZWxlY3Rpb24gIT0gIiIpIHsKLSAgICAgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgewotICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJjb21taXRDb3B5IFwiIiArIHNlbGVjdGlvbiArICJcIiIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBUb2FzdC5tYWtlVGV4dChtQ29udGV4dAotICAgICAgICAgICAgICAgICAgICAgICAgLCBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy50ZXh0X2NvcGllZAotICAgICAgICAgICAgICAgICAgICAgICAgLCBUb2FzdC5MRU5HVEhfU0hPUlQpLnNob3coKTsKLSAgICAgICAgICAgICAgICBjb3BpZWRTb21ldGhpbmcgPSB0cnVlOwotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIElDbGlwYm9hcmQgY2xpcCA9IElDbGlwYm9hcmQuU3R1Yi5hc0ludGVyZmFjZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBTZXJ2aWNlTWFuYWdlci5nZXRTZXJ2aWNlKCJjbGlwYm9hcmQiKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xpcC5zZXRDbGlwYm9hcmRUZXh0KHNlbGVjdGlvbik7Ci0gICAgICAgICAgICAgICAgfSBjYXRjaCAoYW5kcm9pZC5vcy5SZW1vdGVFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dUQUcsICJDbGlwYm9hcmQgZmFpbGVkIiwgZSk7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICBTdHJpbmcgc2VsZWN0aW9uID0gZ2V0U2VsZWN0aW9uKCk7CisgICAgICAgIGlmIChzZWxlY3Rpb24gIT0gIiIpIHsKKyAgICAgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXKSB7CisgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAiY29weVNlbGVjdGlvbiBcIiIgKyBzZWxlY3Rpb24gKyAiXCIiKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1FeHRlbmRTZWxlY3Rpb24gPSBmYWxzZTsKKyAgICAgICAgICAgIFRvYXN0Lm1ha2VUZXh0KG1Db250ZXh0CisgICAgICAgICAgICAgICAgICAgICwgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcudGV4dF9jb3BpZWQKKyAgICAgICAgICAgICAgICAgICAgLCBUb2FzdC5MRU5HVEhfU0hPUlQpLnNob3coKTsKKyAgICAgICAgICAgIGNvcGllZFNvbWV0aGluZyA9IHRydWU7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIElDbGlwYm9hcmQgY2xpcCA9IElDbGlwYm9hcmQuU3R1Yi5hc0ludGVyZmFjZSgKKyAgICAgICAgICAgICAgICAgICAgICAgIFNlcnZpY2VNYW5hZ2VyLmdldFNlcnZpY2UoImNsaXBib2FyZCIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNsaXAuc2V0Q2xpcGJvYXJkVGV4dChzZWxlY3Rpb24pOworICAgICAgICAgICAgfSBjYXRjaCAoYW5kcm9pZC5vcy5SZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy5lKExPR1RBRywgIkNsaXBib2FyZCBmYWlsZWQiLCBlKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICBtU2hpZnRJc1ByZXNzZWQgPSBmYWxzZTsKICAgICAgICAgaW52YWxpZGF0ZSgpOyAvLyByZW1vdmUgc2VsZWN0aW9uIHJlZ2lvbiBhbmQgcG9pbnRlcgotICAgICAgICBpZiAobVRvdWNoTW9kZSA9PSBUT1VDSF9TRUxFQ1RfTU9ERSkgewotICAgICAgICAgICAgbVRvdWNoTW9kZSA9IFRPVUNIX0lOSVRfTU9ERTsKLSAgICAgICAgfQogICAgICAgICByZXR1cm4gY29waWVkU29tZXRoaW5nOwogICAgIH0KIAorICAgIC8qKgorICAgICAqIEBoaWRlIHBlbmRpbmcgQVBJIGNvdW5jaWwgYXBwcm92YWwuCisgICAgICovCisgICAgcHVibGljIFN0cmluZyBnZXRTZWxlY3Rpb24oKSB7CisgICAgICAgIGlmIChtTmF0aXZlQ2xhc3MgPT0gMCkgcmV0dXJuICIiOworICAgICAgICByZXR1cm4gbmF0aXZlR2V0U2VsZWN0aW9uKCk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AgIH0KKyAgICB9CisKICAgICAvKioKICAgICAgKiBAZGVwcmVjYXRlZCBXZWJWaWV3IG5vIGxvbmdlciBuZWVkcyB0byBpbXBsZW1lbnQKICAgICAgKiBWaWV3R3JvdXAuT25IaWVyYXJjaHlDaGFuZ2VMaXN0ZW5lci4gIFRoaXMgbWV0aG9kIGRvZXMgbm90aGluZyBub3cuCkBAIC00MTYzLDE3ICs0MDgwLDE0IEBACiAgICAgICAgICAgICAgICAgLy8gZmFsc2UgZm9yIHRoZSBmaXJzdCBwYXJhbWV0ZXIKICAgICAgICAgICAgIH0KICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGlmIChtV2ViVmlld0NvcmUgIT0gbnVsbCAmJiBnZXRTZXR0aW5ncygpLmdldEJ1aWx0SW5ab29tQ29udHJvbHMoKQotICAgICAgICAgICAgICAgICAgICAmJiAobVpvb21CdXR0b25zQ29udHJvbGxlciA9PSBudWxsIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIW1ab29tQnV0dG9uc0NvbnRyb2xsZXIuaXNWaXNpYmxlKCkpKSB7CisgICAgICAgICAgICBpZiAoIW1ab29tTWFuYWdlci5pc1pvb21QaWNrZXJWaXNpYmxlKCkpIHsKICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIFRoZSB6b29tIGNvbnRyb2xzIGNvbWUgaW4gdGhlaXIgb3duIHdpbmRvdywgc28gb3VyIHdpbmRvdwotICAgICAgICAgICAgICAgICAqIGxvc2VzIGZvY3VzLiBPdXIgcG9saWN5IGlzIHRvIG5vdCBkcmF3IHRoZSBjdXJzb3IgcmluZyBpZgotICAgICAgICAgICAgICAgICAqIG91ciB3aW5kb3cgaXMgbm90IGZvY3VzZWQsIGJ1dCB0aGlzIGlzIGFuIGV4Y2VwdGlvbiBzaW5jZQorICAgICAgICAgICAgICAgICAqIFRoZSBleHRlcm5hbCB6b29tIGNvbnRyb2xzIGNvbWUgaW4gdGhlaXIgb3duIHdpbmRvdywgc28gb3VyCisgICAgICAgICAgICAgICAgICogd2luZG93IGxvc2VzIGZvY3VzLiBPdXIgcG9saWN5IGlzIHRvIG5vdCBkcmF3IHRoZSBjdXJzb3IgcmluZworICAgICAgICAgICAgICAgICAqIGlmIG91ciB3aW5kb3cgaXMgbm90IGZvY3VzZWQsIGJ1dCB0aGlzIGlzIGFuIGV4Y2VwdGlvbiBzaW5jZQogICAgICAgICAgICAgICAgICAqIHRoZSB1c2VyIGNhbiBzdGlsbCBuYXZpZ2F0ZSB0aGUgd2ViIHBhZ2Ugd2l0aCB0aGUgem9vbQogICAgICAgICAgICAgICAgICAqIGNvbnRyb2xzIHNob3dpbmcuCiAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgLy8gSWYgb3VyIHdpbmRvdyBoYXMgbG9zdCBmb2N1cywgc3RvcCBkcmF3aW5nIHRoZSBjdXJzb3IgcmluZwogICAgICAgICAgICAgICAgIG1EcmF3Q3Vyc29yUmluZyA9IGZhbHNlOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgbUdvdEtleURvd24gPSBmYWxzZTsKQEAgLTQyNjIsODEgKzQxNzYsMjQgQEAKICAgICAgICAgICAgIC8vIHN5c3RlbSB3b24ndCBjYWxsIG9uU2l6ZUNoYW5nZWQgaWYgdGhlIGRpbWVuc2lvbiBpcyBub3QgY2hhbmdlZC4KICAgICAgICAgICAgIC8vIEluIHRoaXMgY2FzZSwgd2UgbmVlZCB0byBjYWxsIHNlbmRWaWV3U2l6ZVpvb20oKSBleHBsaWNpdGx5IHRvCiAgICAgICAgICAgICAvLyBub3RpZnkgdGhlIFdlYktpdCBhYm91dCB0aGUgbmV3IGRpbWVuc2lvbnMuCi0gICAgICAgICAgICBzZW5kVmlld1NpemVab29tKCk7CisgICAgICAgICAgICBzZW5kVmlld1NpemVab29tKGZhbHNlKTsKICAgICAgICAgfQogICAgICAgICByZXR1cm4gY2hhbmdlZDsKICAgICB9CiAKLSAgICBwcml2YXRlIHN0YXR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cyBpbiBwYXNzd29yZCBtb2RlLCB0dXJuIGl0IG9mZiBzbyBpdCBkb2VzIG5vdCBkcmF3Ci0gICAgICAgICAgICAvLyBtaXNwbGFjZWQuCi0gICAgICAgICAgICBpZiAoaW5FZGl0aW5nTW9kZSgpICYmIG5hdGl2ZUZvY3VzQ2FuZGlkYXRlSXNQYXNzd29yZCgpKSB7Ci0gICAgICAgICAgICAgICAgbVdlYlRleHRWaWV3LnNldEluUGFzc3dvcmQoZmFsc2UpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtVmlld01hbmFnZXIuc3RhcnRab29tKCk7Ci0KLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHZvaWQgb25TY2FsZUVuZChTY2FsZUdlc3R1cmVEZXRlY3RvciBkZXRlY3RvcikgewotICAgICAgICAgICAgaWYgKG1QcmV2aWV3Wm9vbU9ubHkpIHsKLSAgICAgICAgICAgICAgICBtUHJldmlld1pvb21Pbmx5ID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgbUFuY2hvclggPSB2aWV3VG9Db250ZW50WCgoaW50KSBtWm9vbUNlbnRlclggKyBtU2Nyb2xsWCk7Ci0gICAgICAgICAgICAgICAgbUFuY2hvclkgPSB2aWV3VG9Db250ZW50WSgoaW50KSBtWm9vbUNlbnRlclkgKyBtU2Nyb2xsWSk7Ci0gICAgICAgICAgICAgICAgLy8gZG9uJ3QgcmVmbG93IHdoZW4gem9vbSBpbjsgd2hlbiB6b29tIG91dCwgZG8gcmVmbG93IGlmIHRoZQotICAgICAgICAgICAgICAgIC8vIG5ldyBzY2FsZSBpcyBhbG1vc3QgbWluaW11bSBzY2FsZTsKLSAgICAgICAgICAgICAgICBib29sZWFuIHJlZmxvd05vdyA9IChtQWN0dWFsU2NhbGUgLSBtTWluWm9vbVNjYWxlCi0gICAgICAgICAgICAgICAgICAgICAgICA8PSBNSU5JTVVNX1NDQUxFX0lOQ1JFTUVOVCk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ICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgc2NhbGUgPSBNYXRoLm1heChzY2FsZSwgbUFjdHVhbFNjYWxlICogMC44Zik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1ab29tQ2VudGVyWCA9IGRldGVjdG9yLmdldEZvY3VzWCgpOwotICAgICAgICAgICAgICAgIG1ab29tQ2VudGVyWSA9IGRldGVjdG9yLmdldEZvY3VzWSgpOwotICAgICAgICAgICAgICAgIHNldE5ld1pvb21TY2FsZShzY2FsZSwgZmFsc2UsIGZhbHNlKTsKLSAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLSAgICB9Ci0KICAgICBwcml2YXRlIGJvb2xlYW4gaGl0Rm9jdXNlZFBsdWdpbihpbnQgY29udGVudFgsIGludCBjb250ZW50WSkgewogICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgewogICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAibmF0aXZlRm9jdXNJc1BsdWdpbigpPSIgKyBuYXRpdmVGb2N1c0lzUGx1Z2luKCkpOwpAQCAtNDY3OSw3ICs0NDYzLDcgQEAKIAogICAgIHByaXZhdGUgYm9vbGVhbiBzaG91bGRGb3J3YXJkVG91Y2hFdmVudCgpIHsKICAgICAgICAgcmV0dXJuIG1GdWxsU2NyZWVuSG9sZGVyICE9IG51bGwgfHwgKG1Gb3J3YXJkVG91Y2hFdmVudHMKLSAgICAgICAgICAgICAgICAmJiBtVG91Y2hNb2RlICE9IFRPVUNIX1NFTEVDVF9NT0RFCisgICAgICAgICAgICAgICAgJiYgIW1TZWxlY3RpbmdUZXh0CiAgICAgICAgICAgICAgICAgJiYgbVByZXZlbnREZWZhdWx0ICE9IFBSRVZFTlRfREVGQVVMVF9JR05PUkUpOwogICAgIH0KIApAQCAtNDY4Nyw2ICs0NDcxLDIyIEBACiAgICAgICAgIHJldHVybiBtRnVsbFNjcmVlbkhvbGRlciAhPSBudWxsOwogICAgIH0KIAorICAgIHZvaWQgb25QaW5jaFRvWm9vbUFuaW1hdGlvblN0YXJ0KCkgeworICAgICAgICAvLyBjYW5jZWwgdGhlIHNpbmdsZSB0b3VjaCBoYW5kbGluZworICAgICAgICBjYW5jZWxUb3VjaCgpOworICAgICAgICBvblpvb21BbmltYXRpb25TdGFydCgpOworICAgIH0KKworICAgIHZvaWQgb25QaW5jaFRvWm9vbUFuaW1hdGlvbkVuZChTY2FsZUdlc3R1cmVEZXRlY3RvciBkZXRlY3RvcikgeworICAgICAgICBvblpvb21BbmltYXRpb25FbmQoKTsKKyAgICAgICAgLy8gc3RhcnQgYSBkcmFnLCBUT1VDSF9QSU5DSF9EUkFHLCBjYW4ndCB1c2UgVE9VQ0hfSU5JVF9NT0RFIGFzCisgICAgICAgIC8vIGl0IG1heSB0cmlnZ2VyIHRoZSB1bndhbnRlZCBjbGljaywgY2FuJ3QgdXNlIFRPVUNIX0RSQUdfTU9ERQorICAgICAgICAvLyBhcyBpdCBtYXkgdHJpZ2dlciB0aGUgdW53YW50ZWQgZmxpbmcuCisgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9QSU5DSF9EUkFHOworICAgICAgICBtQ29uZmlybU1vdmUgPSB0cnVlOworICAgICAgICBzdGFydFRvdWNoKGRldGVjdG9yLmdldEZvY3VzWCgpLCBkZXRlY3Rvci5nZXRGb2N1c1koKSwgbUxhc3RUb3VjaFRpbWUpOworICAgIH0KKwogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBib29sZWFuIG9uVG91Y2hFdmVudChNb3Rpb25FdmVudCBldikgewogICAgICAgICBpZiAobU5hdGl2ZUNsYXNzID09IDAgfHwgIWlzQ2xpY2thYmxlKCkgfHwgIWlzTG9uZ0NsaWNrYWJsZSgpKSB7CkBAIC00NzA0LDMyICs0NTA0LDM2IEBACiAKICAgICAgICAgLy8gRklYTUU6IHdlIG1heSBjb25zaWRlciB0byBnaXZlIFdlYktpdCBhbiBvcHRpb24gdG8gaGFuZGxlIG11bHRpLXRvdWNoCiAgICAgICAgIC8vIGV2ZW50cyBsYXRlci4KLSAgICAgICAgaWYgKG1TdXBwb3J0TXVsdGlUb3VjaCAmJiBldi5nZXRQb2ludGVyQ291bnQoKSA+IDEpIHsKLSAgICAgICAgICAgIGlmIChtTWluWm9vbVNjYWxlIDwgbU1heFpvb21TY2FsZSkgewotICAgICAgICAgICAgICAgIG1TY2FsZURldGVjdG9yLm9uVG91Y2hFdmVudChldik7Ci0gICAgICAgICAgICAgICAgaWYgKG1TY2FsZURldGVjdG9yLmlzSW5Qcm9ncmVzcygpKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1MYXN0VG91Y2hUaW1lID0gZXZlbnRUaW1lOworICAgICAgICBpZiAobVpvb21NYW5hZ2VyLnN1cHBvcnRzTXVsdGlUb3VjaFpvb20oKSAmJiBldi5nZXRQb2ludGVyQ291bnQoKSA+IDEpIHsKKworICAgICAgICAgICAgLy8gaWYgdGhlIHBhZ2UgZGlzYWxsb3dzIHpvb20sIHRoZW4gc2tpcCBtdWx0aS1wb2ludGVyIGFjdGlvbgorICAgICAgICAgICAgaWYgKG1ab29tTWFuYWdlci5pc1pvb21TY2FsZUZpeGVkKCkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgU2NhbGVHZXN0dXJlRGV0ZWN0b3IgZGV0ZWN0b3IgPSBtWm9vbU1hbmFnZXIuZ2V0TXVsdGlUb3VjaEdlc3R1cmVEZXRlY3RvcigpOworICAgICAgICAgICAgZGV0ZWN0b3Iub25Ub3VjaEV2ZW50KGV2KTsKKworICAgICAgICAgICAgaWYgKGRldGVjdG9yLmlzSW5Qcm9ncmVzcygpKSB7CisgICAgICAgICAgICAgICAgbUxhc3RUb3VjaFRpbWUgPSBldmVudFRpbWU7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHggPSBkZXRlY3Rvci5nZXRGb2N1c1goKTsKKyAgICAgICAgICAgIHkgPSBkZXRlY3Rvci5nZXRGb2N1c1koKTsKKyAgICAgICAgICAgIGFjdGlvbiA9IGV2LmdldEFjdGlvbigpICYgTW90aW9uRXZlbnQuQUNUSU9OX01BU0s7CisgICAgICAgICAgICBpZiAoYWN0aW9uID09IE1vdGlvbkV2ZW50LkFDVElPTl9QT0lOVEVSX0RPV04pIHsKKyAgICAgICAgICAgICAgICBjYW5jZWxUb3VjaCgpOworICAgICAgICAgICAgICAgIGFjdGlvbiA9IE1vdGlvbkV2ZW50LkFDVElPTl9ET1dOOworICAgICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24gPT0gTW90aW9uRXZlbnQuQUNUSU9OX1BPSU5URVJfVVApIHsKKyAgICAgICAgICAgICAgICAvLyBzZXQgbUxhc3RUb3VjaFgvWSB0byB0aGUgcmVtYWluaW5nIHBvaW50CisgICAgICAgICAgICAgICAgbUxhc3RUb3VjaFggPSB4OworICAgICAgICAgICAgICAgIG1MYXN0VG91Y2hZID0geTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uID09IE1vdGlvbkV2ZW50LkFDVElPTl9NT1ZFKSB7CisgICAgICAgICAgICAgICAgLy8gbmVnYXRpdmUgeCBvciB5IGluZGljYXRlIGl0IGlzIG9uIHRoZSBlZGdlLCBza2lwIGl0LgorICAgICAgICAgICAgICAgIGlmICh4IDwgMCB8fCB5IDwgMCkgewogICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgeCA9IG1TY2FsZURldGVjdG9yLmdldEZvY3VzWCgpOwotICAgICAgICAgICAgICAgIHkgPSBtU2NhbGVEZXRlY3Rvci5nZXRGb2N1c1koKTsKLSAgICAgICAgICAgICAgICBhY3Rpb24gPSBldi5nZXRBY3Rpb24oKSAmIE1vdGlvbkV2ZW50LkFDVElPTl9NQVNLOwotICAgICAgICAgICAgICAgIGlmIChhY3Rpb24gPT0gTW90aW9uRXZlbnQuQUNUSU9OX1BPSU5URVJfRE9XTikgewotICAgICAgICAgICAgICAgICAgICBjYW5jZWxUb3VjaCgpOwotICAgICAgICAgICAgICAgICAgICBhY3Rpb24gPSBNb3Rpb25FdmVudC5BQ1RJT05fRE9XTjsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbiA9PSBNb3Rpb25FdmVudC5BQ1RJT05fUE9JTlRFUl9VUCkgewotICAgICAgICAgICAgICAgICAgICAvLyBzZXQgbUxhc3RUb3VjaFgvWSB0byB0aGUgcmVtYWluaW5nIHBvaW50Ci0gICAgICAgICAgICAgICAgICAgIG1MYXN0VG91Y2hYID0geDsKLSAgICAgICAgICAgICAgICAgICAgbUxhc3RUb3VjaFkgPSB5OwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uID09IE1vdGlvbkV2ZW50LkFDVElPTl9NT1ZFKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIG5lZ2F0aXZlIHggb3IgeSBpbmRpY2F0ZSBpdCBpcyBvbiB0aGUgZWRnZSwgc2tpcCBpdC4KLSAgICAgICAgICAgICAgICAgICAgaWYgKHggPCAwIHx8IHkgPCAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgLy8gaWYgdGhlIHBhZ2UgZGlzYWxsb3cgem9vbSwgc2tpcCBtdWx0aS1wb2ludGVyIGFjdGlvbgotICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICAgfQogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgYWN0aW9uID0gZXYuZ2V0QWN0aW9uKCk7CkBAIC00NzY3LDE4ICs0NTcxLDExIEBACiAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9EUkFHX1NUQVJUX01PREU7CiAgICAgICAgICAgICAgICAgICAgIG1Db25maXJtTW92ZSA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhSRVNVTUVfV0VCQ09SRV9QUklPUklUWSk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmICghaW5GdWxsU2NyZWVuTW9kZSgpICYmIG1TaGlmdElzUHJlc3NlZCkgewotICAgICAgICAgICAgICAgICAgICBtU2VsZWN0WCA9IG1TY3JvbGxYICsgKGludCkgeDsKLSAgICAgICAgICAgICAgICAgICAgbVNlbGVjdFkgPSBtU2Nyb2xsWSArIChpbnQpIHk7Ci0gICAgICAgICAgICAgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9TRUxFQ1RfTU9ERTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKERlYnVnRmxhZ3MuV0VCX1ZJRVcpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgInNlbGVjdD0iICsgbVNlbGVjdFggKyAiLCIgKyBtU2VsZWN0WSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgbmF0aXZlTW92ZVNlbGVjdGlvbihjb250ZW50WCwgY29udGVudFksIGZhbHNlKTsKLSAgICAgICAgICAgICAgICAgICAgbVRvdWNoU2VsZWN0aW9uID0gbUV4dGVuZFNlbGVjdGlvbiA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsgLy8gZHJhdyB0aGUgaS1iZWFtIGluc3RlYWQgb2YgdGhlIGFycm93CiAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtUHJpdmF0ZUhhbmRsZXIuaGFzTWVzc2FnZXMoUkVMRUFTRV9TSU5HTEVfVEFQKSkgewogICAgICAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlTWVzc2FnZXMoUkVMRUFTRV9TSU5HTEVfVEFQKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGdldFNldHRpbmdzKCkuc3VwcG9ydFRvdWNoT25seSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVUb3VjaEhpZ2hsaWdodCh0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBpZiAoZGVsdGFYICogZGVsdGFYICsgZGVsdGFZICogZGVsdGFZIDwgbURvdWJsZVRhcFNsb3BTcXVhcmUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9ET1VCTEVfVEFQX01PREU7CiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CkBAIC00NzkwLDE3ICs0NTg3LDQ1IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnRYLCBjb250ZW50WSkgOiBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0gZWxzZSB7IC8vIHRoZSBub3JtYWwgY2FzZQotICAgICAgICAgICAgICAgICAgICBtUHJldmlld1pvb21Pbmx5ID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9JTklUX01PREU7CiAgICAgICAgICAgICAgICAgICAgIG1EZWZlclRvdWNoUHJvY2VzcyA9ICghaW5GdWxsU2NyZWVuTW9kZSgpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgbUZvcndhcmRUb3VjaEV2ZW50cykgPyBoaXRGb2N1c2VkUGx1Z2luKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnRYLCBjb250ZW50WSkgOiBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXdDb3JlLnNlbmRNZXNzYWdlKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV2ZW50SHViLlVQREFURV9GUkFNRV9DQUNIRV9JRl9MT0FESU5HKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGdldFNldHRpbmdzKCkuc3VwcG9ydFRvdWNoT25seSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBUb3VjaEhpZ2hsaWdodERhdGEgZGF0YSA9IG5ldyBUb3VjaEhpZ2hsaWdodERhdGEoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEubVggPSBjb250ZW50WDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEubVkgPSBjb250ZW50WTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEubVNsb3AgPSB2aWV3VG9Db250ZW50RGltZW5zaW9uKG1OYXZTbG9wKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1XZWJWaWV3Q29yZS5zZW5kTWVzc2FnZURlbGF5ZWQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV2ZW50SHViLkdFVF9UT1VDSF9ISUdITElHSFRfUkVDVFMsIGRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZpZXdDb25maWd1cmF0aW9uLmdldFRhcFRpbWVvdXQoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUdfVE9VQ0hfSElHSExJR0hUKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGdldFNldHRpbmdzKCkuZ2V0TmF2RHVtcCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaEhpZ2hsaWdodFggPSAoaW50KSB4ICsgbVNjcm9sbFg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaEhpZ2hsaWdodFkgPSAoaW50KSB5ICsgbVNjcm9sbFk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5wb3N0RGVsYXllZChuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoSGlnaGxpZ2h0WCA9IG1Ub3VjaEhpZ2hsaWdodFkgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgVE9VQ0hfSElHSExJR0hUX0VMQVBTRV9USU1FKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgaWYgKG1Mb2dFdmVudCAmJiBldmVudFRpbWUgLSBtTGFzdFRvdWNoVXBUaW1lIDwgMTAwMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudChFdmVudExvZ1RhZ3MuQlJPV1NFUl9ET1VCTEVfVEFQX0RVUkFUSU9OLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZXZlbnRUaW1lIC0gbUxhc3RUb3VjaFVwVGltZSksIGV2ZW50VGltZSk7CiAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKG1TZWxlY3RpbmdUZXh0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtRHJhd1NlbGVjdGlvblBvaW50ZXIgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1TZWxlY3Rpb25TdGFydGVkID0gbmF0aXZlU3RhcnRTZWxlY3Rpb24oY29udGVudFgsIGNvbnRlbnRZKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAic2VsZWN0PSIgKyBjb250ZW50WCArICIsIiArIGNvbnRlbnRZKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKKyAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAvLyBUcmlnZ2VyIHRoZSBsaW5rCiAgICAgICAgICAgICAgICAgaWYgKG1Ub3VjaE1vZGUgPT0gVE9VQ0hfSU5JVF9NT0RFCkBAIC00ODI0LDE3ICs0NjQ5LDE1IEBACiAgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVkgPSBjb250ZW50WTsKICAgICAgICAgICAgICAgICAgICAgICAgIHRlZC5tTWV0YVN0YXRlID0gZXYuZ2V0TWV0YVN0YXRlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVJlcHJvY2VzcyA9IG1EZWZlclRvdWNoUHJvY2VzczsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1XZWJWaWV3Q29yZS5zZW5kTWVzc2FnZShFdmVudEh1Yi5UT1VDSF9FVkVOVCwgdGVkKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtRGVmZXJUb3VjaFByb2Nlc3MpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzdGlsbCBuZWVkcyB0byBzZXQgdGhlbSBmb3IgY29tcHV0ZSBkZWx0YVgvWQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1MYXN0VG91Y2hYID0geDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdFRvdWNoWSA9IHk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1WaWV3WCA9IHg7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1WaWV3WSA9IHk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXdDb3JlLnNlbmRNZXNzYWdlKEV2ZW50SHViLlRPVUNIX0VWRU5ULCB0ZWQpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXdDb3JlLnNlbmRNZXNzYWdlKEV2ZW50SHViLlRPVUNIX0VWRU5ULCB0ZWQpOwogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpbkZ1bGxTY3JlZW5Nb2RlKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlTWVzc2FnZXMoUFJFVkVOVF9ERUZBVUxUX1RJTUVPVVQpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5zZW5kTWVzc2FnZURlbGF5ZWQobVByaXZhdGVIYW5kbGVyCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAub2J0YWluTWVzc2FnZShQUkVWRU5UX0RFRkFVTFRfVElNRU9VVCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aW9uLCAwKSwgVEFQX1RJTUVPVVQpOwpAQCAtNDg1NSwyNCArNDY3OCwyNCBAQAogICAgICAgICAgICAgICAgICAgICBpZiAobVRvdWNoTW9kZSA9PSBUT1VDSF9ET1VCTEVfVEFQX01PREUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9JTklUX01PREU7CiAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKGdldFNldHRpbmdzKCkuc3VwcG9ydFRvdWNoT25seSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVUb3VjaEhpZ2hsaWdodCh0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAvLyBwYXNzIHRoZSB0b3VjaCBldmVudHMgZnJvbSBVSSB0aHJlYWQgdG8gV2ViQ29yZSB0aHJlYWQKICAgICAgICAgICAgICAgICBpZiAoc2hvdWxkRm9yd2FyZFRvdWNoRXZlbnQoKSAmJiBtQ29uZmlybU1vdmUgJiYgKGZpcnN0TW92ZQogICAgICAgICAgICAgICAgICAgICAgICAgfHwgZXZlbnRUaW1lIC0gbUxhc3RTZW50VG91Y2hUaW1lID4gbUN1cnJlbnRUb3VjaEludGVydmFsKSkgewotICAgICAgICAgICAgICAgICAgICBtTGFzdFNlbnRUb3VjaFRpbWUgPSBldmVudFRpbWU7CiAgICAgICAgICAgICAgICAgICAgIFRvdWNoRXZlbnREYXRhIHRlZCA9IG5ldyBUb3VjaEV2ZW50RGF0YSgpOwogICAgICAgICAgICAgICAgICAgICB0ZWQubUFjdGlvbiA9IGFjdGlvbjsKICAgICAgICAgICAgICAgICAgICAgdGVkLm1YID0gY29udGVudFg7CiAgICAgICAgICAgICAgICAgICAgIHRlZC5tWSA9IGNvbnRlbnRZOwogICAgICAgICAgICAgICAgICAgICB0ZWQubU1ldGFTdGF0ZSA9IGV2LmdldE1ldGFTdGF0ZSgpOwogICAgICAgICAgICAgICAgICAgICB0ZWQubVJlcHJvY2VzcyA9IG1EZWZlclRvdWNoUHJvY2VzczsKKyAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXdDb3JlLnNlbmRNZXNzYWdlKEV2ZW50SHViLlRPVUNIX0VWRU5ULCB0ZWQpOworICAgICAgICAgICAgICAgICAgICBtTGFzdFNlbnRUb3VjaFRpbWUgPSBldmVudFRpbWU7CiAgICAgICAgICAgICAgICAgICAgIGlmIChtRGVmZXJUb3VjaFByb2Nlc3MpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRlZC5tVmlld1ggPSB4OwotICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1WaWV3WSA9IHk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtV2ViVmlld0NvcmUuc2VuZE1lc3NhZ2UoRXZlbnRIdWIuVE9VQ0hfRVZFTlQsIHRlZCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBtV2ViVmlld0NvcmUuc2VuZE1lc3NhZ2UoRXZlbnRIdWIuVE9VQ0hfRVZFTlQsIHRlZCk7CiAgICAgICAgICAgICAgICAgICAgIGlmIChmaXJzdE1vdmUgJiYgIWluRnVsbFNjcmVlbk1vZGUoKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnNlbmRNZXNzYWdlRGVsYXllZChtUHJpdmF0ZUhhbmRsZXIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLm9idGFpbk1lc3NhZ2UoUFJFVkVOVF9ERUZBVUxUX1RJTUVPVVQsCkBAIC00ODkyLDIwICs0NzE1LDIwIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG1Ub3VjaE1vZGUgPSAiICsgbVRvdWNoTW9kZSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIG1WZWxvY2l0eVRyYWNrZXIuYWRkTW92ZW1lbnQoZXYpOwotICAgICAgICAgICAgICAgIGlmIChtVG91Y2hNb2RlICE9IFRPVUNIX0RSQUdfTU9ERSkgewotICAgICAgICAgICAgICAgICAgICBpZiAobVRvdWNoTW9kZSA9PSBUT1VDSF9TRUxFQ1RfTU9ERSkgewotICAgICAgICAgICAgICAgICAgICAgICAgbVNlbGVjdFggPSBtU2Nyb2xsWCArIChpbnQpIHg7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtU2VsZWN0WSA9IG1TY3JvbGxZICsgKGludCkgeTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAieHRlbmQ9IiArIG1TZWxlY3RYICsgIiwiICsgbVNlbGVjdFkpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlTW92ZVNlbGVjdGlvbihjb250ZW50WCwgY29udGVudFksIHRydWUpOwotICAgICAgICAgICAgICAgICAgICAgICAgaW52YWxpZGF0ZSgpOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgaWYgKG1TZWxlY3RpbmdUZXh0ICYmIG1TZWxlY3Rpb25TdGFydGVkKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJleHRlbmQ9IiArIGNvbnRlbnRYICsgIiwiICsgY29udGVudFkpOwogICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG5hdGl2ZUV4dGVuZFNlbGVjdGlvbihjb250ZW50WCwgY29udGVudFkpOworICAgICAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAobVRvdWNoTW9kZSAhPSBUT1VDSF9EUkFHX01PREUpIHsKKwogICAgICAgICAgICAgICAgICAgICBpZiAoIW1Db25maXJtTW92ZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgICAgICAgICBpZiAobVByZXZlbnREZWZhdWx0ID09IFBSRVZFTlRfREVGQVVMVF9NQVlCRV9ZRVMKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBtUHJldmVudERlZmF1bHQgPT0gUFJFVkVOVF9ERUZBVUxUX05PX0ZST01fVE9VQ0hfRE9XTikgewogICAgICAgICAgICAgICAgICAgICAgICAgLy8gdHJhY2sgbUxhc3RUb3VjaFRpbWUgYXMgd2UgbWF5IG5lZWQgdG8gZG8gZmxpbmcgYXQKQEAgLTUwMzMsNiArNDg1Niw3IEBACiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9VUDogeworICAgICAgICAgICAgICAgIGlmICghaXNGb2N1c2VkKCkpIHJlcXVlc3RGb2N1cygpOwogICAgICAgICAgICAgICAgIC8vIHBhc3MgdGhlIHRvdWNoIGV2ZW50cyBmcm9tIFVJIHRocmVhZCB0byBXZWJDb3JlIHRocmVhZAogICAgICAgICAgICAgICAgIGlmIChzaG91bGRGb3J3YXJkVG91Y2hFdmVudCgpKSB7CiAgICAgICAgICAgICAgICAgICAgIFRvdWNoRXZlbnREYXRhIHRlZCA9IG5ldyBUb3VjaEV2ZW50RGF0YSgpOwpAQCAtNTA0MSwxMCArNDg2NSw2IEBACiAgICAgICAgICAgICAgICAgICAgIHRlZC5tWSA9IGNvbnRlbnRZOwogICAgICAgICAgICAgICAgICAgICB0ZWQubU1ldGFTdGF0ZSA9IGV2LmdldE1ldGFTdGF0ZSgpOwogICAgICAgICAgICAgICAgICAgICB0ZWQubVJlcHJvY2VzcyA9IG1EZWZlclRvdWNoUHJvY2VzczsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1EZWZlclRvdWNoUHJvY2VzcykgewotICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1WaWV3WCA9IHg7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVZpZXdZID0geTsKLSAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBtV2ViVmlld0NvcmUuc2VuZE1lc3NhZ2UoRXZlbnRIdWIuVE9VQ0hfRVZFTlQsIHRlZCk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIG1MYXN0VG91Y2hVcFRpbWUgPSBldmVudFRpbWU7CkBAIC01MDU5LDIwICs0ODc5LDEyIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1ZID0gY29udGVudFk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1NZXRhU3RhdGUgPSBldi5nZXRNZXRhU3RhdGUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVJlcHJvY2VzcyA9IG1EZWZlclRvdWNoUHJvY2VzczsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobURlZmVyVG91Y2hQcm9jZXNzKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlZC5tVmlld1ggPSB4OwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVZpZXdZID0geTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXdDb3JlLnNlbmRNZXNzYWdlKEV2ZW50SHViLlRPVUNIX0VWRU5ULCB0ZWQpOwogICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtUHJldmVudERlZmF1bHQgIT0gUFJFVkVOVF9ERUZBVUxUX1lFUyl7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9Eb3VibGVUYXAoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtWm9vbU1hbmFnZXIuaGFuZGxlRG91YmxlVGFwKG1MYXN0VG91Y2hYLCBtTGFzdFRvdWNoWSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoTW9kZSA9IFRPVUNIX0RPTkVfTU9ERTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICBjYXNlIFRPVUNIX1NFTEVDVF9NT0RFOgotICAgICAgICAgICAgICAgICAgICAgICAgY29tbWl0Q29weSgpOwotICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoU2VsZWN0aW9uID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgY2FzZSBUT1VDSF9JTklUX01PREU6IC8vIHRhcAogICAgICAgICAgICAgICAgICAgICBjYXNlIFRPVUNIX1NIT1JUUFJFU1NfU1RBUlRfTU9ERToKICAgICAgICAgICAgICAgICAgICAgY2FzZSBUT1VDSF9TSE9SVFBSRVNTX01PREU6CkBAIC01MDg0LDkgKzQ4OTYsMTcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobVByZXZlbnREZWZhdWx0ICE9IFBSRVZFTlRfREVGQVVMVF9ZRVMKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIChjb21wdXRlTWF4U2Nyb2xsWCgpID4gMAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBjb21wdXRlTWF4U2Nyb2xsWSgpID4gMCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVUkgdGFrZXMgY29udHJvbCBiYWNrLCBjYW5jZWwgV2ViQ29yZSB0b3VjaAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYW5jZWxXZWJDb3JlVG91Y2hFdmVudChjb250ZW50WCwgY29udGVudFksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIHRoZSB1c2VyIGhhcyBwZXJmb3JtZWQgYSB2ZXJ5IHF1aWNrIHRvdWNoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNlcXVlbmNlIGl0IGlzIHBvc3NpYmxlIHRoYXQgd2UgbWF5IGdldCBoZXJlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGJlZm9yZSBXZWJDb3JlIGhhcyBoYWQgYSBjaGFuY2UgdG8gcHJvY2VzcyB0aGUgZXZlbnRzLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJbiB0aGlzIGNhc2UsIGFueSBjYWxsIHRvIHByZXZlbnREZWZhdWx0IGluIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBKUyB0b3VjaCBoYW5kbGVyIHdpbGwgbm90IGhhdmUgYmVlbiBleGVjdXRlZCB5ZXQuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEhlbmNlIHdlIHdpbGwgc2VlIGJvdGggdGhlIFVJIChub3cpIGFuZCBXZWJDb3JlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICh3aGVuIGNvbnRleHQgc3dpdGNoZXMpIGhhbmRsaW5nIHRoZSBldmVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmVnYXJkbGVzcyBvZiB3aGV0aGVyIHRoZSB3ZWIgZGV2ZWxvcGVyIGFjdHVhbGx5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRvZXNlcyBwcmV2ZW50RGVmYXVsdCBpbiB0aGVpciB0b3VjaCBoYW5kbGVyLiBUaGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlzIHRoZSBuYXR1cmUgb2Ygb3VyIGFzeW5jaHJvbm91cyB0b3VjaCBtb2RlbC4KKwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB3ZSB3aWxsIG5vdCByZXdyaXRlIGRyYWcgY29kZSBoZXJlLCBidXQgd2UKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2lsbCB0cnkgZmxpbmcgaWYgaXQgYXBwbGllcy4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV2ViVmlld0NvcmUucmVkdWNlUHJpb3JpdHkoKTsKQEAgLTUxMDMsNyArNDkyMywxNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtVG91Y2hNb2RlID09IFRPVUNIX0lOSVRfTU9ERSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtU2VsZWN0aW5nVGV4dCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0YXBwaW5nIG9uIHNlbGVjdGlvbiBvciBjb250cm9scyBkb2VzIG5vdGhpbmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFuYXRpdmVIaXRTZWxlY3Rpb24oY29udGVudFgsIGNvbnRlbnRZKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0aW9uRG9uZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBvbmx5IHRyaWdnZXIgZG91YmxlIHRhcCBpZiB0aGUgV2ViVmlldyBpcworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNjYWxhYmxlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1Ub3VjaE1vZGUgPT0gVE9VQ0hfSU5JVF9NT0RFCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAoY2FuWm9vbUluKCkgfHwgY2FuWm9vbU91dCgpKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIuc2VuZEVtcHR5TWVzc2FnZURlbGF5ZWQoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVMRUFTRV9TSU5HTEVfVEFQLCBWaWV3Q29uZmlndXJhdGlvbgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdldERvdWJsZVRhcFRpbWVvdXQoKSk7CkBAIC01MTk0LDIxICs1MDI0LDEwIEBACiAgICAgICAgIGlmICghbURyYWdGcm9tVGV4dElucHV0KSB7CiAgICAgICAgICAgICBuYXRpdmVIaWRlQ3Vyc29yKCk7CiAgICAgICAgIH0KLSAgICAgICAgV2ViU2V0dGluZ3Mgc2V0dGluZ3MgPSBnZXRTZXR0aW5ncygpOwotICAgICAgICBpZiAoc2V0dGluZ3Muc3VwcG9ydFpvb20oKQotICAgICAgICAgICAgICAgICYmIHNldHRpbmdzLmdldEJ1aWx0SW5ab29tQ29udHJvbHMoKQotICAgICAgICAgICAgICAgICYmICFnZXRab29tQnV0dG9uc0NvbnRyb2xsZXIoKS5pc1Zpc2libGUoKQotICAgICAgICAgICAgICAgICYmIG1NaW5ab29tU2NhbGUgPCBtTWF4Wm9vbVNjYWxlCi0gICAgICAgICAgICAgICAgJiYgKG1Ib3Jpem9udGFsU2Nyb2xsQmFyTW9kZSAhPSBTQ1JPTExCQVJfQUxXQVlTT0ZGCi0gICAgICAgICAgICAgICAgICAgICAgICB8fCBtVmVydGljYWxTY3JvbGxCYXJNb2RlICE9IFNDUk9MTEJBUl9BTFdBWVNPRkYpKSB7Ci0gICAgICAgICAgICBtWm9vbUJ1dHRvbnNDb250cm9sbGVyLnNldFZpc2libGUodHJ1ZSk7Ci0gICAgICAgICAgICBpbnQgY291bnQgPSBzZXR0aW5ncy5nZXREb3VibGVUYXBUb2FzdENvdW50KCk7Ci0gICAgICAgICAgICBpZiAobUluWm9vbU92ZXJ2aWV3ICYmIGNvdW50ID4gMCkgewotICAgICAgICAgICAgICAgIHNldHRpbmdzLnNldERvdWJsZVRhcFRvYXN0Q291bnQoLS1jb3VudCk7Ci0gICAgICAgICAgICAgICAgVG9hc3QubWFrZVRleHQobUNvbnRleHQsCi0gICAgICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy5kb3VibGVfdGFwX3RvYXN0LAotICAgICAgICAgICAgICAgICAgICAgICAgVG9hc3QuTEVOR1RIX0xPTkcpLnNob3coKTsKLSAgICAgICAgICAgIH0KKworICAgICAgICBpZiAobUhvcml6b250YWxTY3JvbGxCYXJNb2RlICE9IFNDUk9MTEJBUl9BTFdBWVNPRkYKKyAgICAgICAgICAgICAgICB8fCBtVmVydGljYWxTY3JvbGxCYXJNb2RlICE9IFNDUk9MTEJBUl9BTFdBWVNPRkYpIHsKKyAgICAgICAgICAgIG1ab29tTWFuYWdlci5pbnZva2Vab29tUGlja2VyKCk7CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTUyMTYsMTggKzUwMzUsNyBAQAogICAgICAgICBpZiAoKGRlbHRhWCB8IGRlbHRhWSkgIT0gMCkgewogICAgICAgICAgICAgc2Nyb2xsQnkoZGVsdGFYLCBkZWx0YVkpOwogICAgICAgICB9Ci0gICAgICAgIGlmICghZ2V0U2V0dGluZ3MoKS5nZXRCdWlsdEluWm9vbUNvbnRyb2xzKCkpIHsKLSAgICAgICAgICAgIGJvb2xlYW4gc2hvd1BsdXNNaW51cyA9IG1NaW5ab29tU2NhbGUgPCBtTWF4Wm9vbVNjYWxlOwotICAgICAgICAgICAgaWYgKG1ab29tQ29udHJvbHMgIT0gbnVsbCAmJiBzaG93UGx1c01pbnVzKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1ab29tQ29udHJvbHMuZ2V0VmlzaWJpbGl0eSgpID09IFZpZXcuVklTSUJMRSkgewotICAgICAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlQ2FsbGJhY2tzKG1ab29tQ29udHJvbFJ1bm5hYmxlKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBtWm9vbUNvbnRyb2xzLnNob3coc2hvd1BsdXNNaW51cywgZmFsc2UpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucG9zdERlbGF5ZWQobVpvb21Db250cm9sUnVubmFibGUsCi0gICAgICAgICAgICAgICAgICAgICAgICBaT09NX0NPTlRST0xTX1RJTUVPVVQpOwotICAgICAgICAgICAgfQotICAgICAgICB9CisgICAgICAgIG1ab29tTWFuYWdlci5rZWVwWm9vbVBpY2tlclZpc2libGUoKTsKICAgICB9CiAKICAgICBwcml2YXRlIHZvaWQgc3RvcFRvdWNoKCkgewpAQCAtNTI2Miw2ICs1MDcwLDkgQEAKICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnJlbW92ZU1lc3NhZ2VzKFNXSVRDSF9UT19MT05HUFJFU1MpOwogICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlTWVzc2FnZXMoRFJBR19IRUxEX01PVElPTkxFU1MpOwogICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlTWVzc2FnZXMoQVdBS0VOX1NDUk9MTF9CQVJTKTsKKyAgICAgICAgaWYgKGdldFNldHRpbmdzKCkuc3VwcG9ydFRvdWNoT25seSgpKSB7CisgICAgICAgICAgICByZW1vdmVUb3VjaEhpZ2hsaWdodCh0cnVlKTsKKyAgICAgICAgfQogICAgICAgICBtSGVsZE1vdGlvbmxlc3MgPSBNT1RJT05MRVNTX1RSVUU7CiAgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9ET05FX01PREU7CiAgICAgICAgIG5hdGl2ZUhpZGVDdXJzb3IoKTsKQEAgLTUyNzMsOCArNTA4NCwxMCBAQAogICAgIHByaXZhdGUgZmxvYXQgbVRyYWNrYmFsbFJlbWFpbnNZID0gMC4wZjsKICAgICBwcml2YXRlIGludCBtVHJhY2tiYWxsWE1vdmUgPSAwOwogICAgIHByaXZhdGUgaW50IG1UcmF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zCiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBtVHJhY2tiYWxsRG93biA9IHRydWU7CkBAIC01MzQxLDExICs1MTUyLDEzIEBACiAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlTWVzc2FnZXMoTE9OR19QUkVTU19DRU5URVIpOwogICAgICAgICAgICAgbVRyYWNrYmFsbERvd24gPSBmYWxzZTsKICAgICAgICAgICAgIG1UcmFja2JhbGxVcFRpbWUgPSB0aW1lOwotICAgICAgICAgICAgaWYgKHNoaWZ0UHJlc3NlZCkgeworICAgICAgICAgICAgaWYgKG1TZWxlY3RpbmdUZXh0KSB7CiAgICAgICAgICAgICAgICAgaWYgKG1FeHRlbmRTZWxlY3Rpb24pIHsKLSAgICAgICAgICAgICAgICAgICAgY29tbWl0Q29weSgpOworICAgICAgICAgICAgICAgICAgICBjb3B5U2VsZWN0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgIHNlbGVjdGlvbkRvbmUoKTsKICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICBtRXh0ZW5kU2VsZWN0aW9uID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgbmF0aXZlU2V0RXh0ZW5kU2VsZWN0aW9uKCk7CiAgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsgLy8gZHJhdyB0aGUgaS1iZWFtIGluc3RlYWQgb2YgdGhlIGFycm93CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOyAvLyBkaXNjYXJkIHByZXNzIGlmIGNvcHkgaW4gcHJvZ3Jlc3MKQEAgLTU0MTIsOCArNTIyNSw3IEBACiAgICAgICAgICAgICAgICAgICAgICsgIiB5UmF0ZT0iICsgeVJhdGUKICAgICAgICAgICAgICAgICAgICAgKTsKICAgICAgICAgfQotICAgICAgICBuYXRpdmVNb3ZlU2VsZWN0aW9uKHZpZXdUb0NvbnRlbnRYKG1TZWxlY3RYKS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dG91Y2ggY29udHJvbC4KKyAgICAgICAgICAgICAgICBtU2VsZWN0WCA9IGNvbnRlbnRUb1ZpZXdYKG5hdGl2ZVNlbGVjdGlvblgoKSk7CisgICAgICAgICAgICAgICAgbVNlbGVjdFkgPSBjb250ZW50VG9WaWV3WShuYXRpdmVTZWxlY3Rpb25ZKCkpOworICAgICAgICAgICAgICAgIG1EcmF3U2VsZWN0aW9uUG9pbnRlciA9IG1FeHRlbmRTZWxlY3Rpb24gPSB0cnVlOworICAgICAgICAgICAgICAgIG5hdGl2ZVNldEV4dGVuZFNlbGVjdGlvbigpOworICAgICAgICAgICAgfQogICAgICAgICAgICAgbW92ZVNlbGVjdGlvbihzY2FsZVRyYWNrYmFsbFgoeFJhdGUsIHZpZXdXaWR0aCksCiAgICAgICAgICAgICAgICAgICAgIHNjYWxlVHJhY2tiYWxsWSh5UmF0ZSwgdmlld0hlaWdodCkpOwogICAgICAgICAgICAgbVRyYWNrYmFsbFJlbWFpbnNYID0gbVRyYWNrYmFsbFJlbWFpbnNZID0gMDsKQEAgLTU1MTcsMTEgKzUzMzgsMTEgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBtVHJhY2tiYWxsUmVtYWluc1g9IiArIG1UcmFja2JhbGxSZW1haW5zWAogICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG1UcmFja2JhbGxSZW1haW5zWT0iICsgbVRyYWNrYmFsbFJlbWFpbnNZKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChtTmF0aXZlQ2xhc3MgIT0gMCAmJiBuYXRpdmVGb2N1c0lzUGx1Z2luKCkpIHsKKyAgICAgICAgICAgIGlmIChtTmF0aXZlQ2xhc3MgIT0gMCAmJiBuYXRpdmVQYWdlU2hvdWxkSGFuZGxlU2hpZnRBbmRBcnJvd3MoKSkgewogICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgewotICAgICAgICAgICAgICAgICAgICBsZXRQbHVnaW5IYW5kbGVOYXZLZXkoc2VsZWN0S2V5Q29kZSwgdGltZSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIGxldFBhZ2VIYW5kbGVOYXZLZXkoc2VsZWN0S2V5Q29kZSwgdGltZSwgdHJ1ZSk7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGxldFBsdWdpbkhhbmRsZU5hdktleShzZWxlY3RLZXlDb2RlLCB0aW1lLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgbGV0UGFnZUhhbmRsZU5hdktleShzZWxlY3RLZXlDb2RlLCB0aW1lLCBmYWxzZSk7CiAgICAgICAgICAgICB9IGVsc2UgaWYgKG5hdkhhbmRsZWRLZXkoc2VsZWN0S2V5Q29kZSwgY291bnQsIGZhbHNlLCB0aW1lKSkgewogICAgICAgICAgICAgICAgIHBsYXlTb3VuZEVmZmVjdChrZXlDb2RlVG9Tb3VuZHNFZmZlY3Qoc2VsZWN0S2V5Q29kZSkpOwogICAgICAgICAgICAgfQpAQCAtNTU2MCw2ICs1MzgxLDE5IEBACiAgICAgICAgICAgICAgICAgLSBnZXRWaWV3SGVpZ2h0V2l0aFRpdGxlKCksIDApOwogICAgIH0KIAorICAgIGJvb2xlYW4gdXBkYXRlU2Nyb2xsQ29vcmRpbmF0ZXMoaW50IHgsIGludCB5KSB7CisgICAgICAgIGludCBvbGRYID0gbVNjcm9sbFg7CisgICAgICAgIGludCBvbGRZID0gbVNjcm9sbFk7CisgICAgICAgIG1TY3JvbGxYID0geDsKKyAgICAgICAgbVNjcm9sbFkgPSB5OworICAgICAgICBpZiAob2xkWCAhPSBtU2Nyb2xsWCB8fCBvbGRZICE9IG1TY3JvbGxZKSB7CisgICAgICAgICAgICBvblNjcm9sbENoYW5nZWQobVNjcm9sbFgsIG1TY3JvbGxZLCBvbGRYLCBvbGRZKTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuIGZ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iArLy0gYnV0dG9ucy4gVGhlIGNhbGxlciBpcwogICAgICAqIGluIGNoYXJnZSBvZiBpbnN0YWxsaW5nIHRoaXMgdmlldyB0byB0aGUgdmlldyBoaWVyYXJjaHkuIFRoaXMgdmlldyB3aWxsCkBAIC01Njc1LDgxICs1NDg2LDI5IEBACiAgICAgICAgICAgICBMb2cudyhMT0dUQUcsICJUaGlzIFdlYlZpZXcgZG9lc24ndCBzdXBwb3J0IHpvb20uIik7CiAgICAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICAgfQotICAgICAgICBpZiAobVpvb21Db250cm9scyA9PSBudWxsKSB7Ci0gICAgICAgICAgICBtWm9vbUNvbnRyb2xzID0gY3JlYXRlWm9vbUNvbnRyb2xzKCk7Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBuZWVkIHRvIGJlIHNldCB0byBWSVNJQkxFIGZpcnN0IHNvIHRoYXQgZ2V0TWVhc3VyZWRIZWlnaHQoKSBpbgotICAgICAgICAgICAgICoge0BsaW5rICNvblNpemVDaGFuZ2VkKCl9IGNhbiByZXR1cm4gdGhlIG1lYXN1cmVkIHZhbHVlIGZvciBwcm9wZXIKLSAgICAgICAgICAgICAqIGxheW91dC4KLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgbVpvb21Db250cm9scy5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7Ci0gICAgICAgICAgICBtWm9vbUNvbnRyb2xSdW5uYWJsZSA9IG5ldyBSdW5uYWJsZSgpIHsKLSAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7Ci0KLSAgICAgICAgICAgICAgICAgICAgLyogRG9uJ3QgZGlzbWlzcyB0aGUgY29udHJvbHMgaWYgdGhlIHVzZXIgaGFzCi0gICAgICAgICAgICAgICAgICAgICAqIGZvY3VzIG9uIHRoZW0uIFdhaXQgYW5kIGNoZWNrIGFnYWluIGxhdGVyLgotICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgaWYgKCFtWm9vbUNvbnRyb2xzLmhhc0ZvY3VzKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1ab29tQ29udHJvbHMuaGlkZSgpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhtWm9vbUNvbnRyb2xSdW5uYWJsZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucG9zdERlbGF5ZWQobVpvb21Db250cm9sUnVubmFibGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFpPT01fQ09OVFJPTFNfVElNRU9VVCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9OwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBtWm9vbUNvbnRyb2xzOworICAgICAgICByZXR1cm4gbVpvb21NYW5hZ2VyLmdldEV4dGVybmFsWm9vbVBpY2tlcigpOwogICAgIH0KIAotICAgIHByaXZhdGUgRXh0ZW5kZWRab29tQ29udHJvbHMgY3JlYXRlWm9vbUNvbnRyb2xzKCkgewotICAgICAgICBFeHRlbmRlZFpvb21Db250cm9scyB6b29tQ29udHJvbHMgPSBuZXcgRXh0ZW5kZWRab29tQ29udHJvbHMobUNvbnRleHQKLSAgICAgICAgICAgICwgbnVsbCk7Ci0gICAgICAgIHpvb21Db250cm9scy5zZXRPblpvb21JbkNsaWNrTGlzdGVuZXIobmV3IE9uQ2xpY2tMaXN0ZW5lcigpIHsKLSAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soVmlldyB2KSB7Ci0gICAgICAgICAgICAgICAgLy8gcmVzZXQgdGltZSBvdXQKLSAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlQ2FsbGJhY2tzKG1ab29tQ29udHJvbFJ1bm5hYmxlKTsKLSAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucG9zdERlbGF5ZWQobVpvb21Db250cm9sUnVubmFibGUsCi0gICAgICAgICAgICAgICAgICAgICAgICBaT09NX0NPTlRST0xTX1RJTUVPVVQpOwotICAgICAgICAgICAgICAgIHpvb21JbigpOwotICAgICAgICAgICAgfQotICAgICAgICB9KTsKLSAgICAgICAgem9vbUNvbnRyb2xzLnNldE9uWm9vbU91dENsaWNrTGlzdGVuZXIobmV3IE9uQ2xpY2tMaXN0ZW5lcigpIHsKLSAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soVmlldyB2KSB7Ci0gICAgICAgICAgICAgICAgLy8gcmVzZXQgdGltZSBvdXQKLSAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlQ2FsbGJhY2tzKG1ab29tQ29udHJvbFJ1bm5hYmxlKTsKLSAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucG9zdERlbGF5ZWQobVpvb21Db250cm9sUnVubmFibGUsCi0gICAgICAgICAgICAgICAgICAgICAgICBaT09NX0NPTlRST0xTX1RJTUVPVVQpOwotICAgICAgICAgICAgICAgIHpvb21PdXQoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSk7Ci0gICAgICAgIHJldHVybiB6b29tQ29udHJvbHM7CisgICAgdm9pZCBkaXNtaXNzWm9vbUNvbnRyb2woKSB7CisgICAgICAgIG1ab29tTWFuYWdlci5kaXNtaXNzWm9vbVBpY2tlcigpOworICAgIH0KKworICAgIGZsb2F0IGdldERlZmF1bHRab29tU2NhbGUoKSB7CisgICAgICAgIHJldHVybiBtWm9vbU1hbmFnZXIuZ2V0RGVmYXVsdFNjYWxlKCk7CiAgICAgfQogCiAgICAgLyoqCi0gICAgICogR2V0cyB0aGUge0BsaW5rIFpvb21CdXR0b25zQ29udHJvbGxlcn0gd2hpY2ggY2FuIGJlIHVzZWQgdG8g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xzLmdldExheW91dFBhcmFtcygpOwotICAgICAgICAgICAgaWYgKHBhcmFtcyBpbnN0YW5jZW9mIEZyYW1lTGF5b3V0LkxheW91dFBhcmFtcykgewotICAgICAgICAgICAgICAgIEZyYW1lTGF5b3V0LkxheW91dFBhcmFtcyBmcmFtZVBhcmFtcyA9IChGcmFtZUxheW91dC5MYXlvdXRQYXJhbXMpIHBhcmFtczsKLSAgICAgICAgICAgICAgICBmcmFtZVBhcmFtcy5ncmF2aXR5ID0gR3Jhdml0eS5SSUdIVDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gbVpvb21CdXR0b25zQ29udHJvbGxlcjsKKyAgICBwdWJsaWMgYm9vbGVhbiBjYW5ab29tSW4oKSB7CisgICAgICAgIHJldHVybiBtWm9vbU1hbmFnZXIuY2FuWm9vbUluKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiBUUlVFIGlmIHRoZSBXZWJWaWV3IGNhbiBiZSB6b29tZWQgb3V0LgorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIGNhblpvb21PdXQoKSB7CisgICAgICAgIHJldHVybiBtWm9vbU1hbmFnZXIuY2FuWm9vbU91dCgpOwogICAgIH0KIAogICAgIC8qKgpAQCAtNTc1NywxNSArNTUxNiw3IEBACiAgICAgICogQHJldHVybiBUUlVFIGlmIHpvb20gaW4gc3VjY2VlZHMuIEZBTFNFIGlmIG5vIHpvb20gY2hhbmdlcy4KICAgICAgKi8KICAgICBwdWJsaWMgYm9vbGVhbiB6b29tSW4oKSB7Ci0gICAgICAgIC8vIFRPRE86IGFsdGVybmF0aXZlbHkgd2UgY2FuIGRpc2FsbG93IHRoaXMgZHVyaW5nIGRyYXcgaGlzdG9yeSBtb2RlCi0gICAgICAgIHN3aXRjaE91dERyYXdIaXN0b3J5KCk7Ci0gICAgICAgIG1Jblpvb21PdmVydmlldyA9IGZhbHNlOwotICAgICAgICAvLyBDZW50ZXIgem9vbWluZyB0byB0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2FsZSA9IG1NaW5ab29tU2NhbGU7Ci0gICAgICAgIH0gZWxzZSBpZiAoc2NhbGUgPiBtTWF4Wm9vbVNjYWxlKSB7Ci0gICAgICAgICAgICBzY2FsZSA9IG1NYXhab29tU2NhbGU7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKE1hdGguYWJzKHNjYWxlIC0gbUFjdHVhbFNjYWxlKSA8IE1JTklNVU1fU0NBTEVfSU5DUkVNRU5UKSB7Ci0gICAgICAgICAgICBpZiAoY29udGVudFRvVmlld1godmlldy54KSA+PSBtU2Nyb2xsWAotICAgICAgICAgICAgICAgICAgICAmJiBjb250ZW50VG9WaWV3WCh2aWV3LnggKyB2aWV3LndpZHRoKSA8PSBtU2Nyb2xsWAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgdmlld1dpZHRoCi0gICAgICAgICAgICAgICAgICAgICYmIGNvbnRlbnRUb1ZpZXdZKHZpZXcueSkgPj0gbVNjcm9sbFkKLSAgICAgICAgICAgICAgICAgICAgJiYgY29udGVudFRvVmlld1kodmlldy55ICsgdmlldy5oZWlnaHQpIDw9IG1TY3JvbGxZCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKyB2aWV3SGVpZ2h0KSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIGJvb2xlYW4gaXNQbHVnaW5GaXRPblNjcmVlbihWaWV3TWFuYWdlci5DaGlsZFZpZXcgdmlldykgeworICAgICAgICBmaW5hbCBpbnQgdmlld1dpZHRoID0gZ2V0Vmlld1dpZHRoKCk7CisgICAgICAgIGZpbmFsIGludCB2aWV3SGVpZ2h0ID0gZ2V0Vmlld0hlaWdodFdpdGhUaXRsZSgpOworICAgICAgICBmbG9hdCBzY2FsZSA9IE1hdGgubWluKChmbG9hdCkgdmlld1dpZHRoIC8gdmlldy53aWR0aCwgKGZsb2F0KSB2aWV3SG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0gTk9fTEVGVEVER0UpIHsKLSAgICAgICAgICAgICAgICAvLyBhZGQgYSA1cHQgcGFkZGluZyB0byB0aGUgbGVmdCBlZGdlLgotICAgICAgICAgICAgICAgIGludCB2aWV3TGVmdCA9IGNvbnRlbnRUb1ZpZXdYKGxlZnQgPCA1ID8gMCA6IChsZWZ0IC0gNSkpCi0gICAgICAgICAgICAgICAgICAgICAgICAtIG1TY3JvbGxYOwotICAgICAgICAgICAgICAgIC8vIFJlLWNhbGN1bGF0ZSB0aGUgem9vbSBjZW50ZXIgc28gdGhhdCB0aGUgbmV3IHNjcm9sbCB4IHdpbGwgYmUKLSAgICAgICAgICAgICAgICAvLyBvbiB0aGUgbGVmdCBlZGdlLgotICAgICAgICAgICAgICAgIGlmICh2aWV3TGVmdCA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgbVpvb21DZW50ZXJYID0gdmlld0xlZnQgKiBtRGVmYXVsdFNjYWxlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyAobURlZmF1bHRTY2FsZSAtIG1BY3R1YWxTY2FsZSk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgc2Nyb2xsQnkodmlld0xlZnQsIDApOwotICAgICAgICAgICAgICAgICAgICBtWm9vbUNlbnRlclggPSAwOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHpvb21XaXRoUHJldmlldyhtRGVmYXVsdFNjYWxlLCB0cnVlKTsKKyAgICAgICAgICAgIGZsb2F0IHpvb21DZW50ZXJZID0gKG9sZFNjcmVlblkgKiBzY2FsZSAtIG5ld1NjcmVlblkgKiBhY3R1YWxTY2FsZSkKKyAgICAgICAgICAgICAgICAgICAgLyAoc2NhbGUgLSBhY3R1YWxTY2FsZSk7CisgICAgICAgICAgICBtWm9vbU1hbmFnZXIuc2V0Wm9vbUNlbnRlcih6b29tQ2VudGVyWCwgem9vbUNlbnRlclkpOworICAgICAgICAg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aWYgaXQgaXMgaW4gZWRpdGluZyBtb2RlKQorICAgICAgICBpZiAobVpvb21NYW5hZ2VyLmlzRml4ZWRMZW5ndGhBbmltYXRpb25JblByb2dyZXNzKCkpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCiAgICAgICAgIHJlY3Qub2Zmc2V0KGNoaWxkLmdldExlZnQoKSAtIGNoaWxkLmdldFNjcm9sbFgoKSwKICAgICAgICAgICAgICAgICBjaGlsZC5nZXRUb3AoKSAtIGNoaWxkLmdldFNjcm9sbFkoKSk7CiAKQEAgLTYzMjEsNyArNTk2OCw4IEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGNhc2UgU1dJVENIX1RPX1NIT1JUUFJFU1M6IHsKICAgICAgICAgICAgICAgICAgICAgaWYgKG1Ub3VjaE1vZGUgPT0gVE9VQ0hfSU5JVF9NT0RFKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobVByZXZlbnREZWZhdWx0ICE9IFBSRVZFTlRfREVGQVVMVF9ZRVMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZ2V0U2V0dGluZ3MoKS5zdXBwb3J0VG91Y2hPbmx5KCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgbVByZXZlbnREZWZhdWx0ICE9IFBSRVZFTlRfREVGQVVMVF9ZRVMpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfU0hPUlRQUkVTU19TVEFSVF9NT0RFOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZVNlbGVjdGlvbigpOwogICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKQEAgLTYzMzUsNiArNTk4Myw5IEBACiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBjYXNlIFNXSVRDSF9UT19MT05HUFJFU1M6IHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGdldFNldHRpbmdzKCkuc3VwcG9ydFRvdWNoT25seSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVUb3VjaEhpZ2hsaWdodChmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgaWYgKGluRnVsbFNjcmVlbk1vZGUoKSB8fCBtRGVmZXJUb3VjaFByb2Nlc3MpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIFRvdWNoRXZlbnREYXRhIHRlZCA9IG5ldyBUb3VjaEV2ZW50RGF0YSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1BY3Rpb24gPSBXZWJWaWV3Q29yZS5BQ1RJT05fTE9OR1BSRVNTOwpAQCAtNjM0NiwxNSArNTk5NywxMCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2ltcGxpY2l0eSBmb3Igbm93LCB3ZSBkb24ndCBzZXQgaXQuCiAgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubU1ldGFTdGF0ZSA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVJlcHJvY2VzcyA9IG1EZWZlclRvdWNoUHJvY2VzczsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtRGVmZXJUb3VjaFByb2Nlc3MpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVZpZXdYID0gbUxhc3RUb3VjaFg7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1WaWV3WSA9IG1MYXN0VG91Y2hZOwotICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXdDb3JlLnNlbmRNZXNzYWdlKEV2ZW50SHViLlRPVUNIX0VWRU5ULCB0ZWQpOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1QcmV2ZW50RGVmYXVsdCAhPSBQUkVWRU5UX0RFRkFVTFRfWUVTKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfRE9ORV9NT0RFOwogICAgICAgICAgICAgICAgICAgICAgICAgcGVyZm9ybUxvbmdDbGljaygpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmVidWlsZFdlYlRleHRWaWV3KCk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgfQpAQCAtNjM5MCw4ICs2MDM2LDggQEAKICAgICAgICAgICAgICAgICAgICAgV2ViVmlld0NvcmUuUmVzdG9yZVN0YXRlIHJlc3RvcmVTdGF0ZQogICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gKFdlYlZpZXdDb3JlLlJlc3RvcmVTdGF0ZSkgbXNnLm9iajsKICAgICAgICAgICAgICAgICAgICAgLy8gbVNjcm9sbFggY29udGFpbnMgdGhlIG5ldyBtaW5QcmVmV2lkdGgKLSAgICAgICAgICAgICAgICAgICAgdXBkYXRlWm9vbVJhbmdlKHJlc3RvcmVTdGF0ZSwgZ2V0Vmlld1dpZHRoKCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdG9yZVN0YXRlLm1TY3JvbGxYLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIG1ab29tTWFuYWdlci51cGRhdGVab29tUmFuZ2UocmVzdG9yZVN0YXRlLCBnZXRWaWV3V2lkdGgoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN0b3JlU3RhdGUubVNjcm9sbFgpOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgY2FzZSBORVdfUElDVFVSRV9NU0dfSUQ6IHsKQEAgLTY0MDEsNTYgKzYwNDcsMjQgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIG1EZWxheWVkRGVsZXRlUm9vdExheWVyID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVTZXRSb290TGF5ZXIoMCk7CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgV2ViU2V0dGluZ3Mgc2V0dGluZ3MgPSBtV2ViVmlld0NvcmUuZ2V0U2V0dGluZ3MoKTsKICAgICAgICAgICAgICAgICAgICAgLy8gY2FsbGVkIGZvciBuZXcgY29udGVudAotICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgdmlld1dpZHRoID0gZ2V0Vmlld1dpZHRoKCk7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIFdlYlZpZXdDb3JlLkRyYXdEYXRhIGRyYXcgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXZWJWaWV3Q29yZS5EcmF3RGF0YSkgbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgZmluYWwgV2ViVmlld0NvcmUuRHJhd0RhdGEgZHJhdyA9IChXZWJWaWV3Q29yZS5EcmF3RGF0YSkgbXNnLm9iajsKKwogICAgICAgICAgICAgICAgICAgICBmaW5hbCBQb2ludCB2aWV3U2l6ZSA9IGRyYXcubVZpZXdQb2ludDsKLSAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiB1c2VXaWRlVmlld3BvcnQgPSBzZXR0aW5ncy5nZXRVc2VXaWRlVmlld1BvcnQoKTsKICAgICAgICAgICAgICAgICAgICAgV2ViVmlld0NvcmUuUmVzdG9yZVN0YXRlIHJlc3RvcmVTdGF0ZSA9IGRyYXcubVJlc3RvcmVTdGF0ZTsKICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBoYXNSZXN0b3JlU3RhdGUgPSByZXN0b3JlU3RhdGUgIT0gbnVsbDsKICAgICAgICAgICAgICAgICAgICAgaWYgKGhhc1Jlc3RvcmVTdGF0ZSkgewotICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlWm9vbVJhbmdlKHJlc3RvcmVTdGF0ZSwgdmlld1NpemUueCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhdy5tTWluUHJlZldpZHRoLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1ab29tTWFuYWdlci5yZXN0b3JlWm9vbVN0YXRlKGRyYXcpOwogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFtRHJhd0hpc3RvcnkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSW5ab29tT3ZlcnZpZXcgPSBmYWxzZTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtSW5pdGlhbFNjYWxlSW5QZXJjZW50ID4gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXROZXdab29tU2NhbGUobUluaXRpYWxTY2FsZUluUGVyY2VudCAvIDEwMC4wZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Jbml0aWFsU2NhbGVJblBlcmNlbnQgIT0gbVRleHRXcmFwU2NhbGUgKiAxMDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChyZXN0b3JlU3RhdGUubVZpZXdTY2FsZSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRleHRXcmFwU2NhbGUgPSByZXN0b3JlU3RhdGUubVRleHRXcmFwU2NhbGU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldE5ld1pvb21TY2FsZShyZXN0b3JlU3RhdGUubVZpZXdTY2FsZSwgZmFsc2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUluWm9vbU92ZXJ2aWV3ID0gdXNlV2lkZVZpZXdwb3J0Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzZXR0aW5ncy5nZXRMb2FkV2l0aE92ZXJ2aWV3TW9kZSgpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCBzY2FsZTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1Jblpvb21PdmVydmlldykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NhbGUgPSAoZmxvYXQpIHZpZXdXaWR0aAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8gREVGQVVMVF9WSUVXUE9SVF9XSURUSDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlID0gcmVzdG9yZVN0YXRlLm1UZXh0V3JhcFNjYWxlOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldE5ld1pvb21TY2FsZShzY2FsZSwgTWF0aC5hYnMoc2NhbGUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbVRleHRXcmFwU2NhbGUpID49IE1JTklNVU1fU0NBTEVfSU5DUkVNRU5ULAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRDb250ZW50U2Nyb2xsVG8ocmVzdG9yZVN0YXRlLm1TY3JvbGxYLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN0b3JlU3RhdGUubVNjcm9sbFkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldENvbnRlbnRTY3JvbGxUbyhyZXN0b3JlU3RhdGUubVNjcm9sbFgsIHJlc3RvcmVTdGF0ZS5tU2Nyb2xsWSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQXMgd2UgYXJlIG9uIGEgbmV3IHBhZ2UsIHJlbW92ZSB0aGUgV2ViVGV4dFZpZXcuIFRoaXMKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpcyBuZWNlc3NhcnkgZm9yIHBhZ2UgbG9hZHMgZHJpdmVuIGJ5IHdlYmtpdCwgYW5kIGluCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcGFydGljdWxhciB3aGVuIHRoZSB1c2VyIHdhcyBvbiBhIHBhc3N3b3JkIGZpZWxkLCBzbwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBXZWJUZXh0VmlldyB3YXMgdmlzaWJsZS4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhclRleHRFbnRyeShmYWxzZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdXBkYXRlIHRoZSB6b29tIGJ1dHRvbnMgYXMgdGhlIHNjYWxlIGNhbiBiZSBjaGFuZ2VkCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGdldFNldHRpbmdzKCkuZ2V0QnVpbHRJblpvb21Db250cm9scygpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZVpvb21CdXR0b25zRW5hYmxlZCgpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQorCiAgICAgICAgICAgICAgICAgICAgIC8vIFdlIHVwZGF0ZSB0aGUgbGF5b3V0IChpLmUuIHJlcXVlc3QgYSBsYXlvdXQgZnJvbSB0aGUKICAgICAgICAgICAgICAgICAgICAgLy8gdmlldyBzeXN0ZW0pIGlmIHRoZSBsYXN0IHZpZXcgc2l6ZSB0aGF0IHdlIHNlbnQgdG8KICAgICAgICAgICAgICAgICAgICAgLy8gV2ViQ29yZSBtYXRjaGVzIHRoZSB2aWV3IHNpemUgb2YgdGhlIHBpY3R1cmUgd2UganVzdApAQCAtNjQ1OCw0MSArNjA3MiwyMSBAQAogICAgICAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIHVwZGF0ZUxheW91dCA9IHZpZXdTaXplLnggPT0gbUxhc3RXaWR0aFNlbnQKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB2aWV3U2l6ZS55ID09IG1MYXN0SGVpZ2h0U2VudDsKICAgICAgICAgICAgICAgICAgICAgcmVjb3JkTmV3Q29udGVudFNpemUoZHJhdy5tV2lkdGhIZWlnaHQueCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3Lm1XaWR0aEhlaWdodC55Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAobUZpbmRJc1VwID8gbUZpbmRIZWlnaHQgOiAwKSwgdXBkYXRlTGF5b3V0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3Lm1XaWR0aEhlaWdodC55LCB1cGRhdGVMYXlvdXQpOwogICAgICAgICAgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgewogICAgICAgICAgICAgICAgICAgICAgICAgUmVjdCBiID0gZHJhdy5tSW52YWxSZWdpb24uZ2V0Qm91bmRzKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJORVdfUElDVFVSRV9NU0dfSUQgeyIgKwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiLmxlZnQrIiwiK2IudG9wKyIsIitiLnJpZ2h0KyIsIitiLmJvdHRvbSsifSIpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGVDb250ZW50UmVjdChkcmF3Lm1JbnZhbFJlZ2lvbi5nZXRCb3VuZHMoKSk7CisKICAgICAgICAgICAgICAgICAgICAgaWYgKG1QaWN0dXJlTGlzdGVuZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgbVBpY3R1cmVMaXN0ZW5lci5vbk5ld1BpY3R1cmUoV2ViVmlldy50aGlzLCBjYXB0dXJlUGljdHVyZSgpKTsKICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAodXNlV2lkZVZpZXdwb3J0KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBsaW1pdCBtWm9vbU92ZXJ2aWV3V2lkdGggdXBwZXIgYm91bmQgdG8KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNNYXhWaWV3cG9ydFdpZHRoIHNvIHRoYXQgaWYgdGhlIHBhZ2UgZG9lc24ndCBiZWhhdmUKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlbGwsIHRoZSBXZWJWaWV3IHdvbid0IGdvIGluc2FuZS4gbGltaXQgdGhlIGxvd2VyCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBib3VuZCB0byBtYXRjaCB0aGUgZGVmYXVsdCBzY2FsZSBmb3IgbW9iaWxlIHNpdGVzLgotICAgICAgICAgICAgICAgICAgICAgICAgbVpvb21PdmVydmlld1dpZHRoID0gTWF0aC5taW4oc01heFZpZXdwb3J0V2lkdGgsIE1hdGgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLm1heCgoaW50KSAodmlld1dpZHRoIC8gbURlZmF1bHRTY2FsZSksIE1hdGgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAubWF4KGRyYXcubU1pblByZWZXaWR0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXcubVZpZXdQb2ludC54KSkpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGlmICghbU1pblpvb21TY2FsZUZpeGVkKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtTWluWm9vbVNjYWxlID0gKGZsb2F0KSB2aWV3V2lkdGggLyBtWm9vbU92ZXJ2aWV3V2lkdGg7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaWYgKCFtRHJhd0hpc3RvcnkgJiYgbUluWm9vbU92ZXJ2aWV3KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBmaXQgdGhlIGNvbnRlbnQgd2lkdGggdG8gdGhlIGN1cnJlbnQgdmlldy4gSWdub3JlCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgcm91bmRpbmcgZXJyb3IgY2FzZS4KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChNYXRoLmFicygodmlld1dpZHRoICogbUludkFjdHVhbFNjYWxlKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1ab29tT3ZlcnZpZXdXaWR0aCkgPiAxKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0TmV3Wm9vbVNjYWxlKChmbG9hdCkgdmlld1dpZHRoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvIG1ab29tT3ZlcnZpZXdXaWR0aCwgTWF0aC5hYnMobUFjdHVhbFNjYWxlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1UZXh0V3JhcFNjYWxlKSA8IE1JTklNVU1fU0NBTEVfSU5DUkVNRU5ULAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgLy8gdXBkYXRlIHRoZSB6b29tIGluZm9ybWF0aW9uIGJhc2VkIG9uIHRoZSBuZXcgcGljdHVyZQorICAgICAgICAgICAgICAgICAgICBtWm9vbU1hbmFnZXIub25OZXdQaWN0dXJlKGRyYXcpOworCiAgICAgICAgICAgICAgICAgICAgIGlmIChkcmF3Lm1Gb2N1c1NpemVDaGFuZ2VkICYmIGluRWRpdGluZ01vZGUoKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgbUZvY3VzU2l6ZUNoYW5nZWQgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICB9CkBAIC02NTMwLDE0ICs2MTI0LDggQEAKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgY2FzZSBSRVFVRVNUX0tFWUJPQVJEX1dJVEhfU0VMRUNUSU9OX01TR19JRDoKICAgICAgICAgICAgICAgICAgICAgZGlzcGxheVNvZnRLZXlib2FyZCh0cnVlKTsKLSAgICAgICAgICAgICAgICAgICAgdXBkYXRlVGV4dFNlbGVjdGlvbkZyb21NZXNzYWdlKG1zZy5hcmcxLCBtc2cuYXJnMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV2ViVmlld0NvcmUuVGV4dFNlbGVjdGlvbkRhdGEpIG1zZy5vYmopOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgLy8gZmFsbCB0aHJvdWdoIHRvIFVQREFURV9URVhUX1NFTEVDVElPTl9NU0dfSUQKICAgICAgICAgICAgICAgICBjYXNlIFVQREFURV9URVhUX1NFTEVDVElPTl9NU0dfSUQ6Ci0gICAgICAgICAgICAgICAgICAgIC8vIElmIG5vIHRleHRmaWVsZCB3YXMgaW4gZm9jdXMsIGFuZCB0aGUgdXNlciB0b3VjaGVkIG9uZSwKLSAgICAgICAgICAgICAgICAgICAgLy8gY2F1c2luZyBpdCB0byBzZW5kIHRoaXMgbWVzc2FnZSwgdGhlbiBXZWJUZXh0VmlldyBoYXMgbm90Ci0gICAgICAgICAgICAgICAgICAgIC8vIGJlZW4gc2V0IHVwIHlldC4gIFJlYnVpbGQgaXQgc28gaXQgY2FuIHNldCBpdHMgc2VsZWN0aW9uLgotICAgICAgICAgICAgICAgICAgICByZWJ1aWxkV2ViVGV4dFZpZXcoKTsKICAgICAgICAgICAgICAgICAgICAgdXBkYXRlVGV4dFNlbGVjdGlvbkZyb21NZXNzYWdlKG1zZy5hcmcxLCBtc2cuYXJnMiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV2ViVmlld0NvcmUuVGV4dFNlbGVjdGlvbkRhdGEpIG1zZy5vYmopOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKQEAgLTY1NTUsNyArNjE0Myw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSBNT1ZFX09VVF9PRl9QTFVHSU46CisgICAgICAgICAgICAgICAgY2FzZSBVTkhBTkRMRURfTkFWX0tFWToKICAgICAgICAgICAgICAgICAgICAgbmF2SGFuZGxlZEtleShtc2cuYXJnMSwgMSwgZmFsc2UsIDApOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBjYXNlIFVQREFURV9URVhUX0VOVFJZX01TR19JRDoKQEAgLTY2NDAsMzMgKzYyMjgsNDAgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUHJldmVudERlZmF1bHQgPSBtc2cuYXJnMiA9PSAxID8gUFJFVkVOVF9ERUZBVUxUX1lFUwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBQUkVWRU5UX0RFRkFVTFRfTk87CiAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobVByZXZlbnREZWZhdWx0ID09IFBSRVZFTlRfREVGQVVMVF9ZRVMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hIaWdobGlnaHRSZWdpb24uc2V0RW1wdHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtc2cuYXJnMiA9PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBwcmV2ZW50IGRlZmF1bHQgaXMgbm90IGNhbGxlZCBpbiBXZWJDb3JlLCBzbyB0aGUKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG1lc3NhZ2UgbmVlZHMgdG8gYmUgcmVwcm9jZXNzZWQgaW4gVUkKICAgICAgICAgICAgICAgICAgICAgICAgIFRvdWNoRXZlbnREYXRhIHRlZCA9IChUb3VjaEV2ZW50RGF0YSkgbXNnLm9iajsKICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAodGVkLm1BY3Rpb24pIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9ET1dOOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdERlZmVyVG91Y2hYID0gdGVkLm1WaWV3WDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3REZWZlclRvdWNoWSA9IHRlZC5tVmlld1k7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1MYXN0RGVmZXJUb3VjaFggPSBjb250ZW50VG9WaWV3WCh0ZWQubVgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtU2Nyb2xsWDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3REZWZlclRvdWNoWSA9IGNvbnRlbnRUb1ZpZXdZKHRlZC5tWSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1TY3JvbGxZOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRGVmZXJUb3VjaE1vZGUgPSBUT1VDSF9JTklUX01PREU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgTW90aW9uRXZlbnQuQUNUSU9OX01PVkU6IHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm8gc25hcHBpbmcgaW4gZGVmZXIgcHJvY2VzcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeCA9IGNvbnRlbnRUb1ZpZXdYKHRlZC5tWCkgLSBtU2Nyb2xsWDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHkgPSBjb250ZW50VG9WaWV3WSh0ZWQubVkpIC0gbVNjcm9sbFk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtRGVmZXJUb3VjaE1vZGUgIT0gVE9VQ0hfRFJBR19NT0RFKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRGVmZXJUb3VjaE1vZGUgPSBUT1VDSF9EUkFHX01PREU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdERlZmVyVG91Y2hYID0gdGVkLm1WaWV3WDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1MYXN0RGVmZXJUb3VjaFkgPSB0ZWQubVZpZXdZOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3REZWZlclRvdWNoWCA9IHg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdERlZmVyVG91Y2hZID0geTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0RHJhZygpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBkZWx0YVggPSBwaW5Mb2NYKChpbnQpIChtU2Nyb2xsWAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbUxhc3REZWZlclRvdWNoWCAtIHRlZC5tVmlld1gpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbUxhc3REZWZlclRvdWNoWCAtIHgpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbVNjcm9sbFg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBkZWx0YVkgPSBwaW5Mb2NZKChpbnQpIChtU2Nyb2xsWQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbUxhc3REZWZlclRvdWNoWSAtIHRlZC5tVmlld1kpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbUxhc3REZWZlclRvdWNoWSAtIHkpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbVNjcm9sbFk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvRHJhZyhkZWx0YVgsIGRlbHRhWSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkZWx0YVggIT0gMCkgbUxhc3REZWZlclRvdWNoWCA9IHRlZC5tVmlld1g7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkZWx0YVkgIT0gMCkgbUxhc3REZWZlclRvdWNoWSA9IHRlZC5tVmlld1k7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkZWx0YVggIT0gMCkgbUxhc3REZWZlclRvdWNoWCA9IHg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkZWx0YVkgIT0gMCkgbUxhc3REZWZlclRvdWNoWSA9IHk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9VUDoKQEAgLTY2ODAsOSArNjI3NSw5IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgV2ViVmlld0NvcmUuQUNUSU9OX0RPVUJMRVRBUDoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZG9Eb3VibGVUYXAoKSBuZWVkcyBtTGFzdFRvdWNoWC9ZIGFzIGFuY2hvcgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdFRvdWNoWCA9IHRlZC5tVmlld1g7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1MYXN0VG91Y2hZID0gdGVkLm1WaWV3WTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9Eb3VibGVUYXAoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3RUb3VjaFggPSBjb250ZW50VG9WaWV3WCh0ZWQubVgpIC0gbVNjcm9sbFg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1MYXN0VG91Y2hZID0gY29udGVudFRvVmlld1kodGVkLm1ZKSAtIG1TY3JvbGxZOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtWm9vbU1hbmFnZXIuaGFuZGxlRG91YmxlVGFwKG1MYXN0VG91Y2hYLCBtTGFzdFRvdWNoWSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1EZWZlclRvdWNoTW9kZSA9IFRPVUNIX0RPTkVfTU9ERTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBXZWJWaWV3Q29yZS5BQ1RJT05fTE9OR1BSRVNTOgpAQCAtNjY5MCw3ICs2Mjg1LDYgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhpdFRlc3QgIT0gbnVsbCAmJiBoaXRUZXN0Lm1UeXBlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gSGl0VGVzdFJlc3VsdC5VTktOT1dOX1RZUEUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBlcmZvcm1Mb25nQ2xpY2soKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlYnVpbGRXZWJUZXh0VmlldygpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1EZWZlclRvdWNoTW9kZSA9IFRPVUNIX0RPTkVfTU9ERTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CkBAIC02ODE0LDcgKzY0MDgsNiBAQAogCiAgICAgICAgICAgICAgICAgY2FzZSBDRU5URVJfRklUX1JFQ1Q6CiAgICAgICAgICAgICAgICAgICAgIFJlY3QgciA9IChSZWN0KW1zZy5vYmo7Ci0gICAgICAgICAgICAgICAgICAgIG1Jblpvb21PdmVydmlldyA9IGZhbHNlOwogICAgICAgICAgICAgICAgICAgICBjZW50ZXJGaXRSZWN0KHIubGVmdCwgci50b3AsIHIud2lkdGgoKSwgci5oZWlnaHQoKSk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogCkBAIC02ODIzLDYgKzY0MTYsMzYgQEAKICAgICAgICAgICAgICAgICAgICAgbVZlcnRpY2FsU2Nyb2xsQmFyTW9kZSA9IG1zZy5hcmcyOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKIAorICAgICAgICAgICAgICAgIGNhc2UgU0VMRUNUSU9OX1NUUklOR19DSEFOR0VEOgorICAgICAgICAgICAgICAgICAgICBpZiAobUFjY2Vzc2liaWxpdHlJbmplY3RvciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgc2VsZWN0aW9uU3RyaW5nID0gKFN0cmluZykgbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1BY2Nlc3NpYmlsaXR5SW5qZWN0b3Iub25TZWxlY3Rpb25TdHJpbmdDaGFuZ2Uoc2VsZWN0aW9uU3RyaW5nKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgU0VUX1RPVUNIX0hJR0hMSUdIVF9SRUNUUzoKKyAgICAgICAgICAgICAgICAgICAgaW52YWxpZGF0ZShtVG91Y2hIaWdobGlnaHRSZWdpb24uZ2V0Qm91bmRzKCkpOworICAgICAgICAgICAgICAgICAgICBtVG91Y2hIaWdobGlnaHRSZWdpb24uc2V0RW1wdHkoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1zZy5vYmogIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXlMaXN0PFJlY3Q+IHJlY3RzID0gKEFycmF5TGlzdDxSZWN0PikgbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoUmVjdCByZWN0IDogcmVjdHMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZWN0IHZpZXdSZWN0ID0gY29udGVudFRvVmlld1JlY3QocmVjdCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc29tZSBzaXRlcywgbGlrZSBzdG9yaWVzIGluIG55dGltZXMuY29tLCBzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBtb3VzZSBldmVudCBoYW5kbGVyIGluIHRoZSB0b3AgZGl2LiBJdCBpcyBub3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB1c2VyIGZyaWVuZGx5IHRvIGhpZ2hsaWdodCB0aGUgZGl2IGlmIGl0IGNvdmVycworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG1vcmUgdGhhbiBoYWxmIG9mIHRoZSBzY3JlZW4uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZpZXdSZWN0LndpZHRoKCkgPCBnZXRXaWR0aCgpID4+IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IHZpZXdSZWN0LmhlaWdodCgpIDwgZ2V0SGVpZ2h0KCkgPj4gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hIaWdobGlnaHRSZWdpb24udW5pb24odmlld1JlY3QpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKHZpZXdSZWN0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhMT0dUQUcsICJTa2lwIHRoZSBodWdlIHNlbGVjdGlvbiByZWN0OiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHZpZXdSZWN0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKICAgICAgICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgICAgICBzdXBlci5oYW5kbGVNZXNzYWdlKG1zZyk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwpAQCAtNzEzMCwzNyArNjc1Myw2IEBACiAgICAgICAgICAgICAgICAgbmV3IEludm9rZUxpc3RCb3goYXJyYXksIGVuYWJsZWRBcnJheSwgc2VsZWN0ZWRBcnJheSkpOwogICAgIH0KIAotICAgIHByaXZhdGUgdm9pZCB1cGRhdGVab29tUmFuZ2UoV2ViVmlld0NvcmUuUmVzdG9yZVN0YXRlIHJlc3RvcmVTdGF0ZSwKLSAgICAgICAgICAgIGludCB2aWV3V2lkdGgsIGludCBtaW5QcmVmV2lkdGgsIGJvb2xlYW4gdXBkYXRlWm9vbU92ZXJ2aWV3KSB7Ci0gICAgICAgIGlmIChyZXN0b3JlU3RhdGUubU1pblNjYWxlID09IDApIHsKLSAgICAgICAgICAgIGlmIChyZXN0b3JlU3RhdGUubU1vYmlsZVNpdGUpIHsKLSAgICAgICAgICAgICAgICBpZiAobWluUHJlZldpZHRoID4gTWF0aC5tYXgoMCwgdmlld1dpZHRoKSkgewotICAgICAgICAgICAgICAgICAgICBtTWluWm9vbVNjYWxlID0gKGZsb2F0KSB2aWV3V2lkdGggLyBtaW5QcmVmV2lkdGg7Ci0gICAgICAgICAgICAgICAgICAgIG1NaW5ab29tU2NhbGVGaXhlZCA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICBpZiAodXBkYXRlWm9vbU92ZXJ2aWV3KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBXZWJTZXR0aW5ncyBzZXR0aW5ncyA9IGdldFNldHRpbmdzKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtSW5ab29tT3ZlcnZpZXcgPSBzZXR0aW5ncy5nZXRVc2VXaWRlVmlld1BvcnQoKSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXR0aW5ncy5nZXRMb2FkV2l0aE92ZXJ2aWV3TW9kZSgpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgbU1pblpvb21TY2FsZSA9IHJlc3RvcmVTdGF0ZS5tRGVmYXVsdFNjYWxlOwotICAgICAgICAgICAgICAgICAgICBtTWluWm9vbVNjYWxlRml4ZWQgPSB0cnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgbU1pblpvb21TY2FsZSA9IERFRkFVTFRfTUlOX1pPT01fU0NBTEU7Ci0gICAgICAgICAgICAgICAgbU1pblpvb21TY2FsZUZpeGVkID0gZmFsc2U7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBtTWluWm9vbVNjYWxlID0gcmVzdG9yZVN0YXRlLm1NaW5TY2FsZTsKLSAgICAgICAgICAgIG1NaW5ab29tU2NhbGVGaXhlZCA9IHRydWU7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKHJlc3RvcmVTdGF0ZS5tTWF4U2NhbGUgPT0gMCkgewotICAgICAgICAgICAgbU1heFpvb21TY2FsZSA9IERFRkFVTFRfTUFYX1pPT01fU0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XMgZmlsZSBwaWNrZXIuCisgICAgICogQHJldHVybiBTdHJpbmcgdmVyc2lvbiBvZiB0aGUgVVJJLgogICAgICAqLwotICAgIHByaXZhdGUgU3RyaW5nIG9wZW5GaWxlQ2hvb3NlcigpIHsKLSAgICAgICAgVXJpIHVyaSA9IG1DYWxsYmFja1Byb3h5Lm9wZW5GaWxlQ2hvb3NlcigpOwotICAgICAgICBpZiAodXJpID09IG51bGwpIHJldHVybiAiIjsKLSAgICAgICAgLy8gRmluZCBvdXQgdGhlIG5hbWUsIGFuZCBhcHBlbmQgaXQgdG8gdGhlIFVSSS4KLSAgICAgICAgLy8gV2Via2l0IHdpbGwgdHJlYXQgdGhlIG5hbWUgYXMgdGhlIGZpbGVuYW1lLCBhbmQKLSAgICAgICAgLy8gdGhlIFVSSSBhcyB0aGUgcGF0aC4gIFRoZSBVUkkgd2lsbCBiZSB1c2VkCi0gICAgICAgIC8vIGluIEJyb3dzZXJGcmFtZSB0byBnZXQgdGhlIGFjdHVhbCBkYXRhLgotICAgICAgICBDdXJzb3IgY3Vyc29yID0gbUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCkucXVlcnkoCi0gICAgICAgICAgICAgICAgdXJpLAotICAgICAgICAgICAgICAgIG5ldyBTdHJpbmdbXSB7IE9wZW5hYmxlQ29sdW1ucy5ESVNQTEFZX05BTUUgfSwKLSAgICAgICAgICAgICAgICBudWxsLAotICAgICAgICAgICAgICAgIG51bGwsCi0gICAgICAgICAgICAgICAgbnVsbCk7Ci0gICAgICAgIFN0cmluZyBuYW1lID0gIiI7Ci0gICAgICAgIGlmIChjdXJzb3IgIT0gbnVsbCkgewotICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBpZiAoY3Vyc29yLm1vdmVUb05leHQoKSkgewotICAgICAgICAgICAgICAgICAgICBuYW1lID0gY3Vyc29yLmdldFN0cmluZygwKTsKKyAgICBwcml2YXRlIFN0cmluZyBvcGVuRmlsZUNob29zZXIoU3RyaW5nIGFjY2VwdFR5cGUpIHsKKyAgICAgICAgVXJpIHVyaSA9IG1DYWxsYmFja1Byb3h5Lm9wZW5GaWxlQ2hvb3NlcihhY2NlcHRUeXBlKTsKKyAgICAgICAgaWYgKHVyaSAhPSBudWxsKSB7CisgICAgICAgICAgICBTdHJpbmcgZmlsZVBhdGggPSAiIjsKKyAgICAgICAgICAgIC8vIE5vdGUgLSBxdWVyeWluZyBmb3IgTWVkaWFTdG9yZS5JbWFnZXMuTWVkaWEuREFUQQorICAgICAgICAgICAgLy8gc2VlbXMgdG8gd29yayBmb3IgYWxsIGNvbnRlbnQgVVJJcywgbm90IGp1c3QgaW1hZ2VzCisgICAgICAgICAgICBDdXJzb3IgY3Vyc29yID0gbUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCkucXVlcnkoCisgICAgICAgICAgICAgICAgICAgIHVyaSwKKyAgICAgICAgICAgICAgICAgICAgbmV3IFN0cmluZ1tdIHsgTWVkaWFTdG9yZS5JbWFnZXMuTWVkaWEuREFUQSB9LAorICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBudWxsKTsKKyAgICAgICAgICAgIGlmIChjdXJzb3IgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChjdXJzb3IubW92ZVRvTmV4dCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmaWxlUGF0aCA9IGN1cnNvci5nZXRTdHJpbmcoMCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgICAgICBjdXJzb3IuY2xvc2UoKTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgICAgIGN1cnNvci5jbG9zZSgpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBmaWxlUGF0aCA9IHVyaS5nZXRMYXN0UGF0aFNlZ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WV3WDsKLSAgICAgICAgZmxvYXQgbVZpZXdZOwogICAgIH0KIAogICAgIHN0YXRpYyBjbGFzcyBHZW9sb2NhdGlvblBlcm1pc3Npb25zRGF0YSB7CkBAIC03MTgsNyArNzMzLDExIEBACiAgICAgICAgIGJvb2xlYW4gbVJlbWVtYmVyOwogICAgIH0KIAotCisgICAgc3RhdGljIGNsYXNzIE1vZGlmeVNlbGVjdGlvbkRhdGEgeworICAgICAgICBTdHJpbmcgbUFsdGVyOworICAgICAgICBTdHJpbmcgbURpcmVjdGlvbjsKKyAgICAgICAgU3RyaW5nIG1HcmFudWxhcml0eTsKKyAgICB9CiAKICAgICAgICAgc3RhdGljIGZpbmFsIFN0cmluZ1tdIEhhbmRsZXJEZWJ1Z1N0cmluZyA9IHsKICAgICAgICAgICAgICJSRVFVRVNUX0xBQkVMIiwgLy8gOTcKQEAgLTg2NSw2ICs4ODQsMTIgQEAKICAgICAgICAgc3RhdGljIGZpbmFsIGludCBBRERfUEFDS0FHRV9OQU1FID0gMTg1OwogICAgICAgICBzdGF0aWMgZmluYWwgaW50IFJFTU9WRV9QQUNLQUdFX05BTUUgPSAxODY7CiAKKyAgICAgICAgc3RhdGljIGZpbmFsIGludCBHRVRfVE9VQ0hfSElHSExJR0hUX1JFQ1RTID0gMTg3OworICAgICAgICBzdGF0aWMgZmluYWwgaW50IFJFTU9WRV9UT1VDSF9ISUdITElHSFRfUkVDVFMgPSAxODg7CisKKyAgICAgICAgLy8gYWNjZXNzaWJpbGl0eSBzdXBwb3J0CisgICAgICAgIHN0YXRpYyBmaW5hbCBpbnQgTU9ESUZZX1NFTEVDVElPTiA9IDE5MDsKKwogICAgICAgICAvLyBwcml2YXRlIG1lc3NhZ2UgaWRzCiAgICAgICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBERVNUUk9ZID0gICAgIDIwMDsKIApAQCAtMTIzOCw2ICsxMjYzLDE5IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlU2V0U2VsZWN0aW9uKG1zZy5hcmcxLCBtc2cuYXJnMik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgTU9ESUZZX1NFTEVDVElPTjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBNb2RpZnlTZWxlY3Rpb25EYXRhIG1vZGlmeVNlbGVjdGlvbkRhdGEgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTW9kaWZ5U2VsZWN0aW9uRGF0YSkgbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgc2VsZWN0aW9uU3RyaW5nID0gbmF0aXZlTW9kaWZ5U2VsZWN0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kaWZ5U2VsZWN0aW9uRGF0YS5tQWx0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RpZnlTZWxlY3Rpb25EYXRhLm1EaXJlY3Rpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RpZnlTZWxlY3Rpb25EYXRhLm1HcmFudWxhcml0eSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtV2ViVmlldy5tUHJpdmF0ZUhhbmRsZXIub2J0YWluTWVzc2FnZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdlYlZpZXcuU0VMRUNUSU9OX1NUUklOR19DSEFOR0VELCBzZWxlY3Rpb25TdHJpbmcpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc2VuZFRvVGFyZ2V0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgTElTVEJPWF9DSE9JQ0VTOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNwYXJzZUJvb2xlYW5BcnJheSBjaG9pY2VzID0gKFNwYXJzZUJvb2xlYW5BcnJheSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZy5vYmo7CkBAIC0xMzU3LDYgKzEzOTUsMjEgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCcm93c2VyRnJhbWUuc0phdmFCcmlkZ2UucmVtb3ZlUGFja2FnZU5hbWUoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoU3RyaW5nKSBtc2cub2JqKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBHRVRfVE9VQ0hfSElHSExJR0hUX1JFQ1RTOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRvdWNoSGlnaGxpZ2h0RGF0YSBkID0gKFRvdWNoSGlnaGxpZ2h0RGF0YSkgbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBcnJheUxpc3Q8UmVjdD4gcmVjdHMgPSBuYXRpdmVHZXRUb3VjaEhpZ2hsaWdodFJlY3RzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZC5tWCwgZC5tWSwgZC5tU2xvcCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXcubVByaXZhdGVIYW5kbGVyLm9idGFpbk1lc3NhZ2UoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXZWJWaWV3LlNFVF9UT1VDSF9ISUdITElHSFRfUkVDVFMsIHJlY3RzKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNlbmRUb1RhcmdldCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFJFTU9WRV9UT1VDSF9ISUdITElHSFRfUkVDVFM6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXcubVByaXZhdGVIYW5kbGVyLm9idGFpbk1lc3NhZ2UoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXZWJWaWV3LlNFVF9UT1VDSF9ISUdITElHSFRfUkVDVFMsIG51bGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc2VuZFRvVGFyZ2V0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9OwpAQCAtMTU3NSwxMSArMTYyOCwxMiBAQAogICAgICAgICAgICAgaWYgKGtleUNvZGUgPj0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1VQCiAgICAgICAgICAgICAgICAgICAgICYmIGtleUNvZGUgPD0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1JJR0hUKSB7CiAgICAgICAgICAgICAgICAgaWYgKERlYnVnRmxhZ3MuV0VCX1ZJRVdfQ09SRSkgewotICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJrZXk6IGFycm93IHVudXNlZCBieSBwbHVnaW46ICIgKyBrZXlDb2RlKTsKKyAgICAgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAia2V5OiBhcnJvdyB1bnVzZWQgYnkgcGFnZTogIiArIGtleUNvZGUpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBpZiAobVdlYlZpZXcgIT0gbnVsbCAmJiBldnQuaXNEb3duKCkpIHsKICAgICAgICAgICAgICAgICAgICAgTWVzc2FnZS5vYnRhaW4obVdlYlZpZXcubVByaXZhdGVIYW5kbGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdlYlZpZXcuTU9WRV9PVVRfT0ZfUExVR0lOLCBrZXlDb2RlKS5zZW5kVG9UYXJnZXQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBXZWJWaWV3LlVOSEFORExFRF9OQVZfS0VZLCBrZXlDb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApLnNlbmRUb1RhcmdldCgpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICB9CkBAIC0xODE3LDYgKzE4NzEsOCBAQAogICAgICAgICAvLyBjYWxsZWQgZnJvbSBVSSB0aHJlYWQgd2hpbGUgV0VCS0lUX0RSQVcgaXMganVzdCBwdWxsZWQgb3V0IG9mIHRoZQogICAgICAgICAvLyBxdWV1ZSBpbiBXZWJDb3JlIHRocmVhZCB0byBiZSBleGVjdXRlZC4gVGhlbiB1cGRhdGUgd29uJ3QgYmUgYmxvY2tlZC4KICAgICAgICAgaWYgKGNvcmUgIT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKCFjb3JlLmdldFNldHRpbmdzKCkuZW5hYmxlU21vb3RoVHJhbnNpdGlvbigpKSByZXR1cm47CisKICAgICAgICAgICAgIHN5bmNocm9uaXplZCAoY29yZSkgewogICAgICAgICAgICAgICAgIGNvcmUubURyYXdJc1BhdXNlZCA9IHRydWU7CiAgICAgICAgICAgICAgICAgaWYgKGNvcmUubURyYXdJc1NjaGVkdWxlZCkgewpAQCAtMTgyOSw2ICsxODg1LDEwIEBACiAKICAgICBzdGF0aWMgdm9pZCByZXN1bWVVcGRhdGVQaWN0dXJlKFdlYlZpZXdDb3JlIGNvcmUpIHsKICAgICAgICAgaWYgKGNvcmUgIT0gbnVsbCkgeworICAgICAgICAgICAgLy8gaWYgbURyYXdJc1BhdXNlZCBpcyB0cnVlLCBpZ25vcmUgdGhlIHNldHRpbmcsIGNvbnRpbnVlIHRvIHJlc3VtZQorICAgICAgICAgICAgaWYgKCFjb3JlLm1EcmF3SXNQYXVzZWQKKyAgICAgICAgICAgICAgICAgICAgJiYgIWNvcmUuZ2V0U2V0dGluZ3MoKS5lbmFibGVTbW9vdGhUcmFuc2l0aW9uKCkpIHJldHVybjsKKwogICAgICAgICAgICAgc3luY2hyb25pemVkIChjb3JlKSB7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BsZXRlcy4KKyAgICBwcml2YXRlIGJvb2xlYW4gbUluaXRpYWxpemVkID0gZmFsc2U7CisKKyAgICBwcml2YXRlIFdlYlZpZXdEYXRhYmFzZShmaW5hbCBDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgbmV3IFRocmVhZCgpIHsKKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgIGluaXQoY29udGV4dCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0uc3RhcnQoKTsKKwogICAgICAgICAvLyBTaW5nbGV0b24gb25seSwgdXNlIGdldEluc3RhbmNlKCkKICAgICB9CiAKICAgICBwdWJsaWMgc3RhdGljIHN5bmNocm9uaXplZCBXZWJWaWV3RGF0YWJhc2UgZ2V0SW5zdGFuY2UoQ29udGV4dCBjb250ZXh0KSB7CiAgICAgICAgIGlmIChtSW5zdGFuY2UgPT0gbnVsbCkgewotICAgICAgICAgICAgbUluc3RhbmNlID0gbmV3IFdlYlZpZXdEYXRhYmFzZSgpOwotICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBtRGF0YWJhc2UgPSBjb250ZXh0Ci0gICAgICAgICAgICAgICAgICAgICAgICAub3Blbk9yQ3JlYXRlRGF0YWJhc2UoREFUQUJBU0VfRklMRSwgMCwgbnVsbCk7Ci0gICAgICAgICAgICB9IGNhdGNoIChTUUxpdGVFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgIC8vIHRyeSBhZ2FpbiBieSBkZWxldGluZyB0aGUgb2xkIGRiIGFuZCBjcmVhdGUgYSBuZXcgb25lCi0gICAgICAgICAgICAgICAgaWYgKGNvbnRleHQuZGVsZXRlRGF0YWJhc2UoREFUQUJBU0VfRklMRSkpIHsKLSAgICAgICAgICAgICAgICAgICAgbURhdGFiYXNlID0gY29udGV4dC5vcGVuT3JDcmVhdGVEYXRhYmFzZShEQVRBQkFTRV9GSUxFLCAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1JbnN0YW5jZSA9IG5ldyBXZWJWaWV3RGF0YWJhc2UoY29udGV4dCk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG1JbnN0YW5jZTsKKyAgICB9CiAKLSAgICAgICAgICAgIC8vIG1EYXRhYmFzZSBzaG91bGQgbm90IGJlIG51bGwsIAotICAgICAgICAgICAgLy8gdGhlIG9ubHkgY2FzZSBpcyBSZXF1ZXN0QVBJIHRlc3QgaGFzIHByb2JsZW0gdG8gY3JlYXRlIGRiIAotICAgICAgICAgICAgaWYgKG1EYXRhYmFzZSAhPSBudWxsICYmIG1EYXRhYmFzZS5nZXRWZXJzaW9uKCkgIT0gREFUQUJBU0VfVkVSU0lPTikgewotICAgICAgICAgICAgICAgIG1EYXRhYmFzZS5iZWdpblRyYW5zYWN0aW9uKCk7Ci0gICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgdXBncmFkZURhdGFiYXNlKCk7Ci0gICAgICAgICAgICAgICAgICAgIG1EYXRhYmFzZS5zZXRUcmFuc2FjdGlvblN1Y2Nlc3NmdWwoKTsKLSAgICAgICAgICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgICAgICAgICBtRGF0YWJhc2UuZW5kVHJhbnNhY3Rpb24oKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9CisgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgdm9pZCBpbml0KENvbnRleHQgY29udGV4dCkgeworICAgICAgICBpZiAobUluaXRpYWxpemVkKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KIAotICAgICAgICAgICAgaWYgKG1EYXRhYmFzZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgLy8gdXNlIHBlciB0YWJsZSBNdXRleCBsb2NrLCB0dXJuIG9mZi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ICAgICAgICAgICAuZ2V0Q29sdW1uSW5kZXgoQ0FDSEVfRVRBR19DT0wpOwotICAgICAgICAgICAgICAgIG1DYWNoZUV4cGlyZXNDb2xJbmRleCA9IG1DYWNoZUluc2VydGVyCi0gICAgICAgICAgICAgICAgICAgICAgICAuZ2V0Q29sdW1uSW5kZXgoQ0FDSEVfRVhQSVJFU19DT0wpOwotICAgICAgICAgICAgICAgIG1DYWNoZUV4cGlyZXNTdHJpbmdDb2xJbmRleCA9IG1DYWNoZUluc2VydGVyCi0gICAgICAgICAgICAgICAgICAgICAgICAuZ2V0Q29sdW1uSW5kZXgoQ0FDSEVfRVhQSVJFU19TVFJJTkdfQ09MKTsKLSAgICAgICAgICAgICAgICBtQ2FjaGVNaW1lVHlwZUNvbEluZGV4ID0gbUNhY2hlSW5zZXJ0ZXIKLSAgICAgICAgICAgICAgICAgICAgICAgIC5nZXRDb2x1bW5JbmRleChDQUNIRV9NSU1FVFlQRV9DT0wpOwotICAgICAgICAgICAgICAgIG1DYWNoZUVuY29kaW5nQ29sSW5kZXggPSBtQ2FjaGVJbnNlcnRlcgotICAgICAgICAgICAgICAgICAgICAgICAgLmdldENvbHVtbkluZGV4KENBQ0hFX0VOQ09ESU5HX0NPTCk7Ci0gICAgICAgICAgICAgICAgbUNhY2hlSHR0cFN0YXR1c0NvbEluZGV4ID0gbUNhY2hlSW5zZXJ0ZXIKLSAgICAgICAgICAgICAgICAgICAgICAgIC5nZXRDb2x1bW5JbmRleChDQUNIRV9IVFRQX1NUQVRVU19DT0wpOwotICAgICAgICAgICAgICAgIG1DYWNoZUxvY2F0aW9uQ29sSW5kZXggPSBtQ2FjaGVJbnNlcnRlcgotICAgICAgICAgICAgICAgICAgICAgICAgLmdldENvbHVtbkluZGV4KENBQ0hFX0xPQ0FUSU9OX0NPTCk7Ci0gICAgICAgICAgICAgICAgbUNhY2hlQ29udGVudExlbmd0aENvbEluZGV4ID0gbUNhY2hlSW5zZXJ0ZXIKLSAgICAgICAgICAgICAgICAgICAgICAgIC5nZXRDb2x1bW5JbmRleChDQUNIRV9DT05URU5UTEVOR1RIX0NPTCk7Ci0gICAgICAgICAgICAgICAgbUNhY2hlQ29udGVudERpc3Bvc2l0aW9uQ29sSW5kZXggPSBtQ2FjaGVJbnNlcnRlcgotICAgICAgICAgICAgICAgICAgICAgICAgLmdldENvbHVtbkluZGV4KENBQ0hFX0NPTlRFTlRESVNQT1NJVElPTl9DT0wpOwotICAgICAgICAgICAgICAgIG1DYWNoZUNyb3NzRG9tYWluQ29sSW5kZXggPSBtQ2FjaGVJbnNlcnRlcgotICAgICAgICAgICAgICAgICAgICAgICAgLmdldENvbHVtbkluZGV4KENBQ0hFX0NST1NTRE9NQUlOX0NPTCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBtRGF0YWJhc2UgPSBjb250ZXh0Lm9wZW5PckNyZWF0ZURhdGFiYXNlKERBVEFCQVNFX0ZJTEUsIDAsIG51bGwpOworICAgICAgICB9IGNhdGNoIChTUUxpdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgLy8gdHJ5IGFnYWluIGJ5IGRlbGV0aW5nIHRoZSBvbGQgZGIgYW5kIGNyZWF0ZSBhIG5ldyBvbmUKKyAgICAgICAgICAgIGlmIChjb250ZXh0LmRlbGV0ZURhdGFiYXNlKERBVEFCQVNFX0ZJTEUpKSB7CisgICAgICAgICAgICAgICAgbURhdGFiYXNlID0gY29udGV4dC5vcGVuT3JDcmVhdGVEYXRhYmFzZShEQVRBQkFTRV9GSUxFLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIAotICAgICAgICByZXR1cm4gbUluc3RhbmNlOworICAgICAgICAvLyBtRGF0YWJhc2Ugc2hvdWxkIG5vdCBiZSBudWxsLAorICAgICAgICAvLyB0aGUgb25seSBjYXNlIGlzIFJlcXVlc3RBUEkgdGVzdCBoYXMgcHJvYmxlbSB0byBjcmVhdGUgZGIKKyAgICAgICAgaWYgKG1EYXRhYmFzZSA9PSBudWxsKSB7CisgICAgICAgICAgICBtSW5pdGlhbGl6ZWQgPSB0cnVlOworICAgICAgICAgICAgbm90aWZ5KCk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBpZiAobURhdGFiYXNlLmdldFZlcnNpb24oKSAhPSBEQVRBQkFTRV9WRVJTSU9OKSB7CisgICAgICAgICAgICBtRGF0YWJhc2UuYmVnaW5UcmFuc2FjdGlvbigpOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICB1cGdyYWRlRGF0YWJhc2UoKTsKKyAgICAgICAgICAgICAgICBtRGF0YWJhc2Uuc2V0VHJhbnNhY3Rpb25TdWNjZXNzZnVsKCk7CisgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIG1EYXRhYmFzZS5lbmRUcmFuc2FjdGlvbigpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gdXNlIHBlciB0YWJsZSBNdXRleCBsb2NrLCB0dXJuIG9mZiBkYXRhYmFzZSBsb2NrLCB0aGlzCisgICAgICAgIC8vIGltcHJvdmVzIHBlcmZvcm1hbmNlIGFzIGRhdGFiYXNlJ3MgUmVlbnRyYW50TG9jayBpcworICAgICAgICAvLyBleHBhbnNpdmUKKyAgICAgICAgbURhdGFiYXNlLnNldExvY2tpbmdFbmFibGVkKGZhbHNlKTsKKworICAgICAgICB0cnkgeworICAgICAgICAgICAgbUNhY2hlRGF0YWJhc2UgPSBjb250ZXh0Lm9wZW5PckNyZWF0ZURhdGFiYXNlKAorICAgICAgICAgICAgICAgICAgICBDQUNIRV9EQVRBQkFTRV9GSUxFLCAwLCBudWxsKTsKKyAgICAgICAgfSBjYXRjaCAoU1FMaXRlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIC8vIHRyeSBhZ2FpbiBieSBkZWxldGluZyB0aGUgb2xkIGRiIGFuZCBjcmVhdGUgYSBuZXcgb25lCisgICAgICAgICAgICBpZiAoY29udGV4dC5kZWxldGVEYXRhYmFzZShDQUNIRV9EQVRBQkFTRV9GSUxFKSkgeworICAgICAgICAgICAgICAgIG1DYWNoZURhdGFiYXNlID0gY29udGV4dC5vcGVuT3JDcmVhdGVEYXRhYmFzZSgKKyAgICAgICAgICAgICAgICAgICAgICAgIENBQ0hFX0RBVEFCQVNFX0ZJTEUsIDAsIG51bGwpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gbUNhY2hlRGF0YWJhc2Ugc2hvdWxkIG5vdCBiZSBudWxsLAorICAgICAgICAvLyB0aGUgb25seSBjYXNlIGlzIFJlcXVlc3RBUEkgdGVzdCBoYXMgcHJvYmxlbSB0byBjcmVhdGUgZGIKKyAgICAgICAgaWYgKG1DYWNoZURhdGFiYXNlID09IG51bGwpIHsKKyAgICAgICAgICAgIG1Jbml0aWFsaXplZCA9IHRydWU7CisgICAgICAgICAgICBub3RpZnkoKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChtQ2FjaGVEYXRhYmFzZS5nZXRWZXJzaW9uKCkgIT0gQ0FDSEVfREFUQUJBU0VfVkVSU0lPTikgeworICAgICAgICAgICAgbUNhY2hlRGF0YWJhc2UuYmVnaW5UcmFuc2FjdGlvbigpOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICB1cGdyYWRlQ2FjaGVEYXRhYmFzZSgpOworICAgICAgICAgICAgICAgIGJvb3RzdHJhcENhY2hlRGF0YWJhc2UoKTsKKyAgICAgICAgICAgICAgICBtQ2FjaGVEYXRhYmFzZS5zZXRUcmFuc2FjdGlvblN1Y2Nlc3NmdWwoKTsKKyAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgbUNhY2hlRGF0YWJhc2UuZW5kVHJhbnNhY3Rpb24oKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIEVyYXNlIH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ZSAoIW1Jbml0aWFsaXplZCkgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIHdhaXQoKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5lKExPR1RBRywgIkNhdWdodCBleGNlcHRpb24gd2hpbGUgY2hlY2tpbmcgIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImluaXRpYWxpemF0aW9uIik7CisgICAgICAgICAgICAgICAgICAgIExvZy5lKExPR1RBRywgTG9nLmdldFN0YWNrVHJhY2VTdHJpbmcoZSkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbURhdGFiYXNlICE9IG51bGw7CisgICAgfQorCiAgICAgcHJpdmF0ZSBib29sZWFuIGhhc0VudHJpZXMoaW50IHRhYmxlSWQpIHsKLSAgICAgICAgaWYgKG1EYXRhYmFzZSA9PSBudWxsKSB7CisgICAgICAgIGlmICghY2hlY2tJbml0aWFsaXplZCgpKSB7CiAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KIApAQCAtNDIyLDcgKzQ2Nyw3IEBACiAgICAgICovCiAgICAgQXJyYXlMaXN0PENvb2tpZT4gZ2V0Q29va2llc0ZvckRvbWFpbihTdHJpbmcgZG9tYWluKSB7CiAgICAgICAgIEFycmF5TGlzdDxDb29raWU+IGxpc3QgPSBuZXcgQXJyYXlMaXN0PENvb2tpZT4oKTsKLSAgICAgICAgaWYgKGRvbWFpbiA9PSBudWxsIHx8IG1EYXRhYmFzZSA9PSBudWxsKSB7CisgICAgICAgIGlmIChkb21haW4gPT0gbnVsbCB8fCAhY2hlY2tJbml0aWFsaXplZCgpKSB7CiAgICAgICAgICAgICByZXR1cm4gbGlzdDsKICAgICAgICAgfQogCkBAIC00ODEsNyArNTI2LDcgQEAKICAgICAgKiAgICAgICAgICAgIGRlbGV0ZWQuCiAgICAgICovCiAgICAgdm9pZCBkZWxldGVDb29raWVzKFN0cmluZyBkb21haW4sIFN0cmluZyBwYXRoLCBTdHJpbmcgbmFtZSkgewotICAgICAgICBpZiAoZG9tYWluID09IG51bGwgfHwgbURhdGFiYXNlID09IG51bGwpIHsKKyAgICAgICAgaWYgKGRvbWFpbiA9PSBudWxsIHx8ICFjaGVja0luaXRpYWxpemVkKCkpIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogCkBAIC01MDEsNyArNTQ2LDcgQEAKICAgICAgKi8KICAgICB2b2lkIGFkZENvb2tpZShDb29raWUgY29va2llKSB7CiAgICAgICAgIGlmIChjb29raWUuZG9tYWluID09IG51bGwgfHwgY29va2llLnBhdGggPT0gbnVsbCB8fCBjb29raWUubmFtZSA9PSBudWxsCi0gICAgICAgICAgICAgICAgfHwgbURhdGFiYXNlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB8fCAhY2hlY2tJbml0aWFsaXplZCgpKSB7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KIApAQCAtNTM0LDcgKzU3OSw3IEBACiAgICAgICogQ2xlYXIgY29va2llIGRhdGFiYXNlCiAgICAgICovCiAgICAgdm9pZCBjbGVhckNvb2tpZXMoKSB7Ci0gICAgICAgIGlmIChtRGF0YWJhc2UgPT0gbnVsbCkgeworICAgICAgICBpZiAoIWNoZWNrSW5pdGlhbGl6ZWQoKSkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAKQEAgLTU0Nyw3ICs1OTIsNyBAQAogICAgICAqIENsZWFyIHNlc3Npb24gY29va2llcywgd2hpY2ggbWVhbnMgY29va2llIGRvZXNuJ3QgaGF2ZSBFWFBJUkVTLgogICAgICAqLwogICAgIHZvaWQgY2xlYXJTZXNzaW9uQ29va2llcygpIHsKLSAgICAgICAgaWYgKG1EYXRhYmFzZSA9PSBudWxsKSB7CisgICAgICAgIGlmICghY2hlY2tJbml0aWFsaXplZCgpKSB7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KIApAQCAtNTY0LDcgKzYwOSw3IEBACiAgICAgICogQHBhcmFtIG5vdyBUaW1lIGZvciBub3cKICAgICAgKi8KICAgICB2b2lkIGNsZWFyRXhwaXJlZENvb2tpZXMobG9uZyBub3cpIHsKLSAgICAgICAgaWYgKG1EYXRhYmFzZSA9PSBudWxsKSB7CisgICAgICAgIGlmICghY2hlY2tJbml0aWFsaXplZCgpKSB7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KIApAQCAtNjIwLDcgKzY2NSw3IEBACiAgICAgICogQHJldHVybiBDYWNoZVJlc3VsdCBUaGUgQ2FjaGVNYW5hZ2VyLkNhY2hlUmVzdWx0CiAgICAgICovCiAgICAgQ2FjaGVSZXN1bHQgZ2V0Q2FjaGUoU3RyaW5nIHVybCkgewotICAgICAgICBpZiAodXJsID09IG51bGwgfHwgbUNhY2hlRGF0YWJhc2UgPT0gbnVsbCkgeworICAgICAgICBpZiAodXJsID09IG51bGwgfHwgIWNoZWNrSW5pdGlhbGl6ZWQoKSkgewogICAgICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgICAgIH0KIApAQCAtNjYwLDcgKzcwNSw3IEBACiAgICAgICogQHBhcmFtIHVybCBUaGUgdXJsCiAgICAgICovCiAgICAgdm9pZCByZW1vdmVDYWNoZShTdHJpbmcgdXJsKSB7Ci0gICAgICAgIGlmICh1cmwgPT0gbnVsbCB8fCBtQ2FjaGVEYXRhYmFzZSA9PSBudWxsKSB7CisgICAgICAgIGlmICh1cmwgPT0gbnVsbCB8fCAhY2hlY2tJbml0aWFsaXplZCgpKSB7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KIApAQCAtNjc0LDcgKzcxOSw3IEBACiAgICAgICogQHBhcmFtIGMgVGhlIENhY2hlTWFuYWdlci5DYWNoZVJlc3VsdAogICAgICAqLwogICAgIHZvaWQgYWRkQ2FjaGUoU3RyaW5nIHVybCwgQ2FjaGVSZXN1bHQgYykgewotICAgICAgICBpZiAodXJsID09IG51bGwgfHwgbUNhY2hlRGF0YWJhc2UgPT0gbnVsbCkgeworICAgICAgICBpZiAodXJsID09IG51bGwgfHwgIWNoZWNrSW5pdGlhbGl6ZWQoKSkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAKQEAgLTcwMCw3ICs3NDUsNyBAQAogICAgICAqIENsZWFyIGNhY2hlIGRhdGFiYXNlCiAgICAgICovCiAgICAgdm9pZCBjbGVhckNhY2hlKCkgewotICAgICAgICBpZiAobUNhY2hlRGF0YWJhc2UgPT0gbnVsbCkgeworICAgICAgICBpZiAoIWNoZWNrSW5pdGlhbGl6ZWQoKSkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAKQEAgLTcwOCw3ICs3NTMsNyBAQAogICAgIH0KIAogICAgIGJvb2xlYW4gaGFzQ2FjaGUoKSB7Ci0gICAgICAgIGlmIChtQ2FjaGVEYXRhYmFzZSA9PSBudWxsKSB7CisgICAgICAgIGlmICghY2hlY2tJbml0aWFsaXplZCgpKSB7CiAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KIApAQCAtODMxLDcgKzg3Niw3IEBACiAgICAgICovCiAgICAgdm9pZCBzZXRVc2VybmFtZVBhc3N3b3JkKFN0cmluZyBzY2hlbWVQbHVzSG9zdCwgU3RyaW5nIHVzZXJuYW1lLAogICAgICAgICAgICAgICAgIFN0cmluZyBwYXNzd29yZCkgewotICAgICAgICBpZiAoc2NoZW1lUGx1c0hvc3QgPT0gbnVsbCB8fCBtRGF0YWJhc2UgPT0gbnVsbCkgeworICAgICAgICBpZiAoc2NoZW1lUGx1c0hvc3QgPT0gbnVsbCB8fCAhY2hlY2tJbml0aWFsaXplZCgpKSB7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KIApAQCAtODUzLDcgKzg5OCw3IEBACiAgICAgICogICAgICAgICBTdHJpbmdbMV0gaXMgcGFzc3dvcmQuIFJldHVybiBudWxsIGlmIGl0IGNhbid0IGZpbmQgYW55dGhpbmcuCiAgICAgICovCiAgICAgU3RyaW5nW10gZ2V0VXNlcm5hbWVQYXNzd29yZChTdHJpbmcgc2NoZW1lUGx1c0hvc3QpIHsKLSAgICAgICAgaWYgKHNjaGVtZVBsdXNIb3N0ID09IG51bGwgfHwgbURhdGFiYXNlID09IG51bGwpIHsKKyAgICAgICAgaWYgKHNjaGVtZVBsdXNIb3N0ID09IG51bGwgfHwgIWNoZWNrSW5pdGlhbGl6ZWQoKSkgewogICAgICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgICAgIH0KIApAQCAtODk5LDcgKzk0NCw3IEBACiAgICAgICogQ2xlYXIgcGFzc3dvcmQgZGF0YWJhc2UKICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBjbGVhclVzZXJuYW1lUGFzc3dvcmQoKSB7Ci0gICAgICAgIGlmIChtRGF0YWJhc2UgPT0gbnVsbCkgeworICAgICAgICBpZiAoIWNoZWNrSW5pdGlhbGl6ZWQoKSkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAKQEAgLTkyNCw3ICs5NjksNyBAQAogICAgICAqLwogICAgIHZvaWQgc2V0SHR0cEF1dGhVc2VybmFtZVBhc3N3b3JkKFN0cmluZyBob3N0LCBTdHJpbmcgcmVhbG0sIFN0cmluZyB1c2VybmFtZSwKICAgICAgICAgICAgIFN0cmluZyBwYXNzd29yZCkgewotICAgICAgICBpZiAoaG9zdCA9PSBudWxsIHx8IHJlYWxtID09IG51bGwgfHwgbURhdGFiYXNlID09IG51bGwpIHsKKyAgICAgICAgaWYgKGhvc3QgPT0gbnVsbCB8fCByZWFsbSA9PSBudWxsIHx8ICFjaGVja0luaXRpYWxpemVkKCkpIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogCkBAIC05NDksNyArOTk0LDcgQEAKICAgICAgKiAgICAgICAgIF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gICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogCkBAIC0xMDY2LDcgKzExMTEsNyBAQAogICAgICAqLwogICAgIEFycmF5TGlzdDxTdHJpbmc+IGdldEZvcm1EYXRhKFN0cmluZyB1cmwsIFN0cmluZyBuYW1lKSB7CiAgICAgICAgIEFycmF5TGlzdDxTdHJpbmc+IHZhbHVlcyA9IG5ldyBBcnJheUxpc3Q8U3RyaW5nPigpOwotICAgICAgICBpZiAodXJsID09IG51bGwgfHwgbmFtZSA9PSBudWxsIHx8IG1EYXRhYmFzZSA9PSBudWxsKSB7CisgICAgICAgIGlmICh1cmwgPT0gbnVsbCB8fCBuYW1lID09IG51bGwgfHwgIWNoZWNrSW5pdGlhbGl6ZWQoKSkgewogICAgICAgICAgICAgcmV0dXJuIHZhbHVlczsKICAgICAgICAgfQogCkBAIC0xMTI2LDcgKzExNzEsNyBAQAogICAgICAqIENsZWFyIGZvcm0gZGF0YWJhc2UKICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBjbGVhckZvcm1EYXRhKCkgewotICAgICAgICBpZiAobURhdGFiYXNlID09IG51bGwpIHsKKyAgICAgICAgaWYgKCFjaGVja0luaXRpYWxpemVkKCkpIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogCmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC93ZWJraXQvWm9vbUNvbnRyb2xCYXNlLmphdmEgYi9jb3JlL2phdmEvYW5kcm9pZC93ZWJraXQvWm9vbUNvbnRyb2xCYXNlLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uYmU5ZThmMwotLS0gL2Rldi9udWxsCisrKyBiL2NvcmUvamF2YS9hbmRyb2lkL3dlYmtpdC9ab29tQ29udHJvbEJhc2UuamF2YQpAQCAtMCwwICsxLDQxIEBACisvKgorICogQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY3QKKy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isgICAgcHJpdmF0ZSBmaW5hbCBXZWJWaWV3IG1XZWJWaWV3OworCisgICAgLy8gVGhlIGNvbnRyb2xsZXIgaXMgbGF6aWx5IGluaXRpYWxpemVkIGluIGdldENvbnRyb2xzKCkgZm9yIHBlcmZvcm1hbmNlLgorICAgIHByaXZhdGUgWm9vbUJ1dHRvbnNDb250cm9sbGVyIG1ab29tQnV0dG9uc0NvbnRyb2xsZXI7CisKKyAgICBwdWJsaWMgWm9vbUNvbnRyb2xFbWJlZGRlZChab29tTWFuYWdlciB6b29tTWFuYWdlciwgV2ViVmlldyB3ZWJWaWV3KSB7CisgICAgICAgIG1ab29tTWFuYWdlciA9IHpvb21NYW5hZ2VyOworICAgICAgICBtV2ViVmlldyA9IHdlYlZpZXc7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2hvdygpIHsKKyAgICAgICAgaWYgKCFnZXRDb250cm9scygpLmlzVmlzaWJsZSgpICYmICFtWm9vbU1hbmFnZXIuaXNab29tU2NhbGVGaXhlZCgpKSB7CisKKyAgICAgICAgICAgIG1ab29tQnV0dG9uc0NvbnRyb2xsZXIuc2V0VmlzaWJsZSh0cnVlKTsKKworICAgICAgICAgICAgV2ViU2V0dGluZ3Mgc2V0dGluZ3MgPSBtV2ViVmlldy5nZXRTZXR0aW5ncygpOworICAgICAgICAgICAgaW50IGNvdW50ID0gc2V0dGluZ3MuZ2V0RG91YmxlVGFwVG9hc3RDb3VudCgpOworICAgICAgICAgICAgaWYgKG1ab29tTWFuYWdlci5pc0luWm9vbU92ZXJ2aWV3KCkgJiYgY291bnQgPiAwKSB7CisgICAgICAgICAgICAgICAgc2V0dGluZ3Muc2V0RG91YmxlVGFwVG9hc3RDb3VudCgtLWNvdW50KTsKKyAgICAgICAgICAgICAgICBUb2FzdC5tYWtlVGV4dChtV2ViVmlldy5nZXRDb250ZXh0KCksCisgICAgICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy5kb3VibGVfdGFwX3RvYXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgVG9hc3QuTEVOR1RIX0xPTkcpLnNob3coKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGhpZGUoKSB7CisgICAgICAgIGlmIChtWm9vbUJ1dHRvbnNDb250cm9sbGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1ab29tQnV0dG9uc0NvbnRyb2xsZXIuc2V0VmlzaWJsZShmYWxzZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBpc1Zpc2libGUoKSB7CisgICAgICAgIHJldHVybiBtWm9vbUJ1dHRvbnNDb250cm9sbGVyICE9IG51bGwgJiYgbVpvb21CdXR0b25zQ29udHJvbGxlci5pc1Zpc2libGUoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB1cGRhdGUoKSB7CisgICAgICAgIGlmIChtWm9vbUJ1dHRvbnNDb250cm9sbGVyID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGJvb2xlYW4gY2FuWm9vbUluID0gbVpvb21NYW5hZ2VyLmNhblpvb21JbigpOworICAgICAgICBib29sZWFuIGNhblpvb21PdXQgPSBtWm9vbU1hbmFnZXIuY2FuWm9vbU91dCgpICYmICFtWm9vbU1hbmFnZXIuaXNJblpvb21PdmVydmlldygpOworICAgICAgICBpZiAoIWNhblpvb21JbiAmJiAhY2FuWm9vbU91dCkgeworICAgICAgICAgICAgLy8gSGlkZSB0aGUgem9vbSBpbiBhbmQgb3V0IGJ1dHRvbnMgaWYgdGhlIHBhZ2UgY2Fubm90IHpvb20KKyAgICAgICAgICAgIG1ab29tQnV0dG9uc0NvbnRyb2xsZXIuZ2V0Wm9vbUNvbnRyb2xzKCkuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gU2V0IGVhY2ggb25lIGluZGl2aWR1YWxseSwgYXMgYSBwYWdlIG1heSBiZSBhYmxlIHRvIHpvb20gaW4gb3Igb3V0CisgICAgICAgICAgICBtWm9vbUJ1dHRvbnNDb250cm9sbGVyLnNldFpvb21JbkVuYWJsZWQoY2FuWm9vbUluKTsKKyAgICAgICAgICAgIG1ab29tQnV0dG9uc0NvbnRyb2xsZXIuc2V0Wm9vbU91dEVuYWJsZWQoY2FuWm9vbU91dCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIFpvb21CdXR0b25zQ29udHJvbGxlciBnZXRDb250cm9scygpIHsKKyAgICAgICAgaWYgKG1ab29tQnV0dG9uc0NvbnRyb2xsZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgbVpvb21CdXR0b25zQ29udHJvbGxlciA9IG5ldyBab29tQnV0dG9uc0NvbnRyb2xsZXIobVdlYlZpZXcpOworICAgICAgICAgICAgbVpvb21CdXR0b25zQ29udHJvbGxlci5zZXRPblpvb21MaXN0ZW5lcihuZXcgWm9vbUxpc3RlbmVyKCkpOworICAgICAgICAgICAgLy8gWm9vbUJ1dHRvbnNDb250cm9sbGVyIHBvc2l0aW9ucyB0aGUgYnV0dG9ucyBhdCB0aGUgYm90dG9tLCBidXQgaW4KKyAgICAgICAgICAgIC8vIHRoZSBtaWRkbGUuIENoYW5nZSB0aGVpciBsYXlvdXQgcGFyYW1ldGVycyBzbyB0aGV5IGFwcGVhciBvbiB0aGUKKyAgICAgICAgICAgIC8vIHJpZ2h0LgorICAgICAgICAgICAgVmlldyBjb250cm9scyA9IG1ab29tQnV0dG9uc0NvbnRyb2xsZXIuZ2V0Wm9vbUNvbnRyb2xzKCk7CisgICAgICAgICAgICBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zIHBhcmFtcyA9IGNvbnRyb2xzLmdldExheW91dFBhcmFtcygpOworICAgICAgICAgICAgaWYgKHBhcmFtcyBpbnN0YW5jZW9mIEZyYW1lTGF5b3V0LkxheW91dFBhcmFtcykgeworICAgICAgICAgICAgICAgICgoRnJhbWVMYXlvdXQuTGF5b3V0UGFyYW1zKSBwYXJhbXMpLmdyYXZpdHkgPSBHcmF2aXR5LlJJR0hUOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBtWm9vbUJ1dHRvbnNDb250cm9sbGVyOworICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgWm9vbUxpc3RlbmVyIGltcGxlbWVudHMgWm9vbUJ1dHRvbnNDb250cm9sbGVyLk9uWm9vbUxpc3RlbmVyIHsKKworICAgICAgICBwdWJsaWMgdm9pZCBvblZpc2liaWxpdHlDaGFuZ2VkKGJvb2xlYW4gdmlzaWJsZSkgeworICAgICAgICAgICAgaWYgKHZpc2libGUpIHsKKyAgICAgICAgICAgICAgICBtV2ViVmlldy5zd2l0Y2hPdXREcmF3SGlzdG9yeSgpOworICAgICAgICAgICAgICAgIC8vIEJyaW5nIGJhY2sgdGhlIGhpZGRlbiB6b29tIGNvbnRyb2xzLgorICAgICAgICAgICAgICAgIG1ab29tQnV0dG9uc0NvbnRyb2xsZXIuZ2V0Wm9vbUNvbnRyb2xzKCkuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOworICAgICAgICAgICAgICAgIHVwZGF0ZSgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgb25ab29tKGJvb2xlYW4gem9vbUluKSB7CisgICAgICAgICAgICBpZiAoem9vbUluKSB7CisgICAgICAgICAgICAgICAgbVdlYlZpZXcuem9vbUluKCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1XZWJWaWV3Lnpvb21PdXQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHVwZGF0ZSgpOworICAgICAgICB9CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvd2Via2l0L1pvb21Db250cm9sRXh0ZXJuYWw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WV3OworCisgICAgcHVibGljIFpvb21Db250cm9sRXh0ZXJuYWwoV2ViVmlldyB3ZWJWaWV3KSB7CisgICAgICAgIG1XZWJWaWV3ID0gd2ViVmlldzsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzaG93KCkgeworICAgICAgICBpZihtWm9vbUNvbnRyb2xSdW5uYWJsZSAhPSBudWxsKSB7CisgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlQ2FsbGJhY2tzKG1ab29tQ29udHJvbFJ1bm5hYmxlKTsKKyAgICAgICAgfQorICAgICAgICBnZXRDb250cm9scygpLnNob3codHJ1ZSk7CisgICAgICAgIG1Qcml2YXRlSGFuZGxlci5wb3N0RGVsYXllZChtWm9vbUNvbnRyb2xSdW5uYWJsZSwgWk9PTV9DT05UUk9MU19USU1FT1VUKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBoaWRlKCkgeworICAgICAgICBpZiAobVpvb21Db250cm9sUnVubmFibGUgIT0gbnVsbCkgeworICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhtWm9vbUNvbnRyb2xSdW5uYWJsZSk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1ab29tQ29udHJvbHMgIT0gbnVsbCkgeworICAgICAgICAgICAgbVpvb21Db250cm9scy5oaWRlKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBpc1Zpc2libGUoKSB7CisgICAgICAgIHJldHVybiBtWm9vbUNvbnRyb2xzICE9IG51bGwgJiYgbVpvb21Db250cm9scy5pc1Nob3duKCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdXBkYXRlKCkgeyB9CisKKyAgICBwdWJsaWMgRXh0ZW5kZWRab29tQ29udHJvbHMgZ2V0Q29udHJvbHMoKSB7CisgICAgICAgIGlmIChtWm9vbUNvbnRyb2xzID09IG51bGwpIHsKKyAgICAgICAgICAgIG1ab29tQ29udHJvbHMgPSBjcmVhdGVab29tQ29udHJvbHMoKTsKKworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIG5lZWQgdG8gYmUgc2V0IHRvIFZJU0lCTEUgZmlyc3Qgc28gdGhhdCBnZXRNZWFzdXJlZEhlaWdodCgpIGluCisgICAgICAgICAgICAgKiB7QGxpbmsgI29uU2l6ZUNoYW5nZWQoKX0gY2FuIHJldHVybiB0aGUgbWVhc3VyZWQgdmFsdWUgZm9yIHByb3BlcgorICAgICAgICAgICAgICogbGF5b3V0LgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBtWm9vbUNvbnRyb2xzLnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKKyAgICAgICAgICAgIG1ab29tQ29udHJvbFJ1bm5hYmxlID0gbmV3IFJ1bm5hYmxlKCkgeworICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICAgICAgLyogRG9uJ3QgZGlzbWlzcyB0aGUgY29udHJvbHMgaWYgdGhlIHVzZXIgaGFzCisgICAgICAgICAgICAgICAgICAgICAqIGZvY3VzIG9uIHRoZW0uIFdhaXQgYW5kIGNoZWNrIGFnYWluIGxhdGVyLgorICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKCFtWm9vbUNvbnRyb2xzLmhhc0ZvY3VzKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1ab29tQ29udHJvbHMuaGlkZSgpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhtWm9vbUNvbnRyb2xSdW5uYWJsZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucG9zdERlbGF5ZWQobVpvb21Db250cm9sUnVubmFibGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFpPT01fQ09OVFJPTFNfVElNRU9VVCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICB9CisgICAgICAgIHJldHVybiBtWm9vbUNvbnRyb2xzOworICAgIH0KKworICAgIHByaXZhdGUgRXh0ZW5kZWRab29tQ29udHJvbHMgY3JlYXRlWm9vbUNvbnRyb2xzKCkgeworICAgICAgICBFeHRlbmRlZFpvb21Db250cm9scyB6b29tQ29udHJvbHMgPSBuZXcgRXh0ZW5kZWRab29tQ29udHJvbHMobVdlYlZpZXcuZ2V0Q29udGV4dCgpKTsKKyAgICAgICAgem9vbUNvbnRyb2xzLnNldE9uWm9vbUluQ2xpY2tMaXN0ZW5lcihuZXcgT25DbGlja0xpc3RlbmVyKCkgeworICAgICAgICAgICAgcHVibGljIHZvaWQgb25DbGljayhWaWV3IHYpIHsKKyAgICAgICAgICAgICAgICAvLyByZXNldCB0aW1lIG91dAorICAgICAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5yZW1vdmVDYWxsYmFja3MobVpvb21Db250cm9sUnVubmFibGUpOworICAgICAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5wb3N0RGVsYXllZChtWm9vbUNvbnRyb2xSdW5uYWJsZSwgWk9PTV9DT05UUk9MU19USU1FT1VUKTsKKyAgICAgICAgICAgICAgICBtV2ViVmlldy56b29tSW4oKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSk7CisgICAgICAgIHpvb21Db250cm9scy5zZXRPblpvb21PdXRDbGlja0xpc3RlbmVyKG5ldyBPbkNsaWNrTGlzdGVuZXIoKSB7CisgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKFZpZXcgdikgeworICAgICAgICAgICAgICAgIC8vIHJlc2V0IHRpbWUgb3V0CisgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhtWm9vbUNvbnRyb2xSdW5uYWJsZSk7CisgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnBvc3REZWxheWVkKG1ab29tQ29udHJvbFJ1bm5hYmxlLCBaT09NX0NPTlRST0xTX1RJTUVPVVQpOworICAgICAgICAgICAgICAgIG1XZWJWaWV3Lnpvb21PdXQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSk7CisgICAgICAgIHJldHVybiB6b29tQ29udHJvbHM7CisgICAgfQorCisgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgRXh0ZW5kZWRab29tQ29udHJvbHMgZXh0ZW5kcyBGcmFtZUxheW91dCB7CisKKyAgICAgICAgcHJpdmF0ZSBhbmRyb2lkLndpZGdldC5ab29tQ29udHJvbHMgbVBsdXNNaW51c1pvb21Db250cm9sczsKKworICAgICAgICBwdWJsaWMgRXh0ZW5kZWRab29tQ29udHJvbHMoQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgICAgICBzdXBlcihjb250ZXh0LCBudWxsKTsKKyAgICAgICAgICAgIExheW91dEluZmxhdGVyIGluZmxhdGVyID0gKExheW91dEluZmxhdGVyKQorICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmdldFN5c3RlbVNlcnZpY2UoQ29udGV4dC5MQVlPVVRfSU5GTEFURVJfU0VSVklDRSk7CisgICAgICAgICAgICBpbmZsYXRlci5pbmZsYXRlKGNvbS5hbmRyb2lkLmludGVybmFsLlIubGF5b3V0Lnpvb21fbWFnbmlmeSwgdGhpcywgdHJ1ZSk7CisgICAgICAgICAgICBtUGx1c01pbnVzWm9vbUNvbnRyb2xzID0gKGFuZHJvaWQud2lkZ2V0Llpvb21Db250cm9scykgZmluZFZpZXdCeUlkKAorICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmlkLnpvb21Db250cm9scyk7CisgICAgICAgICAgICBmaW5kVmlld0J5SWQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC56b29tTWFnbmlmeSkuc2V0VmlzaWJpbGl0eSgKKyAgICAgICAgICAgICAgICAgICAgVmlldy5HT05FKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIHNob3coYm9vbGVhbiBzaG93Wm9vbSkgeworICAgICAgICAgICAgbVBsdXNNaW51c1pvb21Db250cm9scy5zZXRWaXNpYmlsaXR5KHNob3dab29tID8gVmlldy5WSVNJQkxFIDogVmlldy5HT05FKTsKKyAgICAgICAgICAgIGZhZGUoVmlldy5WSVNJQkxFLCAwLjBmLCAxLjBmKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIGhpZGUoKSB7CisgICAgICAgICAgICBmYWRlKFZpZXcuR09ORSwgMS4wZiwgMC4wZik7CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIHZvaWQgZmFkZShpbnQgdmlzaWJpbGl0eSwgZmxvYXQgc3RhcnRBbHBoYSwgZmxvYXQgZW5kQWxwaGEpIHsKKyAgICAgICAgICAgIEFscGhhQW5pbWF0aW9uIGFuaW0gPSBuZXcgQWxwaGFBbmltYXRpb24oc3RhcnRBbHBoYSwgZW5kQWxwaGEpOworICAgICAgICAgICAgYW5pbS5zZXREdXJhdGlvbig1MDApOworICAgICAgICAgICAgc3RhcnRBbmltYXRpb24oYW5pbSk7CisgICAgICAgICAgICBzZXRWaXNpYmlsaXR5KHZpc2liaWxpdHkpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIGJvb2xlYW4gaGFzRm9jdXMoKSB7CisgICAgICAgICAgICByZXR1cm4gbVBsdXNNaW51c1pvb21Db250cm9scy5oYXNGb2N1cygpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgc2V0T25ab29tSW5DbGlja0xpc3RlbmVyKE9uQ2xpY2tMaXN0ZW5lciBsaXN0ZW5lcikgeworICAgICAgICAgICAgbVBsdXNNaW51c1pvb21Db250cm9scy5zZXRPblpvb21JbkNsaWNrTGlzdGVuZXIobGlzdGVuZXIpOworICAgICAgICB9CisKK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ICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgc2V0RGVmYXVsdFpvb21TY2FsZShmbG9hdCBkZWZhdWx0U2NhbGUpIHsKKyAgICAgICAgbURlZmF1bHRTY2FsZSA9IGRlZmF1bHRTY2FsZTsKKyAgICAgICAgbUludkRlZmF1bHRTY2FsZSA9IDEgLyBkZWZhdWx0U2NhbGU7CisgICAgICAgIERFRkFVTFRfTUFYX1pPT01fU0NBTEUgPSA0LjBmICogZGVmYXVsdFNjYWxlOworICAgICAgICBERUZBVUxUX01JTl9aT09NX1NDQUxFID0gMC4yNWYgKiBkZWZhdWx0U2NhbGU7CisgICAgfQorCisgICAgcHVibGljIGZpbmFsIGZsb2F0IGdldFNjYWxlKCkgeworICAgICAgICByZXR1cm4gbUFjdHVhbFNjYWxlOworICAgIH0KKworICAgIHB1YmxpYyBmaW5hbCBmbG9hdCBnZXRJbnZTY2FsZSgpIHsKKyAgICAgICAgcmV0dXJuIG1JbnZBY3R1YWxTY2FsZTsKKyAgICB9CisKKyAgICBwdWJsaWMgZmluYWwgZmxvYXQgZ2V0VGV4dFdyYXBTY2FsZSgpIHsKKyAgICAgICAgcmV0dXJuIG1UZXh0V3JhcFNjYWxlOworICAgIH0KKworICAgIHB1YmxpYyBmaW5hbCBmbG9hdCBnZXREZWZhdWx0U2NhbGUoKSB7CisgICAgICAgIHJldHVybiBtRGVmYXVsdFNjYWxlOworICAgIH0KKworICAgIHB1YmxpYyBmaW5hbCBpbnQgZ2V0RG9jdW1lbnRBbmNob3JYKCkgeworICAgICAgICByZXR1cm4gbUFuY2hvclg7CisgICAgfQorCisgICAgcHVibGljIGZpbmFsIGludCBnZXREb2N1bWVudEFuY2hvclkoKSB7CisgICAgICAgIHJldHVybiBtQW5jaG9yWTsKKyAgICB9CisKKyAgICBwdWJsaWMgZmluYWwgdm9pZCBjbGVhckRvY3VtZW50QW5jaG9yKCkgeworICAgICAgICBtQW5jaG9yWCA9IG1BbmNob3JZID0gMDsKKyAgICB9CisKKyAgICBwdWJsaWMgZmluYWwgdm9pZCBzZXRab29tQ2VudGVyKGZsb2F0IHgsIGZsb2F0IHkpIHsKKyAgICAgICAgbVpvb21DZW50ZXJYID0geDsKKyAgICAgICAgbVpvb21DZW50ZXJZID0geTsKKyAgICB9CisKKyAgICBwdWJsaWMgZmluYWwgdm9pZCBzZXRJbml0aWFsU2NhbGVJblBlcmNlbnQoaW50IHNjYWxlSW5QZXJjZW50KSB7CisgICAgICAgIG1Jbml0aWFsU2NhbGUgPSBzY2FsZUluUGVyY2VudCAqIDAuMDFmOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgZmxvYXQgZ2V0RGVmYXVsdE1pblpvb21TY2FsZSgpIHsKKyAgICAgICAgcmV0dXJuIERFRkFVTFRfTUlOX1pPT01fU0NBTEU7CisgICAgfQorCisgICAgcHVibGljIGZpbmFsIGZsb2F0IGNvbXB1dGVTY2FsZVdpdGhMaW1pdHMoZmxvYXQgc2NhbGUpIHsKKyAgICAgICAgaWYgKHNjYWxlIDwgbU1pblpvb21TY2FsZSkgeworICAgICAgICAgICAgc2NhbGUgPSBtTWluWm9vbVNjYWxlOworICAgICAgICB9IGVsc2UgaWYgKHNjYWxlID4gbU1heFpvb21TY2FsZSkgeworICAgICAgICAgICAgc2NhbGUgPSBtTWF4Wm9vbVNjYWxlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBzY2FsZTsKKyAgICB9CisKKyAgICBwdWJsaWMgZmluYWwgYm9vbGVhbiBpc1pvb21TY2FsZUZpeGVkKCkgeworICAgICAgICByZXR1cm4gbU1pblpvb21TY2FsZSA+PSBtTWF4Wm9vbVNjYWxlOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgYm9vbGVhbiBleGNlZWRzTWluU2NhbGVJbmNyZW1lbnQoZmxvYXQgc2NhbGVBLCBmbG9hdCBzY2FsZUIpIHsKKyAgICAgICAgcmV0dXJuIE1hdGguYWJzKHNjYWxlQSA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ghZXhjZWVkc01pblNjYWxlSW5jcmVtZW50KHNjYWxlLCBtRGVmYXVsdFNjYWxlKSkgeworICAgICAgICAgICAgc2NhbGUgPSBtRGVmYXVsdFNjYWxlOworICAgICAgICB9CisKKyAgICAgICAgc2V0Wm9vbVNjYWxlKHNjYWxlLCByZWZsb3dUZXh0KTsKKworICAgICAgICBpZiAob2xkU2NhbGUgIT0gbUFjdHVhbFNjYWxlKSB7CisgICAgICAgICAgICAvLyB1c2UgbVpvb21QaWNrZXJTY2FsZSB0byBzZWUgem9vbSBwcmV2aWV3IGZpcnN0CisgICAgICAgICAgICBtWm9vbVN0YXJ0ID0gU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCk7CisgICAgICAgICAgICBtSW52SW5pdGlhbFpvb21TY2FsZSA9IDEuMGYgLyBvbGRTY2FsZTsKKyAgICAgICAgICAgIG1JbnZGaW5hbFpvb21TY2FsZSA9IDEuMGYgLyBtQWN0dWFsU2NhbGU7CisgICAgICAgICAgICBtWm9vbVNjYWxlID0gbUFjdHVhbFNjYWxlOworICAgICAgICAgICAgbVdlYlZpZXcub25GaXhlZExlbmd0aFpvb21BbmltYXRpb25TdGFydCgpOworICAgICAgICAgICAgbVdlYlZpZXcuaW52YWxpZGF0ZSgpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUaGlzIG1ldGhvZCBpcyBjYWxsZWQgYnkgdGhlIFdlYlZpZXcncyBkcmF3aW5nIGNvZGUgd2hlbiBhIGZpeGVkIGxlbmd0aCB6b29tCisgICAgICogYW5pbWF0aW9uIGlzIG9jY3VycmluZy4gSXRzIHB1cnBvc2UgaXMgdG8gYW5pbWF0ZSB0aGUgem9vbWluZyBvZiB0aGUgY2FudmFzCisgICAgICogdG8gdGhlIGRlc2lyZWQgc2NhbGUgd2hpY2ggd2Fz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wdGltZU1pbGxpcygpIC0gbVpvb21TdGFydCk7CisgICAgICAgIGlmIChpbnRlcnZhbCA8IFpPT01fQU5JTUFUSU9OX0xFTkdUSCkgeworICAgICAgICAgICAgZmxvYXQgcmF0aW8gPSAoZmxvYXQpIGludGVydmFsIC8gWk9PTV9BTklNQVRJT05fTEVOR1RIOworICAgICAgICAgICAgem9vbVNjYWxlID0gMS4wZiAvIChtSW52SW5pdGlhbFpvb21TY2FsZQorICAgICAgICAgICAgICAgICAgICArIChtSW52RmluYWxab29tU2NhbGUgLSBtSW52SW5pdGlhbFpvb21TY2FsZSkgKiByYXRpbyk7CisgICAgICAgICAgICBtV2ViVmlldy5pbnZhbGlkYXRlKCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICB6b29tU2NhbGUgPSBtWm9vbVNjYWxlOworICAgICAgICAgICAgLy8gc2V0IG1ab29tU2NhbGUgdG8gYmUgMCBhcyB3ZSBoYXZlIGZpbmlzaGVkIGFuaW1hdGluZworICAgICAgICAgICAgbVpvb21TY2FsZSA9IDA7CisgICAgICAgICAgICBtV2ViVmlldy5vbkZpeGVkTGVuZ3RoWm9vbUFuaW1hdGlvbkVuZCgpOworICAgICAgICB9CisgICAgICAgIC8vIGNhbGN1bGF0ZSB0aGUgaW50ZXJtZWRpYXRlIHNjcm9sbCBwb3NpdGlvbi4gU2luY2Ugd2UgbmVlZCB0byB1c2UKKyAgICAgICAgLy8gem9vbVNjYWxlLCB3ZSBjYW4ndCB1c2UgdGhlIFdlYlZpZXcncyBwaW5Mb2NYL1kgZnVuY3Rpb25zIGRpcmVjdGx5LgorICAgICAgICBmbG9hdCBzY2FsZSA9IHpvb21TY2FsZSAqIG1JbnZJbml0aWFsWm9vbVNjYWxlOworICAgICAgICBpbnQgdHggPSBNYXRoLnJvdW5kKHNjYWxlICogKG1Jbml0aWFsU2Nyb2xsWCArIG1ab29tQ2VudGVyWCkgLSBtWm9vbUNlbnRlclgpOworICAgICAgICB0eCA9IC1XZWJW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FdyYXBTY2FsZSA9IHNjYWxlOworICAgICAgICB9CisKKyAgICAgICAgaWYgKHNjYWxlICE9IG1BY3R1YWxTY2FsZSB8fCBmb3JjZSkgeworICAgICAgICAgICAgZmxvYXQgb2xkU2NhbGUgPSBtQWN0dWFsU2NhbGU7CisgICAgICAgICAgICBmbG9hdCBvbGRJbnZTY2FsZSA9IG1JbnZBY3R1YWxTY2FsZTsKKworICAgICAgICAgICAgaWYgKHNjYWxlICE9IG1BY3R1YWxTY2FsZSAmJiAhbVBpbmNoVG9ab29tQW5pbWF0aW5nKSB7CisgICAgICAgICAgICAgICAgbUNhbGxiYWNrUHJveHkub25TY2FsZUNoYW5nZWQobUFjdHVhbFNjYWxlLCBzY2FsZSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1BY3R1YWxTY2FsZSA9IHNjYWxlOworICAgICAgICAgICAgbUludkFjdHVhbFNjYWxlID0gMSAvIHNjYWxlOworCisgICAgICAgICAgICBpZiAoIW1XZWJWaWV3LmRyYXdIaXN0b3J5KCkpIHsKKworICAgICAgICAgICAgICAgIC8vIElmIGhpc3RvcnkgUGljdHVyZSBpcyBkcmF3biwgZG9uJ3QgdXBkYXRlIHNjcm9sbC4gVGhleSB3aWxsCisgICAgICAgICAgICAgICAgLy8gYmUgdXBkYXRlZCB3aGVuIHdlIGdldCBvdXQgb2YgdGhhdCBtb2RlLgorICAgICAgICAgICAgICAgIC8vIHVwZGF0ZSBvdXIgc2Nyb2xsIHNvIHdlIGRvbid0IGFwcGVhciB0byBqdW1wCisgICAgICAgICAgICAgICAgLy8gaS5lLiBrZWVwIHRoZSBjZW50ZXIgb2YgdGhlIGRvYyBpbiB0aGUgY2VudGVyIG9mIHRoZSB2aWV3CisgICAgICAgICAgICAgICAgaW50IG9sZFggPSBtV2ViVmlldy5nZXRTY3JvbGxYKCk7CisgICAgICAgICAgICAgICAgaW50IG9sZFkgPSBtV2ViVmlldy5nZXRTY3JvbGxZKCk7CisgICAgICAgICAgICAgIC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aXQgYXQgdGhlCisgICAgICAgICAgICAgICAgICAgIC8vIGVuZCBvZiB0aGUgem9vbSBhbmltYXRpb24uIFNlZSBjb21tZW50cyBpbiBvblNjYWxlRW5kKCkuCisgICAgICAgICAgICAgICAgICAgIG1XZWJWaWV3LnNlbmRPdXJWaXNpYmxlUmVjdCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gaWYgdGhlIHdlIG5lZWQgdG8gcmVmbG93IHRoZSB0ZXh0IHRoZW4gZm9yY2UgdGhlIFZJRVdfU0laRV9DSEFOR0VECisgICAgICAgICAgICAvLyBldmVudCB0byBiZSBzZW50IHRvIFdlYktpdAorICAgICAgICAgICAgbVdlYlZpZXcuc2VuZFZpZXdTaXplWm9vbShyZWZsb3dUZXh0KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFRoZSBkb3VibGUgdGFwIGdlc3R1cmUgY2FuIHJlc3VsdCBpbiBkaWZmZXJlbnQgYmVoYXZpb3JzIGRlcGVuZGluZyBvbiB0aGUKKyAgICAgKiBjb250ZW50IHRoYXQgaXMgdGFwcGVkLgorICAgICAqCisgICAgICogKDEpIFBMVUdJTlM6IElmIHRoZSB0YXBzIG9jY3VyIG9uIGEgcGx1Z2luIHRoZW4gd2UgbWF4aW1pemUgdGhlIHBsdWdpbiBvbgorICAgICAqIHRoZSBzY3JlZW4uIElmIHRoZSBwbHVnaW4gaXMgYWxyZWFkeSBtYXhpbWl6ZWQgdGhlbiB6b29tIHRoZSB1c2VyIGludG8KKyAgICAgKiBvdmVydmlldyBtb2RlLgorICAgICAqCisgICAgICogKDIpIEhUTUwvT1RIRVI6IElmIHRoZSB0YXBzIG9jY3VyIG91dHNpZGUgYSBwbHVnaW4gdGhlbiB0aGUgZm9sbG93aW5nCisgICAgICogaGV1cmlzdGljIGlzIHVzZWQuCisgICAgICogICBBLiBJZiB0aGUgY3VycmVudCBzY2FsZSBpcyBub3QgdGhlIHN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lbW92ZSB0aGUgem9vbSBjb250cm9sIGFmdGVyIGRvdWJsZSB0YXAKKyAgICAgICAgZGlzbWlzc1pvb21QaWNrZXIoKTsKKworICAgICAgICAvKgorICAgICAgICAgKiBJZiB0aGUgZG91YmxlIHRhcCB3YXMgb24gYSBwbHVnaW4gdGhlbiBlaXRoZXIgem9vbSB0byBtYXhpbWl6ZSB0aGUKKyAgICAgICAgICogcGx1Z2luIG9uIHRoZSBzY3JlZW4gb3Igc2NhbGUgdG8gb3ZlcnZpZXcgbW9kZS4KKyAgICAgICAgICovCisgICAgICAgIFZpZXdNYW5hZ2VyLkNoaWxkVmlldyBwbHVnaW4gPSBtV2ViVmlldy5tVmlld01hbmFnZXIuaGl0VGVzdChtQW5jaG9yWCwgbUFuY2hvclkpOworICAgICAgICBpZiAocGx1Z2luICE9IG51bGwpIHsKKyAgICAgICAgICAgIGlmIChtV2ViVmlldy5pc1BsdWdpbkZpdE9uU2NyZWVuKHBsdWdpbikpIHsKKyAgICAgICAgICAgICAgICB6b29tVG9PdmVydmlldygpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtV2ViVmlldy5jZW50ZXJGaXRSZWN0KHBsdWdpbi54LCBwbHVnaW4ueSwgcGx1Z2luLndpZHRoLCBwbHVnaW4uaGVpZ2h0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChzZXR0aW5ncy5nZXRMYXlvdXRBbGdvcml0aG0oKSA9PSBXZWJTZXR0aW5ncy5MYXlvdXRBbGdvcml0aG0uTkFSUk9XX0NPTFVNTlMKKyAgICAgICAgICAgICAgICAmJiB3aWxsU2NhbGVUcmlnZ2VyWm9vbShtVGV4dFdyYXBTY2FsZSkpIHsKKyAgICAgICAgICAgIHJlZnJlc2hab29tU2NhbGUodHJ1ZSk7CisgICAgICAgIH0gZWxzZSBpZiAoIW1Jblpvb21PdmVydmlldykgeworICAgICAgICAgICA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TsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgem9vbVRvRGVmYXVsdExldmVsKCkgeworICAgICAgICBpbnQgbGVmdCA9IG1XZWJWaWV3Lm5hdGl2ZUdldEJsb2NrTGVmdEVkZ2UobUFuY2hvclgsIG1BbmNob3JZLCBtQWN0dWFsU2NhbGUpOworICAgICAgICBpZiAobGVmdCAhPSBXZWJWaWV3Lk5PX0xFRlRFREdFKSB7CisgICAgICAgICAgICAvLyBhZGQgYSA1cHQgcGFkZGluZyB0byB0aGUgbGVmdCBlZGdlLgorICAgICAgICAgICAgaW50IHZpZXdMZWZ0ID0gbVdlYlZpZXcuY29udGVudFRvVmlld1gobGVmdCA8IDUgPyAwIDogKGxlZnQgLSA1KSkKKyAgICAgICAgICAgICAgICAgICAgLSBtV2ViVmlldy5nZXRTY3JvbGxYKCk7CisgICAgICAgICAgICAvLyBSZS1jYWxjdWxhdGUgdGhlIHpvb20gY2VudGVyIHNvIHRoYXQgdGhlIG5ldyBzY3JvbGwgeCB3aWxsIGJlCisgICAgICAgICAgICAvLyBvbiB0aGUgbGVmdCBlZGdlLgorICAgICAgICAgICAgaWYgKHZpZXdMZWZ0ID4gMCkgeworICAgICAgICAgICAgICAgIG1ab29tQ2VudGVyWCA9IHZpZXdMZWZ0ICogbURlZmF1bHRTY2FsZSAvIChtRGVmYXVsdFNjYWxlIC0gbUFjdHVhbFNjYWxlKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbVdlYlZpZXcuc2Nyb2xsQnkodmlld0xlZnQsIDApOworICAgICAgICAgICAgICAgIG1ab29tQ2VudGVyWCA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgc3RhcnRab29tQW5pbWF0aW9uKG1EZWZhdWx0U2NhbGUsIHRydWUpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHVwZGF0ZU11bHRpVG91Y2hTdXBwb3J0KENvbnRleHQgY29udGV4dCkgeworICAgICAgIC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Y3RvciBkZXRlY3RvcikgeworICAgICAgICAgICAgZGlzbWlzc1pvb21QaWNrZXIoKTsKKyAgICAgICAgICAgIG1XZWJWaWV3Lm1WaWV3TWFuYWdlci5zdGFydFpvb20oKTsKKyAgICAgICAgICAgIG1XZWJWaWV3Lm9uUGluY2hUb1pvb21BbmltYXRpb25TdGFydCgpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgYm9vbGVhbiBvblNjYWxlKFNjYWxlR2VzdHVyZURldGVjdG9yIGRldGVjdG9yKSB7CisgICAgICAgICAgICBmbG9hdCBzY2FsZSA9IE1hdGgucm91bmQoZGV0ZWN0b3IuZ2V0U2NhbGVGYWN0b3IoKSAqIG1BY3R1YWxTY2FsZSAqIDEwMCkgKiAwLjAxZjsKKyAgICAgICAgICAgIGlmICh3aWxsU2NhbGVUcmlnZ2VyWm9vbShzY2FsZSkpIHsKKyAgICAgICAgICAgICAgICBtUGluY2hUb1pvb21BbmltYXRpbmcgPSB0cnVlOworICAgICAgICAgICAgICAgIC8vIGxpbWl0IHRoZSBzY2FsZSBjaGFuZ2UgcGVyIHN0ZXAKKyAgICAgICAgICAgICAgICBpZiAoc2NhbGUgPiBtQWN0dWFsU2NhbGUpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NhbGUgPSBNYXRoLm1pbihzY2FsZSwgbUFjdHVhbFNjYWxlICogMS4yNWYpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHNjYWxlID0gTWF0aC5tYXgoc2NhbGUsIG1BY3R1YWxTY2FsZSAqIDAuOGYpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzZXRab29tQ2VudGVyKGRldGVjdG9yLmdldEZvY3VzWCgpLCBkZXRlY3Rvci5nZXRGb2N1c1koKSk7CisgICAgICAgICAgICAgICAgc2V0Wm9vbVNjYWxlKHNjYWxlLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgbVdlYlZpZXcuaW52YWxpZGF0ZSgpOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgb25TY2FsZUVuZChTY2FsZUdlc3R1cmVEZXRlY3RvciBkZXRlY3RvcikgeworICAgICAgICAgICAgaWYgKG1QaW5jaFRvWm9vbUFuaW1hdGluZykgeworICAgICAgICAgICAgICAgIG1QaW5jaFRvWm9vbUFuaW1hdGluZyA9IGZhbHNlOworICAgICAgICAgICAgICAgIG1BbmNob3JYID0gbVdlYlZpZXcudmlld1RvQ29udGVudFgoKGludCkgbVpvb21DZW50ZXJYICsgbVdlYlZpZXcuZ2V0U2Nyb2xsWCgpKTsKKyAgICAgICAgICAgICAgICBtQW5jaG9yWSA9IG1XZWJWaWV3LnZpZXdUb0NvbnRlbnRZKChpbnQpIG1ab29tQ2VudGVyWSArIG1XZWJWaWV3LmdldFNjcm9sbFkoKSk7CisgICAgICAgICAgICAgICAgLy8gZG9uJ3QgcmVmbG93IHdoZW4gem9vbSBpbjsgd2hlbiB6b29tIG91dCwgZG8gcmVmbG93IGlmIHRoZQorICAgICAgICAgICAgICAgIC8vIG5ldyBzY2FsZSBpcyBhbG1vc3QgbWluaW11bSBzY2FsZTsKKyAgICAgICAgICAgICAgICBib29sZWFuIHJlZmxvd05vdyA9ICFjYW5ab29tT3V0KCkgfHwgKG1BY3R1YWxTY2FsZSA8PSAwLjggKiBtVGV4dFdyYXBTY2FsZSk7CisgICAgICAgICAgICAgICAgLy8gZm9yY2Ugem9vbSBhZnRlciBtUHJldmlld1pvb21Pbmx5IGlzIHNldCB0byBmYWxzZSBzbyB0aGF0IHRoZQorICAgICAgICAgICAgICAgIC8vIG5ldyB2aWV3IHNpemUgd2lsbCBiZSBwYXNzZWQgdG8gdGhlIFdlYktpdAorICAgICAgICAgICAgICAgIHJlZnJlc2hab29tU2NhbGUocmVmbG93Tm93KTsKKyAgICAgICAgICAgICAgICAvLyBjYWxsIGludmFsaWRhdGUoKSB0byBkcmF3IHdpdGhvdXQgem9vbSBmaWx0ZXIKKyAgICAgICAgICAgICAgICBtV2ViVmlldy5pbnZhbGlkYXRlKCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1XZWJWaWV3Lm1WaWV3TWFuYWdlci5lbmRab29tKCk7CisgICAgICAgICAgICBtV2ViVmlldy5vblBpbmNoVG9ab29tQW5pbWF0aW9uRW5kKGRldGVjdG9yKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIG9uU2l6ZUNoYW5nZWQoaW50IHcsIGludCBoLCBpbnQgb3csIGludCBvaCkgeworICAgICAgICAvLyByZXNldCB6b29tIGFuZCBhbmNob3IgdG8gdGhlIHRvcCBsZWZ0IGNvcm5lciBvZiB0aGUgc2NyZWVuCisgICAgICAgIC8vIHVubGVzcyB3ZSBhcmUgYWxyZWFkeSB6b29taW5nCisgICAgICAgIGlmICghaXNGaXhlZExlbmd0aEFuaW1hdGlvbkluUHJvZ3Jlc3MoKSkgeworICAgICAgICAgICAgaW50IHZpc2libGVUaXRsZUhlaWdodCA9IG1XZWJWaWV3LmdldFZpc2libGVUaXRsZUhlaWdodCgpOworICAgICAgICAgICAgbVpvb21DZW50ZXJYID0gMDsKKyAgICAgICAgICAgIG1ab29tQ2VudGVyWSA9IHZpc2libGVUaXRsZUhlaWdodDsKKyAgICAgICAgICAgIG1BbmNob3JYID0gbVdlYlZpZXcudmlld1RvQ29udGVudFgobVdlYlZpZXcuZ2V0U2Nyb2xsWCgpKTsKKyAgICAgICAgICAgIG1BbmNob3JZID0gbVdlYlZpZXcudmlld1RvQ29udGVudFkodmlzaWJsZVRpdGxlSGVpZ2h0ICsgbVdlYlZpZXcuZ2V0U2Nyb2xsWSgpKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIHVwZGF0ZSBtTWluWm9vbVNjYWxlIGlmI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aWZpY2F0aW9uIG92ZXIgdG8gd2Via2l0LgorICAgICAgICAgICAgICAgIHJlZnJlc2hab29tU2NhbGUobVVwZGF0ZVRleHRXcmFwKTsKKyAgICAgICAgICAgICAgICAvLyB1cGRhdGUgdGhlIHpvb20gYnV0dG9ucyBhcyB0aGUgc2NhbGUgY2FuIGJlIGNoYW5nZWQKKyAgICAgICAgICAgICAgICB1cGRhdGVab29tUGlja2VyKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB1cGRhdGVab29tUmFuZ2UoV2ViVmlld0NvcmUuUmVzdG9yZVN0YXRlIHJlc3RvcmVTdGF0ZSwKKyAgICAgICAgICAgIGludCB2aWV3V2lkdGgsIGludCBtaW5QcmVmV2lkdGgpIHsKKyAgICAgICAgaWYgKHJlc3RvcmVTdGF0ZS5tTWluU2NhbGUgPT0gMCkgeworICAgICAgICAgICAgaWYgKHJlc3RvcmVTdGF0ZS5tTW9iaWxlU2l0ZSkgeworICAgICAgICAgICAgICAgIGlmIChtaW5QcmVmV2lkdGggPiBNYXRoLm1heCgwLCB2aWV3V2lkdGgpKSB7CisgICAgICAgICAgICAgICAgICAgIG1NaW5ab29tU2NhbGUgPSAoZmxvYXQpIHZpZXdXaWR0aCAvIG1pblByZWZXaWR0aDsKKyAgICAgICAgICAgICAgICAgICAgbU1pblpvb21TY2FsZUZpeGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgbU1pblpvb21TY2FsZSA9IHJlc3RvcmVTdGF0ZS5tRGVmYXVsdFNjYWxlOworICAgICAgICAgICAgICAgICAgICBtTWluWm9vbVNjYWxlRml4ZWQgPSB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbU1pblpvb21TY2FsZSA9IERFRkFVTFRfTUlOX1pPT01fU0NBTEU7CisgICAgICAgICAgIC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d2VsbCwgdGhlIFdlYlZpZXcgd29uJ3QgZ28gaW5zYW5lLiBsaW1pdCB0aGUgbG93ZXIKKyAgICAgICAgICAgIC8vIGJvdW5kIHRvIG1hdGNoIHRoZSBkZWZhdWx0IHNjYWxlIGZvciBtb2JpbGUgc2l0ZXMuCisgICAgICAgICAgICBzZXRab29tT3ZlcnZpZXdXaWR0aChNYXRoLm1pbihXZWJWaWV3LnNNYXhWaWV3cG9ydFdpZHRoLAorICAgICAgICAgICAgICAgICAgICBNYXRoLm1heCgoaW50KSAodmlld1dpZHRoICogbUludkRlZmF1bHRTY2FsZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTWF0aC5tYXgoZHJhd0RhdGEubU1pblByZWZXaWR0aCwgZHJhd0RhdGEubVZpZXdQb2ludC54KSkpKTsKKyAgICAgICAgfQorCisgICAgICAgIGZpbmFsIGZsb2F0IHpvb21PdmVydmlld1NjYWxlID0gZ2V0Wm9vbU92ZXJ2aWV3U2NhbGUoKTsKKyAgICAgICAgaWYgKCFtTWluWm9vbVNjYWxlRml4ZWQpIHsKKyAgICAgICAgICAgIG1NaW5ab29tU2NhbGUgPSB6b29tT3ZlcnZpZXdTY2FsZTsKKyAgICAgICAgfQorICAgICAgICAvLyBmaXQgdGhlIGNvbnRlbnQgd2lkdGggdG8gdGhlIGN1cnJlbnQgdmlldy4gSWdub3JlIHRoZSByb3VuZGluZyBlcnJvciBjYXNlLgorICAgICAgICBpZiAoIW1XZWJWaWV3LmRyYXdIaXN0b3J5KCkgJiYgKG1Jblpvb21PdmVydmlldyB8fCBtSW5pdGlhbFpvb21PdmVydmlldykKKyAgICAgICAgICAgICAgICAmJiBNYXRoLmFicygodmlld1dpZHRoICogbUludkFjdHVhbFNjYWxlKSAtIG1ab29tT3ZlcnZpZXdXaWR0aCkgPiAxKSB7CisgICAgICAgICAgICBtSW5pdGlhbFpvb21PdmVydmlldyA9IGZhbHNlOworICAgICAgICAgICAgc2V0Wm9vbVNjYWxlKHpvb21P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WxlID0gbUluaXRpYWxTY2FsZTsKKyAgICAgICAgICAgICAgICByZWZsb3dUZXh0ID0gZXhjZWVkc01pblNjYWxlSW5jcmVtZW50KG1UZXh0V3JhcFNjYWxlLCBzY2FsZSk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHJlc3RvcmVTdGF0ZS5tVmlld1NjYWxlID4gMCkgeworICAgICAgICAgICAgICAgIG1UZXh0V3JhcFNjYWxlID0gcmVzdG9yZVN0YXRlLm1UZXh0V3JhcFNjYWxlOworICAgICAgICAgICAgICAgIHNjYWxlID0gcmVzdG9yZVN0YXRlLm1WaWV3U2NhbGU7CisgICAgICAgICAgICAgICAgcmVmbG93VGV4dCA9IGZhbHNlOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBXZWJTZXR0aW5ncyBzZXR0aW5ncyA9IG1XZWJWaWV3LmdldFNldHRpbmdzKCk7CisgICAgICAgICAgICAgICAgaWYgKHNldHRpbmdzLmdldFVzZVdpZGVWaWV3UG9ydCgpICYmIHNldHRpbmdzLmdldExvYWRXaXRoT3ZlcnZpZXdNb2RlKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgbUluaXRpYWxab29tT3ZlcnZpZXcgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBzY2FsZSA9IChmbG9hdCkgbVdlYlZpZXcuZ2V0Vmlld1dpZHRoKCkgLyBXZWJWaWV3LkRFRkFVTFRfVklFV1BPUlRfV0lEVEg7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgc2NhbGUgPSByZXN0b3JlU3RhdGUubVRleHRXcmFwU2NhbGU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJlZmxvd1RleHQgPSBleGNlZWRzTWluU2NhbGVJbmNyZW1lbnQobVRleHRXcmFwU2NhbGUsIHNjYWxlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNldFpvb21TY2FsZShzY2FsZSwgcmVm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VudFpvb21Db250cm9sKCkgeworICAgICAgICBpZiAobVdlYlZpZXcuZ2V0U2V0dGluZ3MoKSAhPSBudWxsICYmIG1XZWJWaWV3LmdldFNldHRpbmdzKCkuc3VwcG9ydFpvb20oKSkgeworICAgICAgICAgICAgaWYgKG1XZWJWaWV3LmdldFNldHRpbmdzKCkuZ2V0QnVpbHRJblpvb21Db250cm9scygpKSB7CisgICAgICAgICAgICAgICAgaWYgKG1FbWJlZGRlZFpvb21Db250cm9sID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbUVtYmVkZGVkWm9vbUNvbnRyb2wgPSBuZXcgWm9vbUNvbnRyb2xFbWJlZGRlZCh0aGlzLCBtV2ViVmlldyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBtRW1iZWRkZWRab29tQ29udHJvbDsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgaWYgKG1FeHRlcm5hbFpvb21Db250cm9sID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbUV4dGVybmFsWm9vbUNvbnRyb2wgPSBuZXcgWm9vbUNvbnRyb2xFeHRlcm5hbChtV2ViVmlldyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBtRXh0ZXJuYWxab29tQ29udHJvbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBpbnZva2Vab29tUGlja2VyKCkgeworICAgICAgICBab29tQ29udHJvbEJhc2UgY29udHJvbCA9IGdldEN1cnJlbnRab29tQ29udHJvbCgpOworICAgICAgICBpZiAoY29udHJvbCAhPSBudWxsKSB7CisgICAgICAgICAgICBjb250cm9sLnNob3coKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGRpc21pc3Nab29tUGlja2VyKCkgeworICAgICAgICBab29tQ29udHJvbEJhc2UgY29udHJvbCA9IGdldEN1cnJlbnRab29tQ29udHJvbCgpOworICAgICAgICBpZiAoY29udHJvbCAhPSBudWxsKSB7CisgICAgICAgICAgICBjb250cm9sLmhpZGUoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGlzWm9vbVBpY2tlclZpc2libGUoKSB7CisgICAgICAgIFpvb21Db250cm9sQmFzZSBjb250cm9sID0gZ2V0Q3VycmVudFpvb21Db250cm9sKCk7CisgICAgICAgIHJldHVybiAoY29udHJvbCAhPSBudWxsKSA/IGNvbnRyb2wuaXNWaXNpYmxlKCkgOiBmYWxzZTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB1cGRhdGVab29tUGlja2VyKCkgeworICAgICAgICBab29tQ29udHJvbEJhc2UgY29udHJvbCA9IGdldEN1cnJlbnRab29tQ29udHJvbCgpOworICAgICAgICBpZiAoY29udHJvbCAhPSBudWxsKSB7CisgICAgICAgICAgICBjb250cm9sLnVwZGF0ZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogVGhlIGVtYmVkZGVkIHpvb20gY29udHJvbCBpbnRlcmNlcHRzIHRvdWNoIGV2ZW50cyBhbmQgYXV0b21hdGljYWxseSBzdGF5cworICAgICAqIHZpc2libGUuIFRoZSBleHRlcm5hbCBjb250cm9sIG5lZWRzIHRvIGNvbnN0YW50bHkgcmVmcmVzaCBpdHMgaW50ZXJuYWwKKyAgICAgKiB0aW1lciB0byBzdGF5IHZpc2libGUuCisgICAgICovCisgICAgcHVibGljIHZvaWQga2VlcFpvb21QaWNrZXJWaXNpYmxlKCkgeworICAgICAgICBab29tQ29udHJvbEJhc2UgY29udHJvbCA9IGdldEN1cnJlbnRab29tQ29udHJvbCgpOworICAgICAgICBpZiAoY29udHJvbCAhPSBudWxsICYmIGNvbnRyb2wgPT0gbUV4dGVybmFsWm9vbUNvbnRyb2wpIHsKKyAgICAgICAgICAgIGNvbnRyb2wuc2hvdygpOworICAgIC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worICAgICAgICAvLyBDYW4ndCBnZXQgbWV0YSBkYXRhIHVzaW5nIGdldEFwcGxpY2F0aW9uSW5mbygpIGFzIGl0IGRvZXNuJ3QgcGFzcyBHRVRfTUVUQV9EQVRBCisgICAgICAgIFBhY2thZ2VNYW5hZ2VyIHBhY2thZ2VNYW5hZ2VyID0gZ2V0UGFja2FnZU1hbmFnZXIoKTsKKyAgICAgICAgQ29tcG9uZW50TmFtZSBjb21wb25lbnROYW1lID0gbmV3IENvbXBvbmVudE5hbWUodGhpcywgZ2V0Q2xhc3MoKSk7CisgICAgICAgIEFjdGl2aXR5SW5mbyBhY3Rpdml0eUluZm8gPSBudWxsOworICAgICAgICB0cnkgeworICAgICAgICAgICAgYWN0aXZpdHlJbmZvID0gcGFja2FnZU1hbmFnZXIuZ2V0QWN0aXZpdHlJbmZvKGNvbXBvbmVudE5hbWUsIFBhY2thZ2VNYW5hZ2VyLkdFVF9NRVRBX0RBVEEpOworICAgICAgICB9IGNhdGNoIChQYWNrYWdlTWFuYWdlci5OYW1lTm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmQoTE9HVEFHLCAiRmFpbGVkIHRvIGZpbmQgY29tcG9uZW50Iik7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgaWYgKGFjdGl2aXR5SW5mbyA9PSBudWxsKSB7CisgICAgICAgICAgICBMb2cuZChMT0dUQUcsICJGYWlsZWQgdG8gZ2V0IGFjdGl2aXR5IGluZm8iKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIEJ1bmRsZSBtZXRhRGF0YSA9IGFjdGl2aXR5SW5mby5tZXRhRGF0YTsKKyAgICAgICAgaWYgKG1ldGFEYXRhID09IG51bGwpIHsKKyAgICAgICAgICAgIExvZy5kKExPR1RBRywgIk5vIG1ldGEgZGF0YSIpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgU3RyaW5nIHVybCA9IG1ldGFEYXRhLmdldFN0cmluZygiYW5kcm9pZC53ZWJydW50aW1lLnVybCIpOworICAgICAgICBpZiAodXJsID09IG51bGwpIHsKKyAgICAgICAgICAgIExvZy5kKExPR1RBRywgIk5vIFVSTCIpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG1CYXNlVXJsID0gbmV3IFVSTCh1cmwpOworICAgICAgICB9IGNhdGNoIChNYWxmb3JtZWRVUkxFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmQoTE9HVEFHLCAiSW52YWxpZCBVUkwiKTsKKyAgICAgICAgfQorCisgICAgICAgIGdldFdpbmRvdygpLnJlcXVlc3RGZWF0dXJlKFdpbmRvdy5GRUFUVVJFX05PX1RJVExFKTsKKyAgICAgICAgc2V0Q29udGVudFZpZXcoUi5sYXlvdXQud2ViX3J1bnRpbWUpOworICAgICAgICBtV2ViVmlldyA9IChXZWJWaWV3KSBmaW5kVmlld0J5SWQoUi5pZC53ZWJ2aWV3KTsKKyAgICAgICAgbVNwbGFzaFNjcmVlbiA9IChJbWFnZVZpZXcpIGZpbmRWaWV3QnlJZChSLmlkLnNwbGFzaHNjcmVlbik7CisgICAgICAgIG1TcGxhc2hTY3JlZW4uc2V0SW1hZ2VSZXNvdXJjZSgKKyAgICAgICAgICAgICAgICBnZXRSZXNvdXJjZXMoKS5nZXRJZGVudGlmaWVyKCJzcGxhc2hfc2NyZWVuIiwgImRyYXdhYmxlIiwgZ2V0UGFja2FnZU5hbWUoKSkpOworICAgICAgICBtV2ViVmlldy5nZXRTZXR0aW5ncygpLnNldEphdmFTY3JpcHRFbmFibGVkKHRydWUpOworICAgICAgICBtV2ViVmlldy5zZXRXZWJWaWV3Q2xpZW50KG5ldyBXZWJWaWV3Q2xpZW50KCkgeworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwdWJsaWMgYm9vbGVhbiBzaG91bGRPdmVycmlkZVVybExvYWRpbmcoV2ViVmlldyB2aWV3LCBTdHJpbmcgdXJsKSB7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgVVJMIG5ld09yaWdpbiA9IG5ldyBVUkwodXJsKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG5ld09yaWdpbi5nZXRIb3N0KCkuZXF1YWxzKG1CYXNlVXJsLmdldEhvc3QoKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIHNpbXBsZSBzYW1lIG9yaWdpbiB0ZXN0IHBhc3NlcywgbG9hZCBpbiB0aGUgd2Vidmlldy4KKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIEZJWE1FOiBXZSBzaG91bGQgZG8gYSBtb3JlIHJvYnVzdCBTT1AgY2hlY2suCisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGNhdGNoKE1hbGZvcm1lZFVSTEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIERvbid0IGxvYWQgYW55dGhpbmcgaWYgdGhpcyB3YXNuJ3QgYSBwcm9wZXIgVVJMLgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBPdGhlcndpc2UgdGhpcyBpcyBhIFVSTCB0aGF0IGlzIG5vdCBzYW1lIG9yaWdpbiBzbyBwYXNzIGl0IHRvIHRoZQorICAgICAgICAgICAgICAgIC8vIEJyb3dzZXIgdG8gbG9hZC4KKyAgICAgICAgICAgICAgICBzdGFydEFjdGl2aXR5KG5ldyBJbnRlbnQoSW50ZW50LkFDVElPTl9WSUVXLCBVcmkucGFyc2UodXJsKSkpOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBAT3ZlcnJpZG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RyaW5nIG9yaWdpbiwgR2VvbG9jYXRpb25QZXJtaXNzaW9ucy5DYWxsYmFjayBjYWxsYmFjaykgeworICAgICAgICAgICAgICAgIGNhbGxiYWNrLmludm9rZShvcmlnaW4sIGFsbG93ZWQsIHRydWUpOworICAgICAgICAgICAgfQorICAgICAgICB9KTsKKworICAgICAgICAvLyBTZXQgdGhlIERCIGxvY2F0aW9uLiBPcHRpb25hbC4gR2VvbG9jYXRpb24gd29ya3Mgd2l0aG91dCBEQnMuCisgICAgICAgIG1XZWJWaWV3LmdldFNldHRpbmdzKCkuc2V0R2VvbG9jYXRpb25EYXRhYmFzZVBhdGgoCisgICAgICAgICAgICAgICAgZ2V0RGlyKCJnZW9sb2NhdGlvbiIsIE1PREVfUFJJVkFURSkuZ2V0UGF0aCgpKTsKKworICAgICAgICBTdHJpbmcgdGl0bGUgPSBtZXRhRGF0YS5nZXRTdHJpbmcoImFuZHJvaWQud2VicnVudGltZS50aXRsZSIpOworICAgICAgICAvLyBXZSB0dXJuZWQgb2ZmIHRoZSB0aXRsZSBiYXIgdG8gZ28gZnVsbCBzY3JlZW4gc28gZGlzcGxheSB0aGUKKyAgICAgICAgLy8gd2ViYXBwJ3MgdGl0bGUgYXMgYSB0b2FzdC4KKyAgICAgICAgaWYgKHRpdGxlICE9IG51bGwpIHsKKyAgICAgICAgICAgIFRvYXN0Lm1ha2VUZXh0KHRoaXMsIHRpdGxlLCBUb2FzdC5MRU5HVEhfU0hPUlQpLnNob3coKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIExvYWQgdGhlIHdlYmFwcCdzIGJhc2UgVVJMLgorICAgICAgICBtV2ViVmlldy5sb2FkVXJsKHVybCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGJvb2xlYW4gb25LZXlEb3duKGludCBrZXlDb2RlLCBLZXlFdmVudCBldmVudCkgeworICAgICAgICBpZiAoa2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX0JBQ0sgJiY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yAgICAgICAgaWYgKGFkYXB0ZXJJZCAhPSAwKSB7CisgICAgICAgICAgICBmaW5hbCBDb250ZXh0IGMgPSBjb250ZXh0OworICAgICAgICAgICAgcG9zdChuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgICAgICBzZXRBZGFwdGVyKEFkYXB0ZXJzLmxvYWRBZGFwdGVyKGMsIGFkYXB0ZXJJZCkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICB9CiAKICAgICAgICAgYS5yZWN5Y2xlKCk7CiAgICAgfQpAQCAtMTU3NSw2ICsxNTg1LDExIEBACiAgICAgICAgICAgICAgICAgdHJlZU9ic2VydmVyLmFkZE9uR2xvYmFsTGF5b3V0TGlzdGVuZXIodGhpcyk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmIChtQWRhcHRlciAhPSBudWxsICYmIG1EYXRhU2V0T2JzZXJ2ZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgbURhdGFTZXRPYnNlcnZlciA9IG5ldyBBZGFwdGVyRGF0YVNldE9ic2VydmVyKCk7CisgICAgICAgICAgICBtQWRhcHRlci5yZWdpc3RlckRhdGFTZXRPYnNlcnZlcihtRGF0YVNldE9ic2VydmVyKTsKKyAgICAgICAgfQogICAgIH0KIAogICAgIEBPdmVycmlkZQpAQCAtMTU5NSw2ICsxNjEwLDExIEBACiAgICAgICAgICAgICAgICAgbUdsb2JhbExheW91dExpc3RlbmVyQWRkZWRGaWx0ZXIgPSBmYWxzZTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQorCisgICAgICAgIGlmIChtQWRhcHRlciAhPSBudWxsKSB7CisgICAgICAgICAgICBtQWRhcHRlci51bnJlZ2lzdGVyRGF0YVNldE9ic2VydmVyKG1EYXRhU2V0T2JzZXJ2ZXIpOworICAgICAgICAgICAgbURhdGFTZXRPYnNlc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bmFsIENvbnRleHQgbUNvbnRleHQ7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIDxwPkNyZWF0ZXMgYSBuZXcgQ3Vyc29yIHRyYW5zZm9ybWF0aW9uLjwvcD4KKyAgICAgICAgICogCisgICAgICAgICAqIEBwYXJhbSBjb250ZXh0IFRoZSBjb250ZXh0IGFzc29jaWF0ZWQgd2l0aCB0aGlzIHRyYW5zZm9ybWF0aW9uLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIEN1cnNvclRyYW5zZm9ybWF0aW9uKENvbnRleHQgY29udGV4dCkgeworICAgICAgICAgICAgbUNvbnRleHQgPSBjb250ZXh0OworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIDxwPlRyYW5zZm9ybXMgdGhlIHNwZWNpZmllZCBDdXJzb3IgY29sdW1uIGludG8gYSBTdHJpbmcuIFRoZSB0cmFuc2Zvcm1hdGlvbgorICAgICAgICAgKiBjYW4gc2ltcGx5IHJldHVybiB0aGUgY29udGVudCBvZiB0aGUgY29sdW1uIGFzIGEgU3RyaW5nICh0aGlzIGlzIGtub3duCisgICAgICAgICAqIGFzIHRoZSBpZGVudGl0eSB0cmFuc2Zvcm1hdGlvbikgb3IgbWFuaXB1bGF0ZSB0aGUgY29udGVudC4gRm9yIGluc3RhbmNlLAorICAgICAgICAgKiBhIHRyYW5zZm9ybWF0aW9uIGNhbiBwZXJmb3JtIHRleHQgc3Vic3RpdHV0aW9ucyBvciBjb25jYXRlbmF0ZSBvdGhlcgorICAgICAgICAgKiBjb2x1bW5zIHdpdGggdGhlIHNwZWNpZmllZCBjb2x1bW4uPC9wPgorICAgICAgICAgKiAKKyAgICAgICAgICogQHBhcmFtIGN1cnNvciBUaGUgY3Vyc29yIHRoYXQgY29udGFpbnMgdGhlIGRhdGEgdG8gdHJhbnNmb3JtLiAKKyAgICAgICAgICogQHBhcmFtIGNvbHVtbkluZGV4IFRoZSBpbmRleCBvZiB0aGUgY29sdW1uIHRvIHRyYW5zZm9ybS4KKyAgICAgICAgICogCisgICAgICAgICAqIEByZXR1cm4gQSBTdHJpbmcgY29udGFpbmluZyB0aGUgdHJhbnNmb3JtZWQgdmFsdWUgb2YgdGhlIGNvbHVtbi4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBhYnN0cmFjdCBTdHJpbmcgdHJhbnNmb3JtKEN1cnNvciBjdXJzb3IsIGludCBjb2x1bW5JbmRleCk7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIDxwPlRyYW5zZm9ybXMgdGhlIHNwZWNpZmllZCBDdXJzb3IgY29sdW1uIGludG8gYSByZXNvdXJjZSBpZGVudGlmaWVyLgorICAgICAgICAgKiBUaGUgZGVmYXVsdCBpbXBsZW1lbnRhdGlvbiBzaW1wbHkgaW50ZXJwcmV0cyB0aGUgY29udGVudCBvZiB0aGUgY29sdW1uCisgICAgICAgICAqIGFzIGFuIGludGVnZXIuPC9wPgorICAgICAgICAgKiAKKyAgICAgICAgICogQHBhcmFtIGN1cnNvciBUaGUgY3Vyc29yIHRoYXQgY29udGFpbnMgdGhlIGRhdGEgdG8gdHJhbnNmb3JtLiAKKyAgICAgICAgICogQHBhcmFtIGNvbHVtbkluZGV4IFRoZSBpbmRleCBvZiB0aGUgY29sdW1uIHRvIHRyYW5zZm9ybS4KKyAgICAgICAgICogCisgICAgICAgICAqIEByZXR1cm4gQSByZXNvdXJjZSBpZGVudGlmaWVyLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGludCB0cmFuc2Zvcm1Ub1Jlc291cmNlKEN1cnNvciBjdXJzb3IsIGludCBjb2x1bW5JbmRleCkgeworICAgICAgICAgICAgcmV0dXJuIGN1cnNvci5nZXRJbnQoY29sdW1uSW5kZXgpOworICAgICAgICB9ICAgICAgICAKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiA8cD5Mb2FkcyB0aGUge0BsaW5rIGFuZHJvaWQud2lkZ2V0LkN1cnNvckFkYXB0ZXJ9IGRlZmluZWQgaW4g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ICAgICAgICAgICAgICBjb250ZXh0LmdldFJlc291cmNlcygpLmdldFJlc291cmNlRW50cnlOYW1lKGlkKSk7CisgICAgICAgICAgICBybmYuaW5pdENhdXNlKGV4KTsKKyAgICAgICAgICAgIHRocm93IHJuZjsKKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZXgpIHsKKyAgICAgICAgICAgIFJlc291cmNlcy5Ob3RGb3VuZEV4Y2VwdGlvbiBybmYgPSBuZXcgUmVzb3VyY2VzLk5vdEZvdW5kRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAiQ2FuJ3QgbG9hZCBhZGFwdGVyIHJlc291cmNlIElEICIgKworICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmdldFJlc291cmNlcygpLmdldFJlc291cmNlRW50cnlOYW1lKGlkKSk7CisgICAgICAgICAgICBybmYuaW5pdENhdXNlKGV4KTsKKyAgICAgICAgICAgIHRocm93IHJuZjsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgIGlmIChwYXJzZXIgIT0gbnVsbCkgcGFyc2VyLmNsb3NlKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBHZW5lcmF0ZXMgYW4gYWRhcHRlciB1c2luZyB0aGUgc3BlY2lmaWVkIFhNTCBwYXJzZXIuIFRoaXMgbWV0aG9kIGlzIHJlc3BvbnNpYmxlCisgICAgICogZm9yIGNob29zaW5nIHRoZSB0eXBlIG9mIHRoZSBhZGFwdGVyIHRvIGNyZWF0ZSBiYXNlZCBvbiB0aGUgY29udGVudCBvZiB0aGUKKyAgICAgKiBYTUwgcGFyc2VyLgorICAgICAqIAorICAgICAqIFRoaXMgbWV0aG9kIHdpbGwgZ2VuZXJhdGUgYW4ge0BsaW5rIElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbn0gaWYKKyAgICAgKiA8Y29kZT5hc3NlcnROYW1lPC9jb2RlPiBpcyBub3QgbnVsbCBhbmQgZG9lcyBub3Q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GlvbigiVGhlIGFkYXB0ZXIgZGVmaW5lZCBpbiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgIGMuZ2V0UmVzb3VyY2VzKCkuZ2V0UmVzb3VyY2VFbnRyeU5hbWUoaWQpICsgIiBtdXN0IGJlIGEgPCIgKyBuYW1lICsgIiAvPiIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoQURBUFRFUl9DVVJTT1IuZXF1YWxzKG5hbWUpKSB7CisgICAgICAgICAgICAgICAgYWRhcHRlciA9IGNyZWF0ZUN1cnNvckFkYXB0ZXIoYywgcGFyc2VyLCBhdHRycywgaWQsIHBhcmFtZXRlcnMpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJVbmtub3duIGFkYXB0ZXIgbmFtZSAiICsgcGFyc2VyLmdldE5hbWUoKSArCisgICAgICAgICAgICAgICAgICAgICAgICAiIGluICIgKyBjLmdldFJlc291cmNlcygpLmdldFJlc291cmNlRW50cnlOYW1lKGlkKSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gYWRhcHRlcjsKKworICAgIH0KKworICAgIC8qKgorICAgICAqIENyZWF0ZXMgYW4gWG1sQ3Vyc29yQWRhcHRlciB1c2luZyBhbiBYbWxDdXJzb3JBZGFwdGVyUGFyc2VyLgorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIFhtbEN1cnNvckFkYXB0ZXIgY3JlYXRlQ3Vyc29yQWRhcHRlcihDb250ZXh0IGMsIFhtbFB1bGxQYXJzZXIgcGFyc2VyLAorICAgICAgICAgICAgQXR0cmlidXRlU2V0IGF0dHJzLCBpbnQgaWQsIE9iamVjdFtdIHBhcmFtZXRlcnMpCisgICAgICAgICAgICB0aHJvd3MgSU9FeGNlcHRpb24sIFhtbFB1bGxQYXJzZXJFeGNlcHRpb24geworCisgICAgICAgIHJldHVybiBu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sZWFibGUuQ3Vyc29yQWRhcHRlcl9sYXlvdXQsIDApOworICAgICAgICAgICAgaWYgKGxheW91dCA9PSAwKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiVGhlIGxheW91dCBzcGVjaWZpZWQgaW4gIiArCisgICAgICAgICAgICAgICAgICAgICAgICByZXNvdXJjZXMuZ2V0UmVzb3VyY2VFbnRyeU5hbWUobUlkKSArICIgZG9lcyBub3QgZXhpc3QiKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYS5yZWN5Y2xlKCk7CisKKyAgICAgICAgICAgIFhtbFB1bGxQYXJzZXIgcGFyc2VyID0gbVBhcnNlcjsKKyAgICAgICAgICAgIGludCB0eXBlOworICAgICAgICAgICAgaW50IGRlcHRoID0gcGFyc2VyLmdldERlcHRoKCk7CisKKyAgICAgICAgICAgIHdoaWxlICgoKHR5cGUgPSBwYXJzZXIubmV4dCgpKSAhPSBYbWxQdWxsUGFyc2VyLkVORF9UQUcgfHwgcGFyc2VyLmdldERlcHRoKCkgPiBkZXB0aCkgJiYKKyAgICAgICAgICAgICAgICAgICAgdHlwZSAhPSBYbWxQdWxsUGFyc2VyLkVORF9ET0NVTUVOVCkgeworCisgICAgICAgICAgICAgICAgaWYgKHR5cGUgIT0gWG1sUHVsbFBhcnNlci5TVEFSVF9UQUcpIHsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgU3RyaW5nIG5hbWUgPSBwYXJzZXIuZ2V0TmFtZSgpOworCisgICAgICAgICAgICAgICAgaWYgKEFEQVBURVJfQ1VSU09SX0JJTkQuZXF1YWxzKG5hbWUpKSB7CisgICAgICAgICAgICAgICAgICAgIHBhcnNlQmluZFRhZygpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoQURBUFRFUl9DVVJTT1JfU0VMRUNULmVxdWFscyhuYW1lKSkgeworICAgICAgICAgICAgICAgICAgICBwYXJzZVNlbGVjdFRhZygpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJVbmtub3duIHRhZyBuYW1lICIgKyBwYXJzZXIuZ2V0TmFtZSgpICsgIiBpbiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvdXJjZXMuZ2V0UmVzb3VyY2VFbnRyeU5hbWUobUlkKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBTdHJpbmdbXSBmcm9tQXJyYXkgPSBtRnJvbS50b0FycmF5KG5ldyBTdHJpbmdbbUZyb20uc2l6ZSgpXSk7CisgICAgICAgICAgICBpbnRbXSB0b0FycmF5ID0gbmV3IGludFttVG8uc2l6ZSgpXTsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgdG9BcnJheS5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgIHRvQXJyYXlbaV0gPSBtVG8uZ2V0KGkpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBTdHJpbmdbXSBzZWxlY3Rpb25BcmdzID0gbnVsbDsKKyAgICAgICAgICAgIGlmIChwYXJhbWV0ZXJzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBzZWxlY3Rpb25BcmdzID0gbmV3IFN0cmluZ1twYXJhbWV0ZXJzLmxlbmd0aF07CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzZWxlY3Rpb25BcmdzLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIHNlbGVjdGlvbkFyZ3NbaV0gPSAoU3RyaW5nKSBwYXJhbWV0ZXJzW2ldOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIG5ldyBYbWxDdXJzb3JBZGFwdGVyKG1Db250ZXh0LCBsYXlvdXQsIHVyaSwgZnJvbUFycmF5LCB0b0FycmF5LCBzZWxlY3Rpb24sCisgICAgICAgICAgICAgICAgICAgIHNlbGVjdGlvbkFyZ3MsIHNvcnRPcmRlciwgbUJpbmRlcnMpOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSB2b2lkIHBhcnNlU2VsZWN0VGFnKCkgeworICAgICAgICAgICAgVHlwZWRBcnJheSBhID0gbVJlc291cmNlcy5vYnRhaW5BdHRyaWJ1dGVzKG1BdHRycywKKyAgICAgICAgICAgICAgICAgICAgYW5kcm9pZC5SLnN0eWxlYWJsZS5DdXJzb3JBZGFwdGVyX1NlbGVjdEl0ZW0pOworCisgICAgICAgICAgICBTdHJpbmcgZnJvbU5hbWUgPSBhLmdldFN0cmluZyhhbmRyb2lkLlIuc3R5bGVhYmxlLkN1cnNvckFkYXB0ZXJfU2VsZWN0SXRlbV9jb2x1bW4pOworICAgICAgICAgICAgaWYgKGZyb21OYW1lID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJBIHNlbGVjdCBpdGVtIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgbVJlc291cmNlcy5nZXRSZXNvdXJjZUVudHJ5TmFtZShtSWQpICsKKyAgICAgICAgICAgICAgICAgICAgICAgICIgZG9lcyBub3QgaGF2ZSBhICdjb2x1bW4nIGF0dHJpYnV0ZSIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBhLnJlY3ljbGUoKTsKKworICAgICAgICAgICAgbUZyb20uYWRkKGZyb21OYW1lKTsKKyAgICAgICAgICAgIG1Uby5hZGQoVmlldy5OT19JRCk7CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIHZvaWQgcGFyc2VCaW5kVGFnKCkgdGhyb3dzIElPRXhjZXB0aW9uLCBYbWxQdWxsUGFyc2VyRXhjZXB0aW9uIHsKKyAgICAgICAgICAgIFJlc291cmNlcyByZXNvdXJjZXMgPSBtUmVzb3VyY2VzOworICAgICAgICAgICAgVHlwZWRBcnJheSBhID0gcmVzb3VyY2VzLm9idGFpbkF0dHJpYnV0ZXMobUF0dHJzLAorICAgICAgICAgICAgICAgICAgICBhbmRyb2lkLlIuc3R5bGVhYmxlLkN1cnNvckFkYXB0ZXJfQmluZEl0ZW0pOworCisgICAgICAgICAgICBTdHJpbmcgZnJvbU5hbWUgPSBhLmdldFN0cmluZyhhbmRyb2lkLlIuc3R5bGVhYmxlLkN1cnNvckFkYXB0ZXJfQmluZEl0ZW1fZnJvbSk7CisgICAgICAgICAgICBpZiAoZnJvbU5hbWUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkEgYmluZCBpdGVtIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgcmVzb3VyY2VzLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkgKyAiIGRvZXMgbm90IGhhdmUgYSAnZnJvbScgYXR0cmlidXRlIik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGludCB0b05hbWUgPSBhLmdldFJlc291cmNlSWQoYW5kcm9pZC5SLnN0eWxlYWJsZS5DdXJzb3JBZGFwdGVyX0JpbmRJdGVtX3RvLCAwKTsKKyAgICAgICAgICAgIGlmICh0b05hbWUgPT0gMCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkEgYmluZCBpdGVtIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgcmVzb3VyY2VzLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkgKyAiIGRvZXMgbm90IGhhdmUgYSAndG8nIGF0dHJpYnV0ZSIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBTdHJpbmcgYXNUeXBlID0gYS5nZXRTdHJpbmcoYW5kcm9pZC5SLnN0eWxlYWJsZS5DdXJzb3JBZGFwdGVyX0JpbmRJdGVtX2FzKTsKKyAgICAgICAgICAgIGlmIChhc1R5cGUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkEgYmluZCBpdGVtIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgcmVzb3VyY2VzLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkgKyAiIGRvZXMgbm90IGhhdmUgYW4gJ2FzJyBhdHRyaWJ1dGUiKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbUZyb20uYWRkKGZyb21OYW1lKTsKKyAgICAgICAgICAgIG1Uby5hZGQodG9OYW1lKTsKKyAgICAgICAgICAgIG1CaW5kZXJzLnB1dChmcm9tTmFtZSwgZmluZEJpbmRlcihhc1R5cGUpKTsKKworICAgICAgICAgICAgYS5yZWN5Y2xlKCk7CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIEN1cnNvckJpbmRlciBmaW5kQmluZGVyKFN0cmluZyB0eXBlKSB0aHJvd3MgSU9FeGNlcHRpb24sIFhtbFB1bGxQYXJzZXJFeGNlcHRpb24geworICAgICAgICAgICAgZmluYWwgWG1sUHVsbFBhcnNlciBwYXJzZXIgPSBtUGFyc2VyOworICAgICAgICAgICAgZmluYWwgQ29udGV4dCBjb250ZXh0ID0gbUNvbnRleHQ7CisgICAgICAgICAgICBDdXJzb3JUcmFuc2Zvcm1hdGlvbiB0cmFuc2Zvcm1hdGlvbiA9IG1JZGVudGl0eTsKKworICAgICAgICAgICAgaW50IHRhZ1R5cGU7CisgICAgICAgICAgICBpbnQgZGVwdGggPSBwYXJzZXIuZ2V0RGVwdGgoKTsKKworICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBpc0RyYXdhYmxlID0gQURBUFRFUl9DVVJTT1JfQVNfRFJBV0FCTEUuZXF1YWxzKHR5cGUpOyAgICAgICAgICAgIAorCisgICAgICAgICAgICB3aGlsZSAoKCh0YWdUeXBlID0gcGFyc2VyLm5leHQoKSkgIT0gWG1sUHVsbFBhcnNlci5FTkRfVEFHIHx8IHBhcnNlci5nZXREZXB0aCgpID4gZGVwdGgpCisgICAgICAgICAgICAgICAgICAgICYmIHRhZ1R5cGUgIT0gWG1sUHVsbFBhcnNlci5FTkRfRE9DVU1FTlQpIHsKKworICAgICAgICAgICAgICAgIGlmICh0YWdUeXBlICE9IFhtbFB1bGxQYXJzZXIuU1RBUlRfVEFHKSB7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIFN0cmluZyBuYW1lID0gcGFyc2VyLmdldE5hbWUoKTsKKworICAgICAgICAgICAgICAgIGlmIChBREFQVEVSX0NVUlNPUl9UUkFOU0ZPUk0uZXF1YWxzKG5hbWUpKSB7CisgICAgICAgICAgICAgICAgICAgIHRyYW5zZm9ybWF0aW9uID0gZmluZFRyYW5zZm9ybWF0aW9uKCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChBREFQVEVSX0NVUlNPUl9NQVAuZXF1YWxzKG5hbWUpKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghKHRyYW5zZm9ybWF0aW9uIGluc3RhbmNlb2YgTWFwVHJhbnNmb3JtYXRpb24pKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2Zvcm1hdGlvbiA9IG5ldyBNYXBUcmFuc2Zvcm1hdGlvbihjb250ZXh0KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBmaW5kTWFwKCgoTWFwVHJhbnNmb3JtYXRpb24pIHRyYW5zZm9ybWF0aW9uKSwgaXNEcmF3YWJsZSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIlVua25vd24gdGFnIG5hbWUgIiArIHBhcnNlci5nZXROYW1lKCkgKyAiIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0UmVzb3VyY2VFbnRyeU5hbWUobUlkKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoQURBUFRFUl9DVVJTT1JfQVNfU1RSSU5HLmVxdWFscyh0eXBlKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBuZXcgU3RyaW5nQmluZGVyKGNvbnRleHQsIHRyYW5zZm9ybWF0aW9uKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoQURBUFRFUl9DVVJTT1JfQVNfVEFHLmVxdWFscyh0eXBlKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBuZXcgVGFnQmluZGVyKGNvbnRleHQsIHRyYW5zZm9ybWF0aW9uKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoQURBUFRFUl9DVVJTT1JfQVNfSU1BR0UuZXF1YWxzKHR5cGUpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBJbWFnZUJpbmRlcihjb250ZXh0LCB0cmFuc2Zvcm1hdGlvbik7ICAgICAgICAgICAgCisgICAgICAgICAgICB9IGVsc2UgaWYgKEFEQVBURVJfQ1VSU09SX0FTX0lNQUdFX1VSSS5lcXVhbHModHlwZSkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbmV3IEltYWdlVXJpQmluZGVyKGNvbnRleHQsIHRyYW5zZm9ybWF0aW9uKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoaXNEcmF3YWJsZSkgeworICAgICAgICAgICAgICAgIHJldHVybiBuZXcgRHJhd2FibGVCaW5kZXIoY29udGV4dCwgdHJhbnNmb3JtYXRpb24pOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gY3JlYXRlQmluZGVyKHR5cGUsIHRyYW5zZm9ybWF0aW9uKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgQ3Vyc29yQmluZGVyIGNyZWF0ZUJpbmRlcihTdHJpbmcgdHlwZSwgQ3Vyc29yVHJhbnNmb3JtYXRpb24gdHJhbnNmb3JtYXRpb24pIHsKKyAgICAgICAgICAgIGlmIChtQ29udGV4dC5pc1Jlc3RyaWN0ZWQoKSkgcmV0dXJuIG51bGw7CisKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgZmluYWwgQ2xhc3M8Pz4ga2xhc3MgPSBDbGFzcy5mb3JOYW1lKHR5cGUsIHRydWUsIG1Db250ZXh0LmdldENsYXNzTG9hZGVyKCkpOworICAgICAgICAgICAgICAgIGlmIChDdXJzb3JCaW5kZXIuY2xhc3MuaXNBc3NpZ25hYmxlRnJvbShrbGFzcykpIHsKKyAgICAgICAgICAgICAgICAgICAgZmluYWwgQ29uc3RydWN0b3I8Pz4gYyA9IGtsYXNzLmdldERlY2xhcmVkQ29uc3RydWN0b3IoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29udGV4dC5jbGFzcywgQ3Vyc29yVHJhbnNmb3JtYXRpb24uY2xhc3MpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gKEN1cnNvckJpbmRlcikgYy5uZXdJbnN0YW5jZShtQ29udGV4dCwgdHJhbnNmb3JtYXRpb24pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gY2F0Y2ggKENsYXNzTm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkNhbm5vdCBpbnN0YW5jaWF0ZSBiaW5kZXIgdHlwZSBpbiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LmdldFJlc291cmNlcygpLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkgKyAiOiAiICsgdHlwZSwgZSk7CisgICAgICAgICAgICB9IGNhdGNoIChOb1N1Y2hNZXRob2RFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkNhbm5vdCBpbnN0YW5jaWF0ZSBiaW5kZXIgdHlwZSBpbiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LmdldFJlc291cmNlcygpLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkgKyAiOiAiICsgdHlwZSwgZSk7CisgICAgICAgICAgICB9IGNhdGNoIChJbnZvY2F0aW9uVGFyZ2V0RXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJDYW5ub3QgaW5zdGFuY2lhdGUgYmluZGVyIHR5cGUgaW4gIiArCisgICAgICAgICAgICAgICAgICAgICAgICBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRSZXNvdXJjZUVudHJ5TmFtZShtSWQpICsgIjogIiArIHR5cGUsIGUpOworICAgICAgICAgICAgfSBjYXRjaCAoSW5zdGFudGlhdGlvbkV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiQ2Fubm90IGluc3RhbmNpYXRlIGJpbmRlciB0eXBlIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgbUNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0UmVzb3VyY2VFbnRyeU5hbWUobUlkKSArICI6ICIgKyB0eXBlLCBlKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxBY2Nlc3NFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkNhbm5vdCBpbnN0YW5jaWF0ZSBiaW5kZXIgdHlwZSBpbiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LmdldFJlc291cmNlcygpLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkgKyAiOiAiICsgdHlwZSwgZSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSB2b2lkIGZpbmRNYXAoTWFwVHJhbnNmb3JtYXRpb24gdHJhbnNmb3JtYXRpb24sIGJvb2xlYW4gZHJhd2FibGUpIHsKKyAgICAgICAgICAgIFJlc291cmNlcyByZXNvdXJjZXMgPSBtUmVzb3VyY2VzOworCisgICAgICAgICAgICBUeXBlZEFycmF5IGEgPSByZXNvdXJjZXMub2J0YWluQXR0cmlidXRlcyhtQXR0cnMsCisgICAgICAgICAgICAgICAgICAgIGFuZHJvaWQuUi5zdHlsZWFibGUuQ3Vyc29yQWRhcHRlcl9NYXBJdGVtKTsKKworICAgICAgICAgICAgU3RyaW5nIGZyb20gPSBhLmdldFN0cmluZyhhbmRyb2lkLlIuc3R5bGVhYmxlLkN1cnNvckFkYXB0ZXJfTWFwSXRlbV9mcm9tVmFsdWUpOworICAgICAgICAgICAgaWYgKGZyb20gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkEgbWFwIGl0ZW0gaW4gIiArCisgICAgICAgICAgICAgICAgICAgICAgICByZXNvdXJjZXMuZ2V0UmVzb3VyY2VFbnRyeU5hbWUobUlkKSArCisgICAgICAgICAgICAgICAgICAgICAgICAiIGRvZXMgbm90IGhhdmUgYSAnZnJvbVZhbHVlJyBhdHRyaWJ1dGUiKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKCFkcmF3YWJsZSkgeworICAgICAgICAgICAgICAgIFN0cmluZyB0byA9IGEuZ2V0U3RyaW5nKGFuZHJvaWQuUi5zdHlsZWFibGUuQ3Vyc29yQWRhcHRlcl9NYXBJdGVtX3RvVmFsdWUpOworICAgICAgICAgICAgICAgIGlmICh0byA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkEgbWFwIGl0ZW0gaW4gIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb3VyY2VzLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgZG9lcyBub3QgaGF2ZSBhICd0b1ZhbHVlJyBhdHRyaWJ1dGUiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgdHJhbnNmb3JtYXRpb24uYWRkU3RyaW5nTWFwcGluZyhmcm9tLCB0byk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGludCB0byA9IGEuZ2V0UmVzb3VyY2VJZChhbmRyb2lkLlIuc3R5bGVhYmxlLkN1cnNvckFkYXB0ZXJfTWFwSXRlbV90b1ZhbHVlLCAwKTsKKyAgICAgICAgICAgICAgICBpZiAodG8gPT0gMCkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJBIG1hcCBpdGVtIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc291cmNlcy5nZXRSZXNvdXJjZUVudHJ5TmFtZShtSWQpICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIGRvZXMgbm90IGhhdmUgYSAndG9WYWx1ZScgYXR0cmlidXRlIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHRyYW5zZm9ybWF0aW9uLmFkZFJlc291cmNlTWFwcGluZyhmcm9tLCB0byk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGEucmVjeWNsZSgpOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSBDdXJzb3JUcmFuc2Zvcm1hdGlvbiBmaW5kVHJhbnNmb3JtYXRpb24oKSB7CisgICA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VGcm9tKGtsYXMpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBDb25zdHJ1Y3Rvcjw/PiBjID0ga2xhcy5nZXREZWNsYXJlZENvbnN0cnVjdG9yKENvbnRleHQuY2xhc3MpOworICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNmb3JtYXRpb24gPSAoQ3Vyc29yVHJhbnNmb3JtYXRpb24pIGMubmV3SW5zdGFuY2UobUNvbnRleHQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoQ2xhc3NOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkNhbm5vdCBpbnN0YW5jaWF0ZSB0cmFuc2Zvcm0gdHlwZSBpbiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LmdldFJlc291cmNlcygpLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkgKyAiOiAiICsgY2xhc3NOYW1lLCBlKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChOb1N1Y2hNZXRob2RFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJDYW5ub3QgaW5zdGFuY2lhdGUgdHJhbnNmb3JtIHR5cGUgaW4gIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRSZXNvdXJjZUVudHJ5TmFtZShtSWQpICsgIjogIiArIGNsYXNzTmFtZSwgZSk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoSW52b2NhdGlvblRhcmdldEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkNhbm5vdCBpbnN0YW5jaWF0ZSB0cmFuc2Zvcm0gdHlwZSBpbiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LmdldFJlc291cmNlcygpLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkgKyAiOiAiICsgY2xhc3NOYW1lLCBlKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChJbnN0YW50aWF0aW9uRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiQ2Fubm90IGluc3RhbmNpYXRlIHRyYW5zZm9ybSB0eXBlIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgbUNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0UmVzb3VyY2VFbnRyeU5hbWUobUlkKSArICI6ICIgKyBjbGFzc05hbWUsIGUpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxBY2Nlc3NFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJDYW5ub3QgaW5zdGFuY2lhdGUgdHJhbnNmb3JtIHR5cGUgaW4gIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRSZXNvdXJjZUVudHJ5TmFtZShtSWQpICsgIjogIiArIGNsYXNzTmFtZSwgZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBhLnJlY3ljbGUoKTsKKworICAgICAgICAgICAgaWYgKHRyYW5zZm9ybWF0aW9uID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJBIHRyYW5zZm9ybSBpdGVtIGluICIgKworICAgICAgICAgICAgICAgICAgICByZXNvdXJjZXMuZ2V0UmVzb3VyY2VFbnRyeU5hbWUobUlkKSArICIgbXVzdCBoYXZlIGEgJ3dpdGhDbGFzcycgb3IgIiArCisgICAgICAgICAgICAgICAgICAgICInd2l0aEV4cHJlc3Npb24nIGF0dHJpYnV0ZSIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICByZXR1cm4gdHJhbnNmb3JtYXRpb247CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIEN1cnNvclRyYW5zZm9ybWF0aW9uIGNyZWF0ZUV4cHJlc3Npb25UcmFuc2Zvcm1hdGlvbihTdHJpbmcgZXhwcmVzc2lvbikgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBFeHByZXNzaW9uVHJhbnNmb3JtYXRpb24obUNvbnRleHQsIGV4cHJlc3Npb24pOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogSW50ZXJmYWNlIHVzZWQgYnkgYWRhcHRlcnMgdGhhdCByZXF1aXJlIHRvIGJlIGxvYWRlZCBhZnRlciBjcmVhdGlvbi4KKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBpbnRlcmZhY2UgTWFuYWdlZEFkYXB0ZXIgeworICAgICAgICAvKioKKyAgICAgICAgICogTG9hZHMgdGhlIGNvbnRlbnQgb2YgdGhlIGFkYXB0ZXIsIGFzeW5jaHJvbm91c2x5LgorICAgICAgICAgKi8KKyAgICAgICAgdm9pZCBsb2FkKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogSW1wbGVtZW50YXRpb24gb2YgYSBDdXJzb3IgYWRhcHRlciBkZWZpbmVkIGluIFhNTC4gVGhpcyBjbGFzcyBpcyBhIHRoaW4gd3JhcHBlcgorICAgICAqIG9mIGEgU2ltcGxlQ3Vyc29yQWRhcHRlci4gVGhlIG1haW4gZGlmZmVyZW5jZSBpcyB0aGUgYWJpbGl0eSB0byBoYW5kbGUgQ3Vyc29yQmluZGVycy4KKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBjbGFzcyBYbWxDdXJ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T3JkZXIgPSBzb3J0T3JkZXI7CisgICAgICAgICAgICBtQ29sdW1ucyA9IG5ldyBTdHJpbmdbZnJvbS5sZW5ndGggKyAxXTsKKyAgICAgICAgICAgIC8vIFRoaXMgaXMgbWFuZGF0b3J5IGluIEN1cnNvckFkYXB0ZXIKKyAgICAgICAgICAgIG1Db2x1bW5zWzBdID0gIl9pZCI7CisgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KGZyb20sIDAsIG1Db2x1bW5zLCAxLCBmcm9tLmxlbmd0aCk7CisKKyAgICAgICAgICAgIEN1cnNvckJpbmRlciBiYXNpYyA9IG5ldyBTdHJpbmdCaW5kZXIoY29udGV4dCwgbmV3IElkZW50aXR5VHJhbnNmb3JtYXRpb24oY29udGV4dCkpOworICAgICAgICAgICAgZmluYWwgaW50IGNvdW50ID0gZnJvbS5sZW5ndGg7CisgICAgICAgICAgICBtQmluZGVycyA9IG5ldyBDdXJzb3JCaW5kZXJbY291bnRdOworCisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgICAgICAgICBDdXJzb3JCaW5kZXIgYmluZGVyID0gYmluZGVycy5nZXQoZnJvbVtpXSk7CisgICAgICAgICAgICAgICAgaWYgKGJpbmRlciA9PSBudWxsKSBiaW5kZXIgPSBiYXNpYzsKKyAgICAgICAgICAgICAgICBtQmluZGVyc1tpXSA9IGJpbmRlcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBiaW5kVmlldyhWaWV3IHZpZXcsIENvbnRleHQgY29udGV4dCwgQ3Vyc29yIGN1cnNvcikgeworICAgICAgICAgICAgZmluYWwgaW50IGNvdW50ID0gbVRvLmxlbmd0aDsKKyAgICAgICAgICAgIGZpbmFsIGludFtdIGZyb20gPSBtRnJvbTsKKyAgICAgICAgICAgIGZpbmFsIGludFtdIHRvID0gbVRvOworICAgICAgICAgICAgZmluYWwgQ3Vyc29yQmluZGVyW10gYmluZGVycyA9IG1CaW5kZXJzOworCisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBWaWV3IHYgPSB2aWV3LmZpbmRWaWV3QnlJZCh0b1tpXSk7CisgICAgICAgICAgICAgICAgaWYgKHYgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBiaW5kZXJzW2ldLmJpbmQodiwgY3Vyc29yLCBmcm9tW2ldKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBsb2FkKCkgeworICAgICAgICAgICAgaWYgKG1VcmkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1Mb2FkVGFzayA9IG5ldyBRdWVyeVRhc2soKS5leGVjdXRlKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICB2b2lkIHNldFVyaShTdHJpbmcgdXJpKSB7CisgICAgICAgICAgICBtVXJpID0gdXJpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGNoYW5nZUN1cnNvcihDdXJzb3IgYykgeworICAgICAgICAgICAgaWYgKG1Mb2FkVGFzayAhPSBudWxsICYmIG1Mb2FkVGFzay5nZXRTdGF0dXMoKSAhPSBRdWVyeVRhc2suU3RhdHVzLkZJTklTSEVEKSB7CisgICAgICAgICAgICAgICAgbUxvYWRUYXNrLmNhbmNlbCh0cnVlKTsKKyAgICAgICAgICAgICAgICBtTG9hZFRhc2sgPSBudWxsOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc3VwZXIuY2hhbmdlQ3Vyc29yKGMpOworICAgICAgICB9CisKKyAgICAgICAgY2xhc3MgUXVlcnlUYXNrIGV4dGVuZHMgQXN5bmNUYXNrPFZvaWQsIFZvaWQsIEN1cnNvcj4geworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwcm90ZWN0ZWQgQ3Vyc29yIGRvSW5CYWNrZ3JvdW5kKFZvaWQuLi4gcGFyYW1zKSB7CisgICAgICAgICAgICAgICAgaWYgKG1Db250ZXh0IGluc3RhbmNlb2YgQWN0aXZpdHkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuICgoQWN0aXZpdHkpIG1Db250ZXh0KS5tYW5hZ2VkUXVlcnkoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVXJpLnBhcnNlKG1VcmkpLCBtQ29sdW1ucywgbVNlbGVjdGlvbiwgbVNlbGVjdGlvbkFyZ3MsIG1Tb3J0T3JkZXIpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKS5xdWVyeSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBVcmkucGFyc2UobVVyaSksIG1Db2x1bW5zLCBtU2VsZWN0aW9uLCBtU2VsZWN0aW9uQXJncywgbVNvcnRPcmRlcik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uUG9zdEV4ZWN1dGUoQ3Vyc29yIGN1cnNvcikgeworICAgICAgICAgICAgICAgIGlmICghaXNDYW5jZWxsZWQoKSkgeworICAgICAgICAgICAgICAgICAgICBYbWxDdXJzb3JBZGFwdGVyLnN1cGVyLmNoYW5nZUN1cnNvcihjdXJzb3IpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIElkZW50aXR5IHRyYW5zZm9ybWF0aW9uLCByZXR1cm5zIHRoZSBjb250ZW50IG9mIHRoZSBzcGVjaWZpZWQgY29sdW1uIGFzIGEgU3RyaW5nLAorICAgICAqI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lc3Npb25Ob2RlKCIiKTsKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBTdHJpbmdCdWlsZGVyIG1CdWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKKworICAgICAgICBwdWJsaWMgRXhwcmVzc2lvblRyYW5zZm9ybWF0aW9uKENvbnRleHQgY29udGV4dCwgU3RyaW5nIGV4cHJlc3Npb24pIHsKKyAgICAgICAgICAgIHN1cGVyKGNvbnRleHQpOworCisgICAgICAgICAgICBwYXJzZShleHByZXNzaW9uKTsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgdm9pZCBwYXJzZShTdHJpbmcgZXhwcmVzc2lvbikgeworICAgICAgICAgICAgRXhwcmVzc2lvbk5vZGUgbm9kZSA9IG1GaXJzdE5vZGU7CisgICAgICAgICAgICBpbnQgc2VnbWVudFN0YXJ0OworICAgICAgICAgICAgaW50IGNvdW50ID0gZXhwcmVzc2lvbi5sZW5ndGgoKTsKKworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CisgICAgICAgICAgICAgICAgY2hhciBjID0gZXhwcmVzc2lvbi5jaGFyQXQoaSk7CisgICAgICAgICAgICAgICAgLy8gU3RhcnQgYSBjb2x1bW4gbmFtZSBzZWdtZW50CisgICAgICAgICAgICAgICAgc2VnbWVudFN0YXJ0ID0gaTsKKyAgICAgICAgICAgICAgICBpZiAoYyA9PSAneycpIHsKKyAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGkgPCBjb3VudCAmJiAoYyA9IGV4cHJlc3Npb24uY2hhckF0KGkpKSAhPSAnfScpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGkrKzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvLyBXZSd2ZSByZWFjaGVkIHRoZSBlbmQsIGJ1dCB0aGUgZXhwcmVzc2lvbiBkaWRuJ3QgY2xvc2UKKyAgICAgICAgICAgICAgICAgICAgaWYgKGMgIT0gJ30nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJUaGUgdHJhbnNmb3JtIGV4cHJlc3Npb24gY29udGFpbnMgYSAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm5vbi1jbG9zZWQgY29sdW1uIG5hbWU6ICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHByZXNzaW9uLnN1YnN0cmluZyhzZWdtZW50U3RhcnQgKyAxLCBpKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgbm9kZS5uZXh0ID0gbmV3IENvbHVtbkV4cHJlc3Npb25Ob2RlKGV4cHJlc3Npb24uc3Vic3RyaW5nKHNlZ21lbnRTdGFydCArIDEsIGkpKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICB3aGlsZSAoaSA8IGNvdW50ICYmIChjID0gZXhwcmVzc2lvbi5jaGFyQXQoaSkpICE9ICd7JykgeworICAgICAgICAgICAgICAgICAgICAgICAgaSsrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG5vZGUubmV4dCA9IG5ldyBDb25zdGFudEV4cHJlc3Npb25Ob2RlKGV4cHJlc3Npb24uc3Vic3RyaW5nKHNlZ21lbnRTdGFydCwgaSkpOworICAgICAgICAgICAgICAgICAgICAvLyBSZXdpbmQgaWYgd2UndmUgcmVhY2hlZCBhIGNvbHVtbiBleHByZXNzaW9uCisgICAgICAgICAgICAgICAgICAgIGlmIChjID09ICd7JykgaS0tOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBub2RlID0gbm9kZS5uZXh0OworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBTdHJpbmcgdHJhbnNmb3JtKEN1cnNvciBjdXJzb3IsIGludCBjb2x1bW5JbmRleCkgeworICAgICAgICAgICAgZmluYWwgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbUJ1aWxkZXI7CisgICAgICAgICAgICBidWlsZGVyLmRlbGV0ZSgwLCBidWlsZGVyLmxlbmd0aCgpKTsKKworICAgICAgICAgICAgRXhwcmVzc2lvbk5vZGUgbm9kZSA9IG1GaXJzdE5vZGU7CisgICAgICAgICAgICAvLyBTa2lwIHRoZSBmaXJzdCBub2RlCisgICAgICAgICAgICB3aGlsZSAoKG5vZGUgPSBub2RlLm5leHQpICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChub2RlLmFzU3RyaW5nKGN1cnNvcikpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOworICAgICAgICB9CisKKyAgICAgICAgc3RhdGljIGFic3RyYWN0IGNsYXNzIEV4cHJlc3Npb25Ob2RlIHsKKyAgICAgICAgICAgIHB1YmxpYyBFeHByZXNzaW9uTm9kZSBuZXh0OworCisgICAgICAgICAgICBwdWJsaWMgYWJzdHJhY3QgU3RyaW5nIGFzU3RyaW5nKEN1cnNvciBjdXJzb3IpOworICAgICAgICB9CisKKyAgICAgICAgc3RhdGljIGNsYXNzIENvbnN0YW50RXhwcmVzc2lvbk5vZGUgZXh0ZW5kcyBFeHByZXNzaW9uTm9kZSB7CisgICAgICAgICAgICBwcml2YXRlIGZpbmFsIFN0cmluZyBtQ29uc3RhbnQ7CisKKyAgICAgICAgICAgIENvbnN0YW50RXhwcmVzc2lvbk5vZGUoU3RyaW5nIGNvbnN0YW50KSB7CisgICAgICAgICAgICAgICAgbUNvbnN0YW50ID0gY29uc3RhbnQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHVibGljIFN0cmluZyBhc1N0cmluZyhDdXJzb3IgY3Vyc29yKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1Db25zdGFudDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHN0YXRpYyBjbGFzcyBDb2x1bW5FeHByZXNzaW9uTm9kZSBleHRlbmRzIEV4cHJlc3Npb25Ob2RlIHsKKyAgICAgICAgICAgIHByaXZhdGUgZmluYWwgU3RyaW5nIG1Db2x1bW5OYW1lOworICAgICAgICAgICAgcHJpdmF0ZSBDdXJzb3IgbVNpZ25hdHVyZTsKKyAgICAgICAgICAgIHByaXZhdGUgaW50IG1Db2x1bW5JbmRleCA9IC0xOworCisgICAgICAgICAgICBDb2x1bW5FeHByZXNzaW9uTm9kZShTdHJpbmcgY29sdW1uTmFtZSkgeworICAgICAgICAgICAgICAgIG1Db2x1bW5OYW1lID0gY29sdW1uTmFtZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwdWJsaWMgU3RyaW5nIGFzU3RyaW5nKEN1cnNvciBjdXJzb3IpIHsKKyAgICAgICAgICAgICAgICBpZiAoY3Vyc29yICE9IG1TaWduYXR1cmUgfHwgbUNvbHVtbkluZGV4ID09IC0xKSB7CisgICAgICAgICAgICAgICAgICAgIG1Db2x1bW5JbmRleCA9IGN1cnNvci5nZXRDb2x1bW5JbmRleChtQ29sdW1uTmFtZSk7CisgICAgICAgICAgICAgICAgICAgIG1TaWduYXR1cmUgPSBjdXJzb3I7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgcmV0dXJuIGN1cnNvci5nZXRTdHJpbmcobUNvbHVtbkluZGV4KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEEgbWFwIHRyYW5zZm9ybWF0aW9uIG9mZmVycyBhIHNpbXBsZSBtYXBwaW5nIGJldHdlZW4gc3BlY2lmaWVkIFN0cmluZyB2YWx1ZXMKKyAgICAgKiB0byBTdHJpbmdzIG9yIGludGVnZXJzLgorICAgICAqLworICAgIHByaXZ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cmluZ01hcHBpbmdzLmdldCh2YWx1ZSk7CisgICAgICAgICAgICByZXR1cm4gdHJhbnNmb3JtZWQgPT0gbnVsbCA/IHZhbHVlIDogdHJhbnNmb3JtZWQ7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGludCB0cmFuc2Zvcm1Ub1Jlc291cmNlKEN1cnNvciBjdXJzb3IsIGludCBjb2x1bW5JbmRleCkgeworICAgICAgICAgICAgZmluYWwgU3RyaW5nIHZhbHVlID0gY3Vyc29yLmdldFN0cmluZyhjb2x1bW5JbmRleCk7CisgICAgICAgICAgICBmaW5hbCBJbnRlZ2VyIHRyYW5zZm9ybWVkID0gbVJlc291cmNlTWFwcGluZ3MuZ2V0KHZhbHVlKTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRyYW5zZm9ybWVkID09IG51bGwgPyBJbnRlZ2VyLnBhcnNlSW50KHZhbHVlKSA6IHRyYW5zZm9ybWVkOworICAgICAgICAgICAgfSBjYXRjaCAoTnVtYmVyRm9ybWF0RXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEJpbmRzIGEgU3RyaW5nIHRvIGEgVGV4dFZpZXcuCisgICAgICovCisgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgU3RyaW5nQmluZGVyIGV4dGVuZHMgQ3Vyc29yQmluZGVyIHsKKyAgICAgICAgcHVibGljIFN0cmluZ0JpbmRlcihDb250ZXh0IGNvbnRleHQsIEN1cnNvclRyYW5zZm9ybWF0aW9uIHRyYW5zZm9ybWF0aW9uKSB7CisgICAgICAgICAgICBzdXBlcihjb250ZXh0LCB0cmFuc2Zvcm1hdGlvbik7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGJvb2xlYW4gYmluZChWaWV3IHZpZXcsIEN1cnNvciBjdXJzb3IsIGludCBjb2x1bW5JbmRleCkgeworICAgICAgICAgICAgaWYgKHZpZXcgaW5zdGFuY2VvZiBUZXh0VmlldykgeworICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyB0ZXh0ID0gbVRyYW5zZm9ybWF0aW9uLnRyYW5zZm9ybShjdXJzb3IsIGNvbHVtbkluZGV4KTsKKyAgICAgICAgICAgICAgICAoKFRleHRWaWV3KSB2aWV3KS5zZXRUZXh0KHRleHQpOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogQmluZHMgYW4gaW1hZ2UgYmxvYiB0byBhbiBJbWFnZVZpZXcuCisgICAgICovCisgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgSW1hZ2VCaW5kZXIgZXh0ZW5kcyBDdXJzb3JCaW5kZXIgeworICAgICAgICBwdWJsaWMgSW1hZ2VCaW5kZXIoQ29udGV4dCBjb250ZXh0LCBDdXJzb3JUcmFuc2Zvcm1hdGlvbiB0cmFuc2Zvcm1hdGlvbikgeworICAgICAgICAgICAgc3VwZXIoY29udGV4dCwgdHJhbnNmb3JtYXRpb24pOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIGJpbmQoVmlldyB2aWV3LCBDdXJzb3IgY3Vyc29yLCBpbnQgY29sdW1uSW5kZXgpIHsKKyAgICAgICAgICAgIGlmICh2aWV3IGluc3RhbmNlb2YgSW1hZ2VWaWV3KSB7CisgICAgICAgICAgICAgICAgZmluYWwgYnl0ZVtdIGRhdGEgPSBjdXJzb3IuZ2V0QmxvYihjb2x1bW5JbmRleCk7CisgICAgICAgICAgICAgICAgKChJbWFnZVZpZXcpIHZpZXcpLnNldEltYWdlQml0bWFwKEJpdG1hcEZhY3RvcnkuZGVjb2RlQnl0ZUFycmF5KGRhdGEsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLmxlbmd0aCkpOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgVGFnQmluZGVyIGV4dGVuZHMgQ3Vyc29yQmluZGVyIHsKKyAgICAgICAgcHVibGljIFRhZ0JpbmRlcihDb250ZXh0IGNvbnRleHQsIEN1cnNvclRyYW5zZm9ybWF0aW9uIHRyYW5zZm9ybWF0aW9uKSB7CisgICAgICAgICAgICBzdXBlcihjb250ZXh0LCB0cmFuc2Zvcm1hdGlvbik7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGJvb2xlYW4gYmluZChWaWV3IHZpZXcsIEN1cnNvciBjdXJzb3IsIGludCBjb2x1bW5JbmRleCkgeworICAgICAgICAgICAgZmluYWwgU3RyaW5nIHRleHQgPSBtVHJhbnNmb3JtYXRpb24udHJhbnNmb3JtKGN1cnNvciwgY29sdW1uSW5kZXgpOworICAgICAgICAgICAgdmlldy5zZXRUYWcodGV4dCk7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEJpbmRzIGFuIGltYWdlIFVSSSB0byBhbiBJbWFnZVZpZXcuCisgICAgICovCisgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgSW1hZ2VVcmlCaW5kZXIgZXh0ZW5kcyBDdXJzb3JCaW5kZXIgeworICAgICAgICBwdWJsaWMgSW1hZ2VVcmlCaW5kZXIoQ29udGV4dCBjb250ZXh0LCBDdXJzb3JUcmFuc2Zvcm1hdGlvbiB0cmFuc2Zvcm1hdGlvbikgeworICAgICAgICAgICAgc3VwZXIoY29udGV4dCwgdHJhbnNmb3JtYXRpb24pOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIGJpbmQoVmlldyB2aWV3LCBDdXJzb3IgY3Vyc29yLCBpbnQgY29sdW1uSW5kZXgpIHsKKyAgICAgICAgICAgIGlmICh2aWV3IGluc3RhbmNlb2YgSW1hZ2VWaWV3KSB7CisgICAgICAgICAgICAgICAgKChJbWFnZVZpZXcpIHZpZXcpLnNldEltYWdlVVJJKFVyaS5wYXJzZSgKKyAgICAgICAgICAgICAgICAgICAgICAgIG1UcmFuc2Zvcm1hdGlvbi50cmFuc2Zvcm0oY3Vyc29yLCBjb2x1bW5JbmRleCkpKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEJpbmRzIGEgZHJhd2FibGUgcmVzb3VyY2UgaWRlbnRpZmllciB0byBhbiBJbWFnZVZpZXcuCisgICAgICovCisgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgRHJhd2FibGVCaW5kZXIgZXh0ZW5kcyBDdXJzb3JCaW5kZXIgeworICAgICAgICBwdWJsaWMgRHJhd2FibGVCaW5kZXIoQ29udGV4dCBjb250ZXh0LCBDdXJzb3JUcmFuc2Zvcm1hdGlvbiB0cmFuc2Zvcm1hdGlvbikgeworICAgICAgICAgICAgc3VwZXIoY29udGV4dCwgdHJhbnNmb3JtYXRpb24pOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIGJpbmQoVmlldyB2aWV3LCBDdXJzb3IgY3Vyc29yLCBpbnQgY29sdW1uSW5kZXgpIHsKKyAgICAgICAgICAgIGlmICh2aWV3IGluc3RhbmNlb2YgSW1hZ2VWaWV3KSB7CisgICAgICAgICAgICAgICAgZmluYWwgaW50IHJlc291cmNlID0gbV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Ui5hdHRyLmF1dG9Db21wbGV0ZVRleHRWaWV3U3R5bGUpOwogICAgICAgICBtUG9wdXAuc2V0U29mdElucHV0TW9kZShXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcy5TT0ZUX0lOUFVUX0FESlVTVF9SRVNJWkUpOworICAgICAgICBtUG9wdXAuc2V0UHJvbXB0UG9zaXRpb24oTGlzdFBvcHVwV2luZG93LlBPU0lUSU9OX1BST01QVF9CRUxPVyk7CiAKICAgICAgICAgVHlwZWRBcnJheSBhID0KICAgICAgICAgICAgIGNvbnRleHQub2J0YWluU3R5bGVkQXR0cmlidXRlcygKQEAgLTE2NiwxNCArMTM4LDExIEBACiAgICAgICAgIG1UaHJlc2hvbGQgPSBhLmdldEludCgKICAgICAgICAgICAgICAgICBSLnN0eWxlYWJsZS5BdXRvQ29tcGxldGVUZXh0Vmlld19jb21wbGV0aW9uVGhyZXNob2xkLCAyKTsKIAotICAgICAgICBtSGludFRleHQgPSBhLmdldFRleHQoUi5zdHlsZWFibGUuQXV0b0NvbXBsZXRlVGV4dFZpZXdfY29tcGxldGlvbkhpbnQpOwotCi0gICAgICAgIG1Ecm9wRG93bkxpc3RIaWdobGlnaHQgPSBhLmdldERyYXdhYmxlKAotICAgICAgICAgICAgICAgIFIuc3R5bGVhYmxlLkF1dG9Db21wbGV0ZVRleHRWaWV3X2Ryb3BEb3duU2VsZWN0b3IpOwotICAgICAgICBtRHJvcERvd25WZXJ0aWNhbE9mZnNldCA9IChpbnQpCi0gICAgICAgICAgICAgICAgYS5nZXREaW1lbnNpb24oUi5zdHlsZWFibGUuQXV0b0NvbXBsZXRlVGV4dFZpZXdfZHJvcERvd25WZXJ0aWNhbE9mZnNldCwgMC4wZik7Ci0gICAgICAgIG1Ecm9wRG93bkhvcml6b250YWxPZmZzZXQgPSAoaW50KQotICAgICAgICAgICAgICAgIGEuZ2V0RGltZW5zaW9uKFIuc3R5bGVhYmxlLkF1dG9Db21wbGV0ZVRleHRWaWV3X2Ryb3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G93bkl0ZW1DbGlja0xpc3RlbmVyKCkpOworICAgICAgICBzZXRDb21wbGV0aW9uSGludChhLmdldFRleHQoUi5zdHlsZWFibGUuQXV0b0NvbXBsZXRlVGV4dFZpZXdfY29tcGxldGlvbkhpbnQpKTsKIAogICAgICAgICAvLyBBbHdheXMgdHVybiBvbiB0aGUgYXV0byBjb21wbGV0ZSBpbnB1dCB0eXBlIGZsYWcsIHNpbmNlIGl0CiAgICAgICAgIC8vIG1ha2VzIG5vIHNlbnNlIHRvIHVzZSB0aGlzIHdpZGdldCB3aXRob3V0IGl0LgpAQCAtMjM4LDYgKzIxMiwyMCBAQAogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHNldENvbXBsZXRpb25IaW50KENoYXJTZXF1ZW5jZSBoaW50KSB7CiAgICAgICAgIG1IaW50VGV4dCA9IGhpbnQ7CisgICAgICAgIGlmIChoaW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgIGlmIChtSGludFZpZXcgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZpbmFsIFRleHRWaWV3IGhpbnRWaWV3ID0gKFRleHRWaWV3KSBMYXlvdXRJbmZsYXRlci5mcm9tKGdldENvbnRleHQoKSkuaW5mbGF0ZSgKKyAgICAgICAgICAgICAgICAgICAgICAgIG1IaW50UmVzb3VyY2UsIG51bGwpLmZpbmRWaWV3QnlJZChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmlkLnRleHQxKTsKKyAgICAgICAgICAgICAgICBoaW50Vmlldy5zZXRUZXh0KG1IaW50VGV4dCk7CisgICAgICAgICAgICAgICAgbUhpbnRWaWV3ID0gaGludFZpZXc7CisgICAgICAgICAgICAgICAgbVBvcHVwLnNldFByb21wdFZpZXcoaGludFZpZXcpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtSGludFZpZXcuc2V0VGV4dChoaW50KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG1Qb3B1cC5zZXRQcm9tcHRWaWV3KG51bGwpOworICAgICAgICAgICAgbUhpbnRWaWV3ID0gbnVsbDsKKyAgICAgICAgfQogICAgIH0KICAgICAKICAgICAvKioKQEAgLTI1MCw3ICsyMzgsNyBAQAogICAgICAqIEBhdHRyIHJlZiBhbmRyb2lkLlIuc3R5bGVhYmxlI0F1dG9Db21wbGV0ZVRleHRWaWV3X2Ryb3BEb3duV2lkdGgKICAgICAgKi8KICAgICBwdWJsaWMgaW50IGdldERyb3BEb3duV2lkdGgoKSB7Ci0gICAgICAgIHJldHVybiBtRHJvcERvd25XaWR0aDsKKyAgICAgICAgcmV0dXJuIG1Qb3B1cC5nZXRXaWR0aCgpOwogICAgIH0KICAgICAKICAgICAvKioKQEAgLTI2Myw3ICsyNTEsNyBAQAogICAgICAqIEBhdHRyIHJlZiBhbmRyb2lkLlIuc3R5bGVhYmxlI0F1dG9Db21wbGV0ZVRleHRWaWV3X2Ryb3BEb3duV2lkdGgKICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBzZXREcm9wRG93bldpZHRoKGludCB3aWR0aCkgewotICAgICAgICBtRHJvcERvd25XaWR0aCA9IHdpZHRoOworICAgICAgICBtUG9wdXAuc2V0V2lkdGgod2lkdGgpOwogICAgIH0KIAogICAgIC8qKgpAQCAtMjc3LDcgKzI2NSw3IEBACiAgICAgICogQGF0dHIgcmVmIGFuZHJvaWQuUi5zdHlsZWFibGUjQXV0b0NvbXBsZXRlVGV4dFZpZXdfZHJvcERvd25IZWlnaHQKICAgICAgKi8KICAgICBwdWJsaWMgaW50IGdldERyb3BEb3duSGVpZ2h0KCkgewotICAgICAgICByZXR1cm4gbURyb3BEb3duSGVpZ2h0OworICAgICAgICByZXR1cm4gbVBvcHVwLmdldEhlaWdodCgpOwogICAgIH0KIAogICAgIC8qKgpAQCAtMjkxLDcgKzI3OSw3IEBACiAgICAgICogQGF0dHIgcmVmIGFuZHJvaWQuUi5zdHlsZWFibGUjQXV0b0NvbXBsZXRlVGV4dFZpZXdfZHJvcERvd25IZWlnaHQKICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBzZXREcm9wRG93bkhlaWdodChpbnQgaGVpZ2h0KSB7Ci0gICAgICAgIG1Ecm9wRG93bkhlaWdodCA9IGhlaWdodDsKKyAgICAgICAgbVBvcHVwLnNldEhlaWdodChoZWlnaHQpOwogICAgIH0KICAgICAKICAgICAvKioKQEAgLTMxNiw3ICszMDQsNyBAQAogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHNldERyb3BEb3duQW5jaG9yKGludCBpZCkgewogICAgICAgICBtRHJvcERvd25BbmNob3JJZCA9IGlkOwotICAgICAgICBtRHJvcERvd25BbmNob3JWaWV3ID0gbnVsbDsKKyAgICAgICAgbVBvcHVwLnNldEFuY2hvclZpZXcobnVsbCk7CiAgICAgfQogICAgIAogICAgIC8qKgpAQCAtMzU4LDcgKzM0Niw3IEBACiAgICAgICogQHBhcmFtIG9mZnNldCB0aGUgdmVydGljYWwgb2Zmc2V0CiAgICAgICovCiAgICAgcHVibGljIHZvaWQgc2V0RHJvcERvd25WZXJ0aWNhbE9mZnNldChpbnQgb2Zmc2V0KSB7Ci0gICAgICAgIG1Ecm9wRG93blZlcnRpY2FsT2Zmc2V0ID0gb2Zmc2V0OworICAgICAgICBtUG9wdXAuc2V0VmVydGljYWxPZmZzZXQob2Zmc2V0KTsKICAgICB9CiAgICAgCiAgICAgLyoqCkBAIC0zNjcsNyArMzU1LDcgQEAKICAgICAgKiBAcmV0dXJuIHRoZSB2ZXJ0aWNhbCBvZmZzZXQKICAgICAgKi8KICAgICBwdWJsaWMgaW50IGdldERyb3BEb3duVmVydGljYWxPZmZzZXQoKSB7Ci0gICAgICAgIHJldHVybiBtRHJvcERvd25WZXJ0aWNhbE9mZnNldDsKKyAgICAgICAgcmV0dXJuIG1Qb3B1cC5nZXRWZXJ0aWNhbE9mZnNldCgpOwogICAgIH0KICAgICAKICAgICAvKioKQEAgLTM3Niw3ICszNjQsNyBAQAogICAgICAqIEBwYXJhbSBvZmZzZXQgdGhlIGhvcml6b250YWwgb2Zmc2V0CiAgICAgICovCiAgICAgcHVibGljIHZvaWQgc2V0RHJvcERvd25Ib3Jpem9udGFsT2Zmc2V0KGludCBvZmZzZXQpIHsKLSAgICAgICAgbURyb3BEb3duSG9yaXpvbnRhbE9mZnNldCA9IG9mZnNldDsKKyAgICAgICAgbVBvcHVwLnNldEhvcml6b250YWxPZmZzZXQob2Zmc2V0KTsKICAgICB9CiAgICAgCiAgICAgLyoqCkBAIC0zODUsNyArMzczLDcgQEAKICAgICAgKiBAcmV0dXJuIHRoZSBob3Jpem9udGFsIG9mZnNldAogICAgICAqLwogICAgIHB1YmxpYyBpbnQgZ2V0RHJvcERvd25Ib3Jpem9udGFsT2Zmc2V0KCkgewotICAgICAgICByZXR1cm4gbURyb3BEb3duSG9yaXpvbnRhbE9mZnNldDsKKyAgICAgICAgcmV0dXJuIG1Qb3B1cC5nZXRIb3Jpem9udGFsT2Zmc2V0KCk7CiAgICAgfQogCiAgICAgIC8qKgpAQCAtNDIyLDcgKzQxMCw3IEBACiAgICAgICogQGhpZGUgUGVuZGluZyBBUEkgY291bmNpbCBhcHByb3ZhbAogICAgICAqLwogICAgIHB1YmxpYyBib29sZWFuIGlzRHJvcERvd25BbHdheXNWaXNpYmxlKCkgewotICAgICAgICByZXR1cm4gbURyb3BEb3duQWx3YXlzVmlzaWJsZTsKKyAgICAgICAgcmV0dXJuIG1Qb3B1cC5pc0Ryb3BEb3duQWx3YXlzVmlzaWJsZSgpOwogICAgIH0KIAogICAgIC8qKgpAQCAtNDM5LDcgKzQyNyw3IEBACiAgICAgICogQGhpZGUgUGVuZGluZyBBUEkgY291bmNpbCBhcHByb3ZhbAogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHNldERyb3BEb3duQWx3YXlzVmlzaWJsZShib29sZWFuIGRyb3BEb3duQWx3YXlzVmlzaWJsZSkgewotICAgICAgICBtRHJvcERvd25BbHdheXNWaXNpYmxlID0gZHJvcERvd25BbHdheXNWaXNpYmxlOworICAgICAgICBtUG9wdXAuc2V0RHJvcERvd25BbHdheXNWaXNpYmxlKGRyb3BEb3duQWx3YXlzVmlzaWJsZSk7CiAgICAgfQogICAgCiAgICAgLyoqCkBAIC02MDYsMTUgKzU5NCwxMyBAQAogICAgICAgICAgICAgbUZpbHRlciA9IG51bGw7CiAgICAgICAgIH0KIAotICAgICAgICBpZiAobURyb3BEb3duTGlzdCAhPSBudWxsKSB7Ci0gICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldEFkYXB0ZXIobUFkYXB0ZXIpOwotICAgICAgICB9CisgICAgICAgIG1Qb3B1cC5zZXRBZGFwdGVyKG1BZGFwdGVyKTsKICAgICB9CiAKICAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgYm9vbGVhbiBvbktleVByZUltZShpbnQga2V5Q29kZSwgS2V5RXZlbnQgZXZlbnQpIHsKICAgICAgICAgaWYgKGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9CQUNLICYmIGlzUG9wdXBTaG93aW5nKCkKLSAgICAgICAgICAgICAgICAmJiAhbURyb3BEb3duQWx3YXlzVmlzaWJsZSkgeworICAgICAgICAgICAgICAgICYmICFtUG9wdXAuaXNEcm9wRG93bkFsd2F5c1Zpc2libGUoKSkgewogICAgICAgICAgICAgLy8gc3BlY2lhbCBjYXNlIGZvciB0aGUgYmFjayBrZXksIHdlIGRvIG5vdCBldmVuIHRyeSB0byBzZW5kIGl0CiAgICAgICAgICAgICAvLyB0byB0aGUgZHJvcCBkb3duIGxpc3QgYnV0IGluc3RlYWQsIGNvbnN1bWUgaXQgaW1tZWRpYXRlbHkKICAgICAgICAgICAgIGlmIChldmVudC5nZXRBY3Rpb24oKSA9PSBLZXlFdmVudC5BQ1RJT05fRE9XTiAmJiBldmVudC5nZXRSZXBlYXRDb3VudCgpID09IDApIHsKQEAgLTYzMywxOCArNjE5LDE2IEBACiAKICAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgYm9vbGVhbiBvbktleVVwKGludCBrZXlDb2RlLCBLZXlFdmVudCBldmVudCkgewotICAgICAgICBpZiAoaXNQb3B1cFNob3dpbmcoKSAmJiBtRHJvcERvd25MaXN0LmdldFNlbGVjdGVkSXRlbVBvc2l0aW9uKCkgPj0gMCkgewotICAgICAgICAgICAgYm9vbGVhbiBjb25zdW1lZCA9IG1Ecm9wRG93bkxpc3Qub25LZXlVcChrZXlDb2RlLCBldmVudCk7Ci0gICAgICAgICAgICBpZiAoY29uc3VtZWQpIHsKLSAgICAgICAgICAgICAgICBzd2l0Y2ggKGtleUNvZGUpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gaWYgdGhlIGxpc3QgYWNjZXB0cyB0aGUga2V5IGV2ZW50cyBhbmQgdGhlIGtleSBldmVudAotICAgICAgICAgICAgICAgICAgICAvLyB3YXMgYSBjbGljaywgdGhlIHRleHQgdmlldyBnZXRzIHRoZSBzZWxlY3RlZCBpdGVtCi0gICAgICAgICAgICAgICAgICAgIC8vIGZyb20gdGhlIGRyb3AgZG93biBhcyBpdHMgY29udGVudAotICAgICAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRU5URVI6Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9EUEFEX0NFTlRFUjoKLSAgICAgICAgICAgICAgICAgICAgICAgIHBlcmZvcm1Db21wbGV0aW9uKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgIGJvb2xlYW4gY29uc3VtZWQgPSBtUG9wdXAub25LZXlVcChrZXlDb2RlLCBldmVudCk7CisgICAgICAgIGlmIChjb25zdW1lZCkgeworICAgICAgICAgICAgc3dpdGNoIChrZXlDb2RlKSB7CisgICAgICAgICAgICAvLyBpZiB0aGUgbGlzdCBhY2NlcHRzIHRoZSBrZXkgZXZlbnRzIGFuZCB0aGUga2V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Ugc2luY2UgdGhhdCB3b3VsZCBjYXVzZSBpdAotICAgICAgICAgICAgLy8gdG8gc2VsZWN0IG9uZSBvZiBpdHMgaXRlbXMKLSAgICAgICAgICAgIGlmIChrZXlDb2RlICE9IEtleUV2ZW50LktFWUNPREVfU1BBQ0UKLSAgICAgICAgICAgICAgICAgICAgJiYgKG1Ecm9wRG93bkxpc3QuZ2V0U2VsZWN0ZWRJdGVtUG9zaXRpb24oKSA+PSAwCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGtleUNvZGUgIT0gS2V5RXZlbnQuS0VZQ09ERV9FTlRFUgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYga2V5Q29kZSAhPSBLZXlFdmVudC5LRVlDT0RFX0RQQURfQ0VOVEVSKSkpIHsKLSAgICAgICAgICAgICAgICBpbnQgY3VySW5kZXggPSBtRHJvcERvd25MaXN0LmdldFNlbGVjdGVkSXRlbVBvc2l0aW9uKCk7Ci0gICAgICAgICAgICAgICAgYm9vbGVhbiBjb25zdW1lZDsKLQotICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gYmVsb3cgPSAhbVBvcHVwLmlzQWJvdmVBbmNob3IoKTsKLQotICAgICAgICAgICAgICAgIGZpbmFsIExpc3RBZGFwdGVyIGFkYXB0ZXIgPSBtQWRhcHRlcjsKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBib29sZWFuIGFsbEVuYWJsZWQ7Ci0gICAgICAgICAgICAgICAgaW50IGZpcnN0SXRlbSA9IEludGVnZXIuTUFYX1ZBTFVFOwotICAgICAgICAgICAgICAgIGludCBsYXN0SXRlbSA9IEludGVnZXIuTUlOX1ZBTFVFOwotCi0gICAgICAgICAgICAgICAgaWYgKGFkYXB0ZXIgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBhbGxFbmFibGVkID0gYWRhcHRlci5hcmVBbGxJdGVtc0VuYWJsZWQoKTsKLSAgICAgICAgICAgICAgICAgICAgZmlyc3RJdGVtID0gYWxsRW5hYmxlZCA/IDAgOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ecm9wRG93bkxpc3QubG9va0ZvclNlbGVjdGFibGVQb3NpdGlvbigwLCB0cnVlKTsKLSAgICAgICAgICAgICAgICAgICAgbGFzdEl0ZW0gPSBhbGxFbmFibGVkID8gYWRhcHRlci5nZXRDb3VudCgpIC0gMSA6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbURyb3BEb3duTGlzdC5sb29rRm9yU2VsZWN0YWJsZVBvc2l0aW9uKGFkYXB0ZXIuZ2V0Q291bnQoKSAtIDEsIGZhbHNlKTsgICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBpZiAoKGJlbG93ICYmIGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1VQICYmIGN1ckluZGV4IDw9IGZpcnN0SXRlbSkgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgICghYmVsb3cgJiYga2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX0RQQURfRE9XTiAmJiBjdXJJbmRleCA+PSBsYXN0SXRlbSkpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gV2hlbiB0aGUgc2VsZWN0aW9uIGlzIGF0IHRoZSB0b3AsIHdlIGJsb2NrIHRoZSBrZXkKLSAgICAgICAgICAgICAgICAgICAgLy8gZXZlbnQgdG8gcHJldmVudCBmb2N1cyBmcm9tIG1vdmluZy4KLSAgICAgICAgICAgICAgICAgICAgY2xlYXJMaXN0U2VsZWN0aW9uKCk7Ci0gICAgICAgICAgICAgICAgICAgIG1Qb3B1cC5zZXRJbnB1dE1ldGhvZE1vZGUoUG9wdXBXaW5kb3cuSU5QVVRfTUVUSE9EX05FRURFRCk7Ci0gICAgICAgICAgICAgICAgICAgIHNob3dEcm9wRG93bigpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAvLyBXQVJOSU5HOiBQbGVhc2UgcmVhZCB0aGUgY29tbWVudCB3aGVyZSBtTGlzdFNlbGVjdGlvbkhpZGRlbgotICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICBpcyBkZWNsYXJlZAotICAgICAgICAgICAgICAgICAgICBtRHJvcERvd25MaXN0Lm1MaXN0U2VsZWN0aW9uSGlkZGVuID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgY29uc3VtZWQgPSBtRHJvcERvd25MaXN0Lm9uS2V5RG93bihrZXlDb2RlLCBldmVudCk7Ci0gICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJLZXkgZG93bjogY29kZT0iICsga2V5Q29kZSArICIgbGlzdCBjb25zdW1lZD0iICsgY29uc3VtZWQpOwotCi0gICAgICAgICAgICAgICAgaWYgKGNvbnN1bWVkKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIElmIGl0IGhhbmRsZWQgdGhlIGtleSBldmVudCwgdGhlbiB0aGUgdXNlciBpcwotICAgICAgICAgICAgICAgICAgICAvLyBuYXZpZ2F0aW5nIGluIHRoZSBsaXN0LCBzbyB3ZSBzaG91bGQgcHV0IGl0IGluIGZyb250LgotICAgICAgICAgICAgICAgICAgICBtUG9wdXAuc2V0SW5wdXRNZXRob2RNb2RlKFBvcHVwV2luZG93LklOUFVUX01FVEhPRF9OT1RfTkVFREVEKTsKLSAgICAgICAgICAgICAgICAgICAgLy8gSGVyZSdzIGEgbGl0dGxlIHRyaWNrIHdlIG5lZWQgdG8gZG8gdG8gbWFrZSBzdXJlIHRoYXQKLSAgICAgICAgICAgICAgICAgICAgLy8gdGhlIGxpc3QgdmlldyBpcyBhY3R1YWxseSBzaG93aW5nIGl0cyBmb2N1cyBpbmRpY2F0b3IsCi0gICAgICAgICAgICAgICAgICAgIC8vIGJ5IGVuc3VyaW5nIGl0IGhhcyBmb2N1cyBhbmQgZ2V0dGluZyBpdHMgd2luZG93IG91dAotICAgICAgICAgICAgICAgICAgICAvLyBvZiB0b3VjaCBtb2RlLgotICAgICAgICAgICAgICAgICAgICBtRHJvcERvd25MaXN0LnJlcXVlc3RGb2N1c0Zyb21Ub3VjaCgpOwotICAgICAgICAgICAgICAgICAgICBzaG93RHJvcERvd24oKTsKLQotICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGtleUNvZGUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGF2b2lkIHBhc3NpbmcgdGhlIGZvY3VzIGZyb20gdGhlIHRleHQgdmlldyB0byB0aGUKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5leHQgY29tcG9uZW50Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRU5URVI6Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRFBBRF9DRU5URVI6Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRFBBRF9ET1dOOgotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0RQQURfVVA6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBpZiAoYmVsb3cgJiYga2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX0RQQURfRE9XTikgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2hlbiB0aGUgc2VsZWN0aW9uIGlzIGF0IHRoZSBib3R0b20sIHdlIGJsb2NrIHRoZQotICAgICAgICAgICAgICAgICAgICAgICAgLy8gZXZlbnQgdG8gYXZvaWQgZ29pbmcgdG8gdGhlIG5leHQgZm9jdXNhYmxlIHdpZGdldAotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1ckluZGV4ID09IGxhc3RJdGVtKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIWJlbG93ICYmIGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1VQICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VySW5kZXggPT0gZmlyc3RJdGVtKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgaWYgKG1Qb3B1cC5vbktleURvd24oa2V5Q29kZSwgZXZlbnQpKSB7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgaWYgKCFpc1BvcHVwU2hvd2luZygpKSB7CiAgICAgICAgICAgICBzd2l0Y2goa2V5Q29kZSkgewogICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0RQQURfRE9XTjoKICAgICAgICAgICAgICAgICBwZXJmb3JtVmFsaWRhdGlvbigpOwpAQCAtNzQzLDcgKzY1MSw3IEBACiAgICAgICAgIGJvb2xlYW4gaGFuZGxlZCA9IHN1cGVyLm9uS2V5RG93bihrZXlDb2RlLCBldmVudCk7CiAgICAgICAgIG1MYXN0S2V5Q29kZSA9IEtleUV2ZW50LktFWUNPREVfVU5LTk9XTjsKIAotICAgICAgICBpZiAoaGFuZGxlZCAmJiBpc1BvcHVwU2hvd2luZygpICYmIG1Ecm9wRG93bkxpc3QgIT0gbnVsbCkgeworICAgICAgICBpZiAoaGFuZGxlZCAmJiBpc1BvcHVwU2hvd2luZygpKSB7CiAgICAgICAgICAgICBjbGVhckxpc3RTZWxlY3Rpb24oKTsKICAgICAgICAgfQogCkBAIC04MDQsMTEgKzcxMiwxMiBAQAogICAgICAgICBpZiAoZW5vdWdoVG9GaWx0ZXIoKSkgewogICAgICAgICAgICAgaWYgKG1GaWx0ZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIHBlcmZvcm1GaWx0ZXJpbmcoZ2V0VGV4dCgpLCBtTGFzdEtleUNvZGUpOworICAgICAgICAgICAgICAgIGJ1aWxkSW1lQ29tcGxldGlvbnMoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIC8vIGRyb3AgZG93biBpcyBhdXRvbWF0aWNhbGx5IGRpc21pc3NlZCB3aGVuIGVub3VnaCBjaGFyYWN0ZXJzCiAgICAgICAgICAgICAvLyBhcmUgZGVsZXRlZCBmcm9tIHRoZSB0ZXh0IHZpZXcKLSAgICAgICAgICAgIGlmICghbURyb3BEb3duQWx3YXlzVmlzaWJsZSkgZGlzbWlzc0Ryb3BEb3duKCk7CisgICAgICAgICAgICBpZiAoIW1Qb3B1cC5pc0Ryb3BEb3duQWx3YXlzVmlzaWJsZSgpKSBkaXNtaXNzRHJvcERvd24oKTsKICAgICAgICAgICAgIGlmIChtRmlsdGVyICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBtRmlsdGVyLmZpbHRlcihudWxsKTsKICAgICAgICAgICAgIH0KQEAgLTg0MSwxMyArNzUwLDcgQEAKICAgICAgKiBpdCBiYWNrLgogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIGNsZWFyTGlzdFNlbGVjdGlvbigpIHsKLSAgICAgICAgZmluYWwgRHJvcERvd25MaXN0VmlldyBsaXN0ID0gbURyb3BEb3duTGlzdDsKLSAgICAgICAgaWYgKGxpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgLy8gV0FSTklORzogUGxlYXNlIHJlYWQgdGhlIGNvbW1lbnQgd2hlcmUgbUxpc3RTZWxlY3Rpb25IaWRkZW4gaXMgZGVjbGFyZWQKLSAgICAgICAgICAgIGxpc3QubUxpc3RTZWxlY3Rpb25IaWRkZW4gPSB0cnVlOwotICAgICAgICAgICAgbGlzdC5oaWRlU2VsZWN0b3IoKTsKLSAgICAgICAgICAgIGxpc3QucmVxdWVzdExheW91dCgpOwotICAgICAgICB9CisgICAgICAgIG1Qb3B1cC5jbGVhckxpc3RTZWxlY3Rpb24oKTsKICAgICB9CiAgICAgCiAgICAgLyoqCkBAIC04NTYsMTEgKzc1OSw3IEBACiAgICAgICogQHBhcmFtIHBvc2l0aW9uIFRoZSBwb3NpdGlvbiB0byBtb3ZlIHRoZSBzZWxlY3RvciB0by4KICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBzZXRMaXN0U2VsZWN0aW9uKGludCBwb3NpdGlvbikgewotICAgICAgICBpZiAobVBvcHVwLmlzU2hvd2luZygpICYmIChtRHJvcERvd25MaXN0ICE9IG51bGwpKSB7Ci0gICAgICAgICAgICBtRHJvcERvd25MaXN0Lm1MaXN0U2VsZWN0aW9uSGlkZGVuID0gZmFsc2U7Ci0gICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldFNlbGVjdGlvbihwb3NpdGlvbik7Ci0gICAgICAgICAgICAvLyBMaXN0Vmlldy5zZXRTZWxlY3Rpb24oKSB3aWxsIGNhbGwgcmVxdWVzdExheW91dCgpCi0gICAgICAgIH0KKyAgICAgICAgbVBvcHVwLnNldFNlbGVjdGlvbihwb3NpdGlvbik7CiAgICAgfQogCiAgICAgLyoqCkBAIC04NzQsMTAgKzc3Myw3IEBACiAgICAgICogQHNlZSBMaXN0VmlldyNnZXRTZWxlY3RlZEl0ZW1Qb3NpdGlvbigpCiAgICAgICovCiAgICAgcHVibGljIGludCBnZXRMaXN0U2VsZWN0aW9uKCkgewotICAgICAgICBpZiAobVBvcHVwLmlzU2hvd2luZygpICYmIChtRHJvcERvd25MaXN0ICE9IG51bGwpKSB7Ci0gICAgICAgICAgICByZXR1cm4gbURyb3BEb3duTGlzdC5nZXRTZWxlY3RlZEl0ZW1Qb3NpdGlvbigpOwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBMaXN0Vmlldy5JTlZBTElEX1BPU0lUSU9OOworICAgICAgICByZXR1cm4gbVBvcHVwLmdldFNlbGVjdGVkSXRlbVBvc2l0aW9uKCk7CiAgICAgfQogCiAgICAgLyoqCkBAIC05MTEsMTMgKzgwNyw3IEBACiAgICAgICAgICAgICByZXBsYWNlVGV4dChjb21wbGV0aW9uLmdldFRleHQoKSk7CiAgICAgICAgICAgICBtQmxvY2tDb21wbGV0aW9uID0gZmFsc2U7CiAKLSAgICAgICAgICAgIGlmIChtSXRlbUNsaWNrTGlzdGVuZXIgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGZpbmFsIERyb3BEb3duTGlzdFZpZXcgbGlzdCA9IG1Ecm9wRG93bkxpc3Q7Ci0gICAgICAgICAgICAgICAgLy8gTm90ZSB0aGF0IHdlIGRvbid0IGhhdmUgYSBWaWV3IGhlcmUsIHNvIHdlIHdpbGwgbmVlZCB0bwotICAgICAgICAgICAgICAgIC8vIHN1cHBseSBudWxsLiAgSG9wZWZ1bGx5IG5vIGV4aXN0aW5nIGFwcHMgY3Jhc2guLi4KLSAgICAgICAgICAgICAgICBtSXRlbUNsaWNrTGlzdGVuZXIub25JdGVtQ2xpY2sobGlzdCwgbnVsbCwgY29tcGxldGlvbi5nZXRQb3NpdGlvbigpLAotICAgICAgICAgICAgICAgICAgICAgICAgY29tcGxldGlvbi5nZXRJZCgpKTsKLSAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1Qb3B1cC5wZXJmb3JtSXRlbUNsaWNrKGNvbXBsZXRpb24uZ2V0UG9zaXRpb24oKSk7CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTkyNSw3ICs4MTUsNyBAQAogICAgICAgICBpZiAoaXNQb3B1cFNob3dpbmcoKSkgewogICAgICAgICAgICAgT2JqZWN0IHNlbGVjdGVkSXRlbTsKICAgICAgICAgICAgIGlmIChwb3NpdGlvbiA8IDApIHsKLSAgICAgICAgICAgICAgICBzZWxlY3RlZEl0ZW0gPSBtRHJvcERvd25MaXN0LmdldFNlbGVjdGVkSXRlbSgpOworICAgICAgICAgICAgICAgIHNlbGVjdGVkSXRlbSA9IG1Qb3B1cC5nZXRTZWxlY3RlZEl0ZW0oKTsKICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgc2VsZWN0ZWRJdGVtID0gbUFkYXB0ZXIuZ2V0SXRlbShwb3NpdGlvbik7CiAgICAgICAgICAgICB9CkBAIC05MzksMTggKzgyOSwxOCBAQAogICAgICAgICAgICAgbUJsb2NrQ29tcGxldGlvbiA9IGZhbHNlOyAgICAgICAgICAgIAogCiAgICAgICAgICAgICBpZiAobUl0ZW1DbGlja0xpc3RlbmVyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBmaW5hbCBEcm9wRG93bkxpc3RWaWV3IGxpc3QgPSBtRHJvcERvd25MaXN0OworICAgICAgICAgICAgICAgIGZpbmFsIExpc3RQb3B1cFdpbmRvdyBsaXN0ID0gbVBvcHVwOwogCiAgICAgICAgICAgICAgICAgaWYgKHNlbGVjdGVkVmlldyA9PSBudWxsIHx8IHBvc2l0aW9uIDwgMCkgewogICAgICAgICAgICAgICAgICAgICBzZWxlY3RlZFZpZXcgPSBsaXN0LmdldFNlbGVjdGVkVmlldygpOwogICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGxpc3QuZ2V0U2VsZWN0ZWRJdGVtUG9zaXRpb24oKTsKICAgICAgICAgICAgICAgICAgICAgaWQgPSBsaXN0LmdldFNlbGVjdGVkSXRlbUlkKCk7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1JdGVtQ2xpY2tMaXN0ZW5lci5vbkl0ZW1DbGljayhsaXN0LCBzZWxlY3RlZFZpZXcsIHBvc2l0aW9uLCBpZCk7CisgICAgICAgICAgICAgICAgbUl0ZW1DbGlja0xpc3RlbmVyLm9uSXRlbUNsaWNrKGxpc3QuZ2V0TGlzdFZpZXcoKSwgc2VsZWN0ZWRWaWV3LCBwb3NpdGlvbiwgaWQpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKLSAgICAgICAgaWYgKG1Ecm9wRG93bkRpc21pc3NlZE9uQ29tcGxldGlvbiAmJiAhbURyb3BEb3duQWx3YXlzVmlzaWJsZSkgeworICAgICAgICBpZiAobURyb3BEb3duRGlzbWlzc2VkT25Db21wbGV0aW9uICYmICFtUG9wdXAuaXNEcm9wRG93bkFsd2F5c1Zpc2libGUoKSkgewogICAgICAgICAgICAgZGlzbWlzc0Ryb3BEb3duKCk7CiAgICAgICAgIH0KICAgICB9CkBAIC0xMDAwLDcgKzg5MCw2IEBACiAgICAgLyoqIHtAaW5oZXJpdERvY30gKi8KICAgICBwdWJsaWMgdm9pZCBvbkZpbHRlckNvbXBsZXRlKGludCBjb3VudCkgewogICAgICAgICB1cGRhdGVEcm9wRG93bkZvckZpbHRlcihjb3VudCk7Ci0KICAgICB9CiAKICAgICBwcml2YXRlIHZvaWQgdXBkYXRlRHJvcERvd25Gb3JGaWx0ZXIoaW50IGNvdW50KSB7CkBAIC0xMDE0LDExICs5MDMsMTIgQEAKICAgICAgICAgICogdG8gZmlsdGVyLgogICAgICAgICAgKi8KIAotICAgICAgICBpZiAoKGNvdW50ID4gMCB8fCBtRHJvcERvd25BbHdheXNWaXNpYmxlKSAmJiBlbm91Z2hUb0ZpbHRlcigpKSB7CisgICAgICAgIGZpbmFsIGJvb2xlYW4gZHJvcERvd25BbHdheXNWaXNpYmxlID0gbVBvcHVwLmlzRHJvcERvd25BbHdheXNWaXNpYmxlKCk7CisgICAgICAgIGlmICgoY291bnQgPiAwIHx8IGRyb3BEb3duQWx3YXlzVmlzaWJsZSkgJiYgZW5vdWdoVG9GaWx0ZXIoKSkgewogICAgICAgICAgICAgaWYgKGhhc0ZvY3VzKCkgJiYgaGFzV2luZG93Rm9jdXMoKSkgewogICAgICAgICAgICAgICAgIHNob3dEcm9wRG93bigpOwogICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgaWYgKCFtRHJvcERvd25BbHdheXNWaXNpYmxlKSB7CisgICAgICAgIH0gZWxzZSBpZiAoIWRyb3BEb3duQWx3YXlzVmlzaWJsZSkgewogICAgICAgICAgICAgZGlzbWlzc0Ryb3BEb3duKCk7CiAgICAgICAgIH0KICAgICB9CkBAIC0xMDI2LDcgKzkxNiw3IEBACiAgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIHZvaWQgb25XaW5kb3dGb2N1c0NoYW5nZWQoYm9vbGVhbiBoYXNXaW5kb3dGb2N1cykgewogICAgICAgICBzdXBlci5vbldpbmRvd0ZvY3VzQ2hhbmdlZChoYXNXaW5kb3dGb2N1cyk7Ci0gICAgICAgIGlmICghaGFzV2luZG93Rm9jdXMgJiYgIW1Ecm9wRG93bkFsd2F5c1Zpc2libGUpIHsKKyAgICAgICAgaWYgKCFoYXNXaW5kb3dGb2N1cyAmJiAhbVBvcHVwLmlzRHJvcERvd25BbHdheXNWaXNpYmxlKCkpIHsKICAgICAgICAgICAgIGRpc21pc3NEcm9wRG93bigpOwogICAgICAgICB9CiAgICAgfQpAQCAtMTAzNiw3ICs5MjYsNyBAQAogICAgICAgICBzdXBlci5vbkRpc3BsYXlIaW50KGhpbnQpOwogICAgICAgICBzd2l0Y2ggKGhpbnQpIHsKICAgICAgICAgICAgIGNhc2UgSU5WSVNJQkxFOgotICAgICAgICAgICAgICAgIGlmICghbURyb3BEb3duQWx3YXlzVmlzaWJsZSkgeworICAgICAgICAgICAgICAgIGlmICghbVBvcHVwLmlzRHJvcERvd25BbHdheXNWaXNpYmxlKCkpIHsKICAgICAgICAgICAgICAgICAgICAgZGlzbWlzc0Ryb3BEb3duKCk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGJyZWFrOwpAQCAtMTA1MCw3ICs5NDAsNyBAQAogICAgICAgICBpZiAoIWZvY3VzZWQpIHsKICAgICAgICAgICAgIHBlcmZvcm1WYWxpZGF0aW9uKCk7CiAgICAgICAgIH0KLSAgICAgICAgaWYgKCFmb2N1c2VkICYmICFtRHJvcERvd25BbHdheXNWaXNpYmxlKSB7CisgICAgICAgIGlmICghZm9jdXNlZCAmJiAhbVBvcHVwLmlzRHJvcERvd25BbHdheXNWaXNpYmxlKCkpIHsKICAgICAgICAgICAgIGRpc21pc3NEcm9wRG93bigpOwogICAgICAgICB9CiAgICAgfQpAQCAtMTA3NSw4ICs5NjUsNiBAQAogICAgICAgICAgICAgaW1tLmRpc3BsYXlDb21wbGV0aW9ucyh0aGlzLCBudWxsKTsKICAgICAgICAgfQogICAgICAgICBtUG9wdXAuZGlzbWlzcygpOwotICAgICAgICBtUG9wdXAuc2V0Q29udGVudFZpZXcobnVsbCk7Ci0gICAgICAgIG1Ecm9wRG93bkxpc3QgPSBudWxsOwogICAgIH0KIAogICAgIEBPdmVycmlkZQpAQCAtMTA4OSwxOCArOTc3LDYgQEAKIAogICAgICAgICByZXR1cm4gcmVzdWx0OwogICAgIH0KLSAgICAKLSAgICAvKioKLSAgICAgKiA8cD5Vc2VkIGZvciBsYXp5IGluc3RhbnRpYXRpb24gb2YgdGhlIGFuY2hvciB2aWV3IGZyb20gdGhlIGlkIHdlIGhhdmUuIElmIHRoZSB2YWx1ZSBvZgotICAgICAqIHRoZSBpZCBpcyBOT19JRCBvciB3ZSBjYW4ndCBmaW5kIGEgdmlldyBmb3IgdGhlIGdpdmVuIGlkLCB3ZSByZXR1cm4gdGhpcyBUZXh0VmlldyBhcwotICAgICAqIHRoZSBkZWZhdWx0IGFuY2hvcmluZyBwb2ludC48L3A+Ci0gICAgICovCi0gICAgcHJpdmF0ZSBWaWV3IGdldERyb3BEb3duQW5jaG9yVmlldygpIHsKLSAgICAgICAgaWYgKG1Ecm9wRG93bkFuY2hvclZpZXcgPT0gbnVsbCAmJiBtRHJvcERvd25BbmNob3JJZCAhPSBWaWV3Lk5PX0lEKSB7Ci0gICAgICAgICAgICBtRHJvcERvd25BbmNob3JWaWV3ID0gZ2V0Um9vdFZpZXcoKS5maW5kVmlld0J5SWQobURyb3BEb3duQW5jaG9ySWQpOwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBtRHJvcERvd25BbmNob3JWaWV3ID09IG51bGwgPyB0aGlzIDogbURyb3BEb3duQW5jaG9yVmlldzsKLSAgICB9CiAKICAgICAvKioKICAgICAgKiBJc3N1ZXMgYSBydW5uYWJsZSB0byBzaG93IHRoZSBkcm9wZG93biBhcyBzb29uIGFzIHBvc3NpYmxlLgpAQCAtMTEwOCw3ICs5ODQsNyBAQAogICAgICAqIEBoaWRlIGludGVybmFsIHVzZWQgb25seSBieSBTZWFyY2hEaWFsb2cKICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBzaG93RHJvcERvd25BZnRlckxheW91dCgpIHsKLSAgICAgICAgcG9zdChtU2hvd0Ryb3BEb3duUnVubmFibGUpOworICAgICAgICBtUG9wdXAucG9zdFNob3coKTsKICAgICB9CiAgICAgCiAgICAgLyoqCkBAIC0xMTE5LDcgKzk5NSw3IEBACiAgICAgICovCiAgICAgcHVibGljIHZvaWQgZW5zdXJlSW1lVmlzaWJsZShib29sZWFuIHZpc2libGUpIHsKICAgICAgICAgbVBvcHVwLnNldElucHV0TWV0aG9kTW9kZSh2aXNpYmxlCi0gICAgICAgICAgICAgICAgPyBQb3B1cFdpbmRvdy5JTlBVVF9NRVRIT0RfTkVFREVEIDogUG9wdXBXaW5kb3cuSU5QVVRfTUVUSE9EX05PVF9ORUVERUQpOworICAgICAgICAgICAgICAgID8gTGlzdFBvcHVwV2luZG93LklOUFVUX01FVEhPRF9ORUVERUQgOiBMaXN0UG9wdXBXaW5kb3cuSU5QVVRfTUVUSE9EX05PVF9ORUVERUQpOwogICAgICAgICBzaG93RHJvcERvd24oKTsKICAgICB9CiAKQEAgLTExMjcsODkgKzEwMDMsMjEgQEAKICAgICA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MTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAobURyb3BEb3duV2lkdGggPT0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQpIHsKLSAgICAgICAgICAgICAgICB3aWR0aFNwZWMgPSBnZXREcm9wRG93bkFuY2hvclZpZXcoKS5nZXRXaWR0aCgpOworICAgICAgICBpZiAobVBvcHVwLmdldEFuY2hvclZpZXcoKSA9PSBudWxsKSB7CisgICAgICAgICAgICBpZiAobURyb3BEb3duQW5jaG9ySWQgIT0gVmlldy5OT19JRCkgeworICAgICAgICAgICAgICAgIG1Qb3B1cC5zZXRBbmNob3JWaWV3KGdldFJvb3RWaWV3KCkuZmluZFZpZXdCeUlkKG1Ecm9wRG93bkFuY2hvcklkKSk7CiAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHdpZHRoU3BlYyA9IG1Ecm9wRG93bldpZHRoOworICAgICAgICAgICAgICAgIG1Qb3B1cC5zZXRBbmNob3JWaWV3KHRoaXMpOwogICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobURyb3BEb3duSGVpZ2h0ID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UKSB7Ci0gICAgICAgICAgICAgICAgLy8gVGhlIGNhbGwgdG8gUG9wdXBXaW5kb3cncyB1cGRhdGUgbWV0aG9kIGJlbG93IGNhbiBhY2NlcHQgLTEgZm9yIGFueQotICAgICAgICAgICAgICAgIC8vIHZhbHVlIHlvdSBkbyBub3Qgd2FudCB0byB1cGRhdGUuCi0gICAgICAgICAgICAgICAgaGVpZ2h0U3BlYyA9IG5vSW5wdXRNZXRob2QgPyBoZWlnaHQgOiBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVDsKLSAgICAgICAgICAgICAgICBpZiAobm9JbnB1dE1ldGhvZCkgewotICAgICAgICAgICAgICAgICAgICBtUG9wdXAuc2V0V2luZG93TGF5b3V0TW9kZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRHJvcERvd25XaWR0aCA9PSBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCA/Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCA6IDAsIDApOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIG1Qb3B1cC5zZXRXaW5kb3dMYXlvdXRNb2RlKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ecm9wRG93bldpZHRoID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UID8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UIDogMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIGlmIChtRHJvcERvd25IZWlnaHQgPT0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQpIHsKLSAgICAgICAgICAgICAgICBoZWlnaHRTcGVjID0gaGVpZ2h0OwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBoZWlnaHRTcGVjID0gbURyb3BEb3duSGVpZ2h0OwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtUG9wdXAuc2V0T3V0c2lkZVRvdWNoYWJsZSghbUZvcmNlSWdub3JlT3V0c2lkZVRvdWNoICYmICFtRHJvcERvd25BbHdheXNWaXNpYmxlKTsKLQotICAgICAgICAgICAgbVBvcHVwLnVwZGF0ZShnZXREcm9wRG93bkFuY2hvclZpZXcoKSwgbURyb3BEb3duSG9yaXpvbnRhbE9mZnNldCwKLSAgICAgICAgICAgICAgICAgICAgbURyb3BEb3duVmVydGljYWxPZmZzZXQsIHdpZHRoU3BlYywgaGVpZ2h0U3BlYyk7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAobURyb3BEb3duV2lkdGggPT0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQpIHsKLSAgICAgICAgICAgICAgICB3aWR0aFNwZWMgPSBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVDsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1Ecm9wRG93bldpZHRoID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuV1JBUF9DT05URU5UKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1Qb3B1cC5zZXRXaWR0aChnZXREcm9wRG93bkFuY2hvclZpZXcoKS5nZXRXaWR0aCgpKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBtUG9wdXAuc2V0V2lkdGgobURyb3BEb3duV2lkdGgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG1Ecm9wRG93bkhlaWdodCA9PSBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCkgewotICAgICAgICAgICAgICAgIGhlaWdodFNwZWMgPSBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVDsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1Ecm9wRG93bkhlaWdodCA9PSBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLldSQVBfQ09OVEVOVCkgewotICAgICAgICAgICAgICAgICAgICBtUG9wdXAuc2V0SGVpZ2h0KGhlaWdodCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgbVBvcHVwLnNldEhlaWdodChtRHJvcERvd25IZWlnaHQpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbVBvcHVwLnNldFdpbmRvd0xheW91dE1vZGUod2lkdGhTcGVjLCBoZWlnaHRTcGVjKTsKLSAgICAgICAgICAgIG1Qb3B1cC5zZXRJbnB1dE1ldGhvZE1vZGUoUG9wdXBXaW5kb3cuSU5QVVRfTUVUSE9EX05FRURFRCk7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIC8vIHVzZSBvdXRzaWRlIHRvdWNoYWJsZSB0byBkaXNtaXNzIGRyb3AgZG93biB3aGVuIHRvdWNoaW5nIG91dHNpZGUgb2YgaXQsIHNvCi0gICAgICAgICAgICAvLyBvbmx5IHNldCB0aGlzIGlmIHRoZSBkcm9wZG93biBpcyBub3QgYWx3YXlzIHZpc2libGUKLSAgICAgICAgICAgIG1Qb3B1cC5zZXRPdXRzaWRlVG91Y2hhYmxlKCFtRm9yY2VJZ25vcmVPdXRzaWRlVG91Y2ggJiYgIW1Ecm9wRG93bkFsd2F5c1Zpc2libGUpOwotICAgICAgICAgICAgbVBvcHVwLnNldFRvdWNoSW50ZXJjZXB0b3IobmV3IFBvcHVwVG91Y2hJbnRlcmNlcHRvcigpKTsKLSAgICAgICAgICAgIG1Qb3B1cC5zaG93QXNEcm9wRG93bihnZXREcm9wRG93bkFuY2hvclZpZXcoKSwKLSAgICAgICAgICAgICAgICAgICAgbURyb3BEb3duSG9yaXpvbnRhbE9mZnNldCwgbURyb3BEb3duVmVydGljYWxPZmZzZXQpOwotICAgICAgICAgICAgbURyb3BEb3duTGlzdC5zZXRTZWxlY3Rpb24oTGlzdFZpZXcuSU5WQUxJRF9QT1NJVElPTik7Ci0gICAgICAgICAgICBjbGVhckxpc3RTZWxlY3Rpb24oKTsKLSAgICAgICAgICAgIHBvc3QobUhpZGVTZWxlY3Rvcik7CiAgICAgICAgIH0KKyAgICAgIC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nB1dE1ldGhvZE1hbmFnZXIucGVla0luc3RhbmNlKCk7CkBAIC0xMjYwLDEzNSArMTA1OSw2IEBACiAgICAgICAgICAgICAgICAgaW1tLmRpc3BsYXlDb21wbGV0aW9ucyh0aGlzLCBjb21wbGV0aW9ucyk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KLQotICAgICAgICBpZiAobURyb3BEb3duTGlzdCA9PSBudWxsKSB7Ci0gICAgICAgICAgICBDb250ZXh0IGNvbnRleHQgPSBnZXRDb250ZXh0KCk7Ci0KLSAgICAgICAgICAgIG1IaWRlU2VsZWN0b3IgPSBuZXcgTGlzdFNlbGVjdG9ySGlkZXIoKTsKLQotICAgICAgICAgICAgLyoqCi0gICAgICAgICAgICAgKiBUaGlzIFJ1bm5hYmxlIGV4aXN0cyBmb3IgdGhlIHNvbGUgcHVycG9zZSBvZiBjaGVja2luZyBpZiB0aGUgdmlldyBsYXlvdXQgaGFzIGdvdAotICAgICAgICAgICAgICogY29tcGxldGVkIGFuZCBpZiBzbyBjYWxsIHNob3dEcm9wRG93biB0byBkaXNwbGF5IHRoZSBkcm9wIGRvd24uIFRoaXMgaXMgdXNlZCB0byBzaG93Ci0gICAgICAgICAgICAgKiB0aGUgZHJvcCBkb3duIGFzIHNvb24gYXMgcG9zc2libGUgYWZ0ZXIgdXNlciBvcGVucyB1cCB0aGUgc2VhcmNoIGRpYWxvZywgd2l0aG91dAotICAgICAgICAgICAgICogd2FpdGluZyBmb3IgdGhlIG5vcm1hbCBVSSBwaXBlbGluZSB0byBkbyBpdCdzIGpvYiB3aGljaCBpcyBzbG93ZXIgdGhhbiB0aGlzIG1ldGhvZC4KLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgbVNob3dEcm9wRG93blJ1bm5hYmxlID0gbmV3IFJ1bm5hYmxlKCkgewotICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gVmlldyBsYXlvdXQgc2hvdWxkIGJlIGFsbCBkb25lIGJlZm9yZSBkaXNwbGF5aW5nIHRoZSBkcm9wIGRvd24uCi0gICAgICAgICAgICAgICAgICAgIFZpZXcgdmlldyA9IGdldERyb3BEb3duQW5jaG9yVmlldygpOwotICAgICAgICAgICAgICAgICAgICBpZiAodmlldyAhPSBudWxsICYmIHZpZXcuZ2V0V2luZG93VG9rZW4oKSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzaG93RHJvcERvd24oKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH07Ci0KLSAgICAgICAgICAgIG1Ecm9wRG93bkxpc3QgPSBuZXcgRHJvcERvd25MaXN0Vmlldyhjb250ZXh0KTsKLSAgICAgICAgICAgIG1Ecm9wRG93bkxpc3Quc2V0U2VsZWN0b3IobURyb3BEb3duTGlzdEhpZ2hsaWdodCk7Ci0gICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldEFkYXB0ZXIoYWRhcHRlcik7Ci0gICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldFZlcnRpY2FsRmFkaW5nRWRnZUVuYWJsZWQodHJ1ZSk7Ci0gICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldE9uSXRlbUNsaWNrTGlzdGVuZXIobURyb3BEb3duSXRlbUNsaWNrTGlzdGVuZXIpOwotICAgICAgICAgICAgbURyb3BEb3duTGlzdC5zZXRGb2N1c2FibGUodHJ1ZSk7Ci0gICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldEZvY3VzYWJsZUluVG91Y2hNb2RlKHRydWUpOwotICAgICAgICAgICAgbURyb3BEb3duTGlzdC5zZXRPbkl0ZW1TZWxlY3RlZExpc3RlbmVyKG5ldyBBZGFwdGVyVmlldy5Pbkl0ZW1TZWxlY3RlZExpc3RlbmVyKCkgewotICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uSXRlbVNlbGVjdGVkKEFkYXB0ZXJWaWV3PD8+IHBhcmVudCwgVmlldyB2aWV3LAotICAgICAgICAgICAgICAgICAgICAgICAgaW50IHBvc2l0aW9uLCBsb25nIGlkKSB7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHBvc2l0aW9uICE9IC0xKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBEcm9wRG93bkxpc3RWaWV3IGRyb3BEb3duTGlzdCA9IG1Ecm9wRG93bkxpc3Q7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkcm9wRG93bkxpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyb3BEb3duTGlzdC5tTGlzdFNlbGVjdGlvbkhpZGRlbiA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25Ob3RoaW5nU2VsZWN0ZWQoQWRhcHRlclZpZXc8Pz4gcGFyZW50KSB7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSk7Ci0gICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldE9uU2Nyb2xsTGlzdGVuZXIobmV3IFBvcHVwU2Nyb2xsTGlzdGVuZXIoKSk7Ci0KLSAgICAgICAgICAgIGlmIChtSXRlbVNlbGVjdGVkTGlzdGVuZXIgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIG1Ecm9wRG93bkxpc3Quc2V0T25JdGVtU2VsZWN0ZWRMaXN0ZW5lcihtSXRlbVNlbGVjdGVkTGlzdGVuZXIpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBkcm9wRG93blZpZXcgPSBtRHJvcERvd25MaXN0OwotCi0gICAgICAgICAgICBWaWV3IGhpbnRWaWV3ID0gZ2V0SGludFZpZXcoY29udGV4dCk7Ci0gICAgICAgICAgICBpZiAoaGludFZpZXcgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIC8vIGlmIGFuIGhpbnQgaGFzIGJlZW4gc3BlY2lmaWVkLCB3ZSBhY2NvbW9kYXRlIG1vcmUgc3BhY2UgZm9yIGl0IGFuZAotICAgICAgICAgICAgICAgIC8vIGFkZCBhIHRleHQgdmlldyBpbiB0aGUgZHJvcCBkb3duIG1lbnUsIGF0IHRoZSBib3R0b20gb2YgdGhlIGxpc3QKLSAgICAgICAgICAgICAgICBMaW5lYXJMYXlvdXQgaGludENvbnRhaW5lciA9IG5ldyBMaW5lYXJMYXlvdXQoY29udGV4dCk7Ci0gICAgICAgICAgICAgICAgaGludENvbnRhaW5lci5zZXRPcmllbnRhdGlvbihMaW5lYXJMYXlvdXQuVkVSVElDQUwpOwotCi0gICAgICAgICAgICAgICAgTGluZWFyTGF5b3V0LkxheW91dFBhcmFtcyBoaW50UGFyYW1zID0gbmV3IExpbmVhckxheW91dC5MYXlvdXRQYXJhbXMoCi0gICAgICAgICAgICAgICAgICAgICAgICBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCwgMCwgMS4wZgotICAgICAgICAgICAgICAgICk7Ci0gICAgICAgICAgICAgICAgaGludENvbnRhaW5lci5hZGRWaWV3KGRyb3BEb3duVmlldywgaGludFBhcmFtcyk7Ci0gICAgICAgICAgICAgICAgaGludENvbnRhaW5lci5hZGRWaWV3KGhpbnRWaWV3KTsKLQotICAgICAgICAgICAgICAgIC8vIG1lYXN1cmUgdGhlIGhpbnQncyBoZWlnaHQgdG8gZmluZCBob3cgbXVjaCBtb3JlIHZlcnRpY2FsIHNwYWNlCi0gICAgICAgICAgICAgICAgLy8gd2UgbmVlZCB0byBhZGQgdG8gdGhlIGRyb3AgZG93bidzIGhlaWdodAotICAgICAgICAgICAgICAgIGludCB3aWR0aFNwZWMgPSBNZWFzdXJlU3BlYy5tYWtlTWVhc3VyZVNwZWMoZ2V0V2lkdGgoKSwgTWVhc3VyZVNwZWMuQVRfTU9TVCk7Ci0gICAgICAgICAgICAgICAgaW50IGhlaWdodFNwZWMgPSBNZWFzdXJlU3BlYy5VTlNQRUNJRklFRDsKLSAgICAgICAgICAgICAgICBoaW50Vmlldy5tZWFzdXJlKHdpZHRoU3BlYywgaGVpZ2h0U3BlYyk7Ci0KLSAgICAgICAgICAgICAgICBoaW50UGFyYW1zID0gKExpbmVhckxheW91dC5MYXlvdXRQYXJhbXMpIGhpbnRWaWV3LmdldExheW91dFBhcmFtcygpOwotICAgICAgICAgICAgICAgIG90aGVySGVpZ2h0cyA9IGhpbnRWaWV3LmdldE1lYXN1cmVkSGVpZ2h0KCkgKyBoaW50UGFyYW1zLnRvcE1hcmdpbgotICAgICAgICAgICAgICAgICAgICAgICAgKyBoaW50UGFyYW1zLmJvdHRvbU1hcmdpbjsKLQotICAgICAgICAgICAgICAgIGRyb3BEb3duVmlldyA9IGhpbnRDb250YWluZXI7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1Qb3B1cC5zZXRDb250ZW50Vmlldyhkcm9wRG93blZpZXcpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgZHJvcERvd25WaWV3ID0gKFZpZXdHcm91cCkgbVBvcHVwLmdldENvbnRlbnRWaWV3KCk7Ci0gICAgICAgICAgICBmaW5hbCBWaWV3IHZpZXcgPSBkcm9wRG93blZpZXcuZmluZFZpZXdCeUlkKEhJTlRfVklFV19JRCk7Ci0gICAgICAgICAgICBpZiAodmlldyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgTGluZWFyTGF5b3V0LkxheW91dFBhcmFtcyBoaW50UGFyYW1zID0KLSAgICAgICAgICAgICAgICAgICAgICAgIChMaW5lYXJMYXlvdXQuTGF5b3V0UGFyYW1zKSB2aWV3LmdldExheW91dFBhcmFtcygpOwotICAgICAgICAgICAgICAgIG90aGVySGVpZ2h0cyA9IHZpZXcuZ2V0TWVhc3VyZWRIZWlnaHQoKSArIGhpbnRQYXJhbXMudG9wTWFyZ2luCi0gICAgICAgICAgICAgICAgICAgICAgICArI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KEhJTlRfVklFV19JRCk7Ci0gICAgICAgICAgICByZXR1cm4gaGludFZpZXc7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICByZXR1cm4gbnVsbDsKLSAgICAgICAgfQogICAgIH0KIAogICAgIC8qKgpAQCAtMTQ0MCw0NyArMTExMCw2IEBACiAgICAgICAgIHJldHVybiBtRmlsdGVyOwogICAgIH0KIAotICAgIHByaXZhdGUgY2xhc3MgTGlzdFNlbGVjdG9ySGlkZXIgaW1wbGVtZW50cyBSdW5uYWJsZSB7Ci0gICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKLSAgICAgICAgICAgIGNsZWFyTGlzdFNlbGVjdGlvbigpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcHJpdmF0ZSBjbGFzcyBSZXNpemVQb3B1cFJ1bm5hYmxlIGltcGxlbWVudHMgUnVubmFibGUgewotICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7Ci0gICAgICAgICAgICBtUG9wdXAuc2V0SW5wdXRNZXRob2RNb2RlKFBvcHVwV2luZG93LklOUFVUX01FVEhPRF9OT1RfTkVFREVEKTsKLSAgICAgICAgICAgIHNob3dEcm9wRG93bigpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcHJpdmF0ZSBjbGFzcyBQb3B1cFRvdWNoSW50ZXJjZXB0b3IgaW1wbGVtZW50cyBPblRvdWNoTGlzdGVuZXIgewotICAgICAgICBwdWJsaWMgYm9vbGVhbiBvblRvdWNoKFZpZXcgdiwgTW90aW9uRXZlbnQgZXZlbnQpIHsKLSAgICAgICAgICAgIGZpbmFsIGludCBhY3Rpb24gPSBldmVudC5nZXRBY3Rpb24oKTsKLSAgICAgICAgICAgIGlmIChhY3Rpb24gPT0gTW90aW9uRXZlbnQuQUNUSU9OX0RPV04gJiYKLSAgICAgICAgICAgICAgICAgICAgbVBvcHVwICE9IG51bGwgJiYgbVBvcHVwLmlzU2hvd2luZygpKSB7Ci0gICAgICAgICAgICAgICA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RG93bkxpc3RWaWV3U3R5bGUpOwotICAgICAgICB9Ci0KLSAgICAgICAgLyoqCi0gICAgICAgICAqIDxwPkF2b2lkcyBqYXJyaW5nIHNjcm9sbGluZyBlZmZlY3QgYnkgZW5zdXJpbmcgdGhhdCBsaXN0IGVsZW1lbnRzCi0gICAgICAgICAqIG1hZGUgb2YgYSB0ZXh0IHZpZXcgZml0IG9uIGEgc2luZ2xlIGxpbmUuPC9wPgotICAgICAgICAgKgotICAgICAgICAgKiBAcGFyYW0gcG9zaXRpb24gdGhlIGl0ZW0gaW5kZXggaW4gdGhlIGxpc3QgdG8gZ2V0IGEgdmlldyBmb3IKLSAgICAgICAgICogQHJldHVybiB0aGUgdmlldyBmb3IgdGhlIHNwZWNpZmllZCBpdGVtCi0gICAgICAgICAqLwotICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgVmlldyBvYnRhaW5WaWV3KGludCBwb3NpdGlvbiwgYm9vbGVhbltdIGlzU2NyYXApIHsKLSAgICAgICAgICAgIFZpZXcgdmlldyA9IHN1cGVyLm9idGFpblZpZXcocG9zaXRpb24sIGlzU2NyYXApOwotCi0gICAgICAgICAgICBpZiAodmlldyBpbnN0YW5jZW9mIFRleHRWaWV3KSB7Ci0gICAgICAgICAgICAgICAgKChUZXh0Vmlldykgdmlldykuc2V0SG9yaXpvbnRhbGx5U2Nyb2xsaW5nKHRydWUpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm4gdmlldzsKLSAgICAgICAgfQotCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgYm9vbGVhbiBpc0luVG91Y2hNb2RlKCkgewotICAgICAgICAgICAgLy8gV0FSTklORzogUGxlYXNlIHJlYWQgdGhlIGNvbW1lbnQgd2hlcmUgbUxpc3RTZWxlY3Rpb25IaWRkZW4gaXMgZGVjbGFyZWQKLSAgICAgICAgICAgIHJldHVybiBtTGlzdFNlbGVjdGlvbkhpZGRlbiB8fCBzdXBlci5pc0luVG91Y2hNb2RlKCk7Ci0gICAgICAgIH0KLQotICAgICAgICAvKioKLSAgICAgICAgICogPHA+UmV0dXJucyB0aGUgZm9jdXMgc3RhdGUgaW4gdGhlIGRyb3AgZG93bi48L3A+Ci0gICAgICAgICAqCi0gICAgICAgICAqIEByZXR1cm4gdHJ1ZSBhbHdheXMKLSAgICAgICAgICovCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgYm9vbGVhbiBoYXNXaW5kb3dGb2N1cygpIHsKLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9Ci0KLSAgICAgICAgLyoqCi0gICAgICAgICAqIDxwPlJldHVybnMgdGhlIGZvY3VzIHN0YXRlIGluIHRoZSBkcm9wIGRvd24uPC9wPgotICAgICAgICAgKgotICAgICAgICAgKiBAcmV0dXJuIHRydWUgYWx3YXlzCi0gICAgICAgICAqLwotICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgcHVibGljIGJvb2xlYW4gaXNGb2N1c2VkKCkgewotICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgIH0KLQotICAgICAgICAvKioKLSAgICAgICAgICogPHA+UmV0dXJucyB0aGUgZm9jdXMgc3RhdGUgaW4gdGhlIGRyb3AgZG93bi48L3A+Ci0gICAgICAgICAqCi0gICAgICAgICAqIEByZXR1cm4gdHJ1ZSBhbHdheXMKLSAgICAgICAgICovCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgYm9vbGVhbiBoYXNGb2N1cygpIHsKLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICBwcm90ZWN0ZWQgaW50W10gb25DcmVhdGVEcmF3YWJsZVN0YXRlKGludCBleHRyYVNwYWNlKSB7Ci0gICAgICAgICAgICBpbnRbXSByZXMgPSBzdXBlci5vbkNyZWF0ZURyYXdhYmxlU3RhdGUoZXh0cmFTcGFjZSk7Ci0gICAgICAgICAgICAvL25vaW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0T2JzZXJ2ZXIgZXh0ZW5kcyBEYXRhU2V0T2JzZXJ2ZXIgewogICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgcHVibGljIHZvaWQgb25DaGFuZ2VkKCkgewotICAgICAgICAgICAgaWYgKGlzUG9wdXBTaG93aW5nKCkpIHsKLSAgICAgICAgICAgICAgICAvLyBUaGlzIHdpbGwgcmVzaXplIHRoZSBwb3B1cCB0byBmaXQgdGhlIG5ldyBhZGFwdGVyJ3MgY29udGVudAotICAgICAgICAgICAgICAgIHNob3dEcm9wRG93bigpOwotICAgICAgICAgICAgfSBlbHNlIGlmIChtQWRhcHRlciAhPSBudWxsKSB7CisgICAgICAgICAgICBpZiAobUFkYXB0ZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIC8vIElmIHRoZSBwb3B1cCBpcyBub3Qgc2hvd2luZyBhbHJlYWR5LCBzaG93aW5nIGl0IHdpbGwgY2F1c2UKICAgICAgICAgICAgICAgICAvLyB0aGUgbGlzdCBvZiBkYXRhIHNldCBvYnNlcnZlcnMgYXR0YWNoZWQgdG8gdGhlIGFkYXB0ZXIgdG8KICAgICAgICAgICAgICAgICAvLyBjaGFuZ2UuIFdlIGNhbid0IGRvIGl0IGZyb20gaGVyZSwgYmVjYXVzZSB3ZSBhcmUgaW4gdGhlIG1pZGRsZQpAQCAtMTY3MCwxNCArMTE3OSw1IEBACiAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KLQotICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgcHVibGljIHZvaWQgb25JbnZhbGlkYXRlZCgpIHsKLSAgICAgICAgICAgIGlmICghbURyb3BEb3duQWx3YXlzVmlzaWJsZSkgewotICAgICAgICAgICAgICAgIC8vIFRoZXJlJ3Mgbm8gZGF0YSB0byBkaXNwbGF5IHNvIG1ha2Ugc3VyZSB3ZSdyZSBub3Qgc2hvd2luZwotICAgICAgICAgICAgICAgIC8vIHRoZSBkcm9wIGRvd24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hbmRyb2lkLnZpZXcuVmlld0dyb3VwOwogaW1wb3J0IGFuZHJvaWQudmlldy5Tb3VuZEVmZmVjdENvbnN0YW50czsKIGltcG9ydCBhbmRyb2lkLnZpZXcuYW5pbWF0aW9uLkdyaWRMYXlvdXRBbmltYXRpb25Db250cm9sbGVyOwpAQCAtMTEyLDcgKzExMyw3IEBACiAgICAgICovCiAgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIHZvaWQgc2V0QWRhcHRlcihMaXN0QWRhcHRlciBhZGFwdGVyKSB7Ci0gICAgICAgIGlmIChudWxsICE9IG1BZGFwdGVyKSB7CisgICAgICAgIGlmIChtQWRhcHRlciAhPSBudWxsICYmIG1EYXRhU2V0T2JzZXJ2ZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgbUFkYXB0ZXIudW5yZWdpc3RlckRhdGFTZXRPYnNlcnZlcihtRGF0YVNldE9ic2VydmVyKTsKICAgICAgICAgfQogCkBAIC0xNzc0LDYgKzE3NzUsMTkgQEAKICAgICAgICAgICAgIHJlcXVlc3RMYXlvdXRJZk5lY2Vzc2FyeSgpOwogICAgICAgICB9CiAgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIEdldCB0aGUgbnVtYmVyIG9mIGNvbHVtbnMgaW4gdGhlIGdyaWQuIAorICAgICAqIFJldHVybnMge0BsaW5rICNBVVRPX0ZJVH0gaWYgdGhlIEdyaWQgaGFzIG5ldmVyIGJlZW4gbGFpZCBvdXQuCisgICAgICoKKyAgICAgKiBAYXR0ciByZWYgYW5kcm9pZC5SLnN0eWxlYWJsZSNHcmlkVmlld19udW1Db2x1bW5zCisgICAgICogCisgICAgICogQHNlZSAjc2V0TnVtQ29sdW1ucyhpbnQpCisgICAgICovCisgICAgQFZpZXdEZWJ1Zy5FeHBvcnRlZFByb3BlcnR5CisgICAgcHVibGljIGludCBnZXROdW1Db2x1bW5zKCkgeyAgCisgICAgICAgIHJldHVybiBtTnVtQ29sdW1uczsKKyAgICB9CiAKICAgICAvKioK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KENvbnRleHQgY29udGV4dCkgeworICAgICAgICB0aGlzKGNvbnRleHQsIG51bGwsIDAsIDApOworICAgIH0KKworICAgIC8qKgorICAgICAqIENyZWF0ZSBhIG5ldywgZW1wdHkgcG9wdXAgd2luZG93IGNhcGFibGUgb2YgZGlzcGxheWluZyBpdGVtcyBmcm9tIGEgTGlzdEFkYXB0ZXIuCisgICAgICogQmFja2dyb3VuZHMgc2hvdWxkIGJlIHNldCB1c2luZyB7QGxpbmsgI3NldEJhY2tncm91bmREcmF3YWJsZShEcmF3YWJsZSl9LgorICAgICAqIAorICAgICAqIEBwYXJhbSBjb250ZXh0IENvbnRleHQgdXNlZCBmb3IgY29udGFpbmVkIHZpZXdzLgorICAgICAqIEBwYXJhbSBhdHRycyBBdHRyaWJ1dGVzIGZyb20gaW5mbGF0aW5nIHBhcmVudCB2aWV3cyB1c2VkIHRvIHN0eWxlIHRoZSBwb3B1cC4KKyAgICAgKi8KKyAgICBwdWJsaWMgTGlzdFBvcHVwV2luZG93KENvbnRleHQgY29udGV4dCwgQXR0cmlidXRlU2V0IGF0dHJzKSB7CisgICAgICAgIHRoaXMoY29udGV4dCwgYXR0cnMsIDAsIDApOworICAgIH0KKworICAgIC8qKgorICAgICAqIENyZWF0ZSBhIG5ldywgZW1wdHkgcG9wdXAgd2luZG93IGNhcGFibGUgb2YgZGlzcGxheWluZyBpdGVtcyBmcm9tIGEgTGlzdEFkYXB0ZXIuCisgICAgICogQmFja2dyb3VuZHMgc2hvdWxkIGJlIHNldCB1c2luZyB7QGxpbmsgI3NldEJhY2tncm91bmREcmF3YWJsZShEcmF3YWJsZSl9LgorICAgICAqIAorICAgICAqIEBwYXJhbSBjb250ZXh0IENvbnRleHQgdXNlZCBmb3IgY29udGFpbmVkIHZpZXdzLgorICAgICAqIEBwYXJhbSBhdHRycyBBdHRyaWJ1dGVzIGZyb20gaW5mbGF0aW5nIHBhcmVudCB2aWV3cyB1c2VkIHRvIHN0eWxlIHRoZSBwb3B1cC4KKyA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IsIGludCBkZWZTdHlsZVJlcykgeworICAgICAgICBtQ29udGV4dCA9IGNvbnRleHQ7CisgICAgICAgIG1Qb3B1cCA9IG5ldyBQb3B1cFdpbmRvdyhjb250ZXh0LCBhdHRycywgZGVmU3R5bGVBdHRyLCBkZWZTdHlsZVJlcyk7CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0cyB0aGUgYWRhcHRlciB0aGF0IHByb3ZpZGVzIHRoZSBkYXRhIGFuZCB0aGUgdmlld3MgdG8gcmVwcmVzZW50IHRoZSBkYXRhCisgICAgICogaW4gdGhpcyBwb3B1cCB3aW5kb3cuCisgICAgICoKKyAgICAgKiBAcGFyYW0gYWRhcHRlciBUaGUgYWRhcHRlciB0byB1c2UgdG8gY3JlYXRlIHRoaXMgd2luZG93J3MgY29udGVudC4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRBZGFwdGVyKExpc3RBZGFwdGVyIGFkYXB0ZXIpIHsKKyAgICAgICAgaWYgKG1PYnNlcnZlciA9PSBudWxsKSB7CisgICAgICAgICAgICBtT2JzZXJ2ZXIgPSBuZXcgUG9wdXBEYXRhU2V0T2JzZXJ2ZXIoKTsKKyAgICAgICAgfSBlbHNlIGlmIChtQWRhcHRlciAhPSBudWxsKSB7CisgICAgICAgICAgICBtQWRhcHRlci51bnJlZ2lzdGVyRGF0YVNldE9ic2VydmVyKG1PYnNlcnZlcik7CisgICAgICAgIH0KKyAgICAgICAgbUFkYXB0ZXIgPSBhZGFwdGVyOworICAgICAgICBpZiAobUFkYXB0ZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgYWRhcHRlci5yZWdpc3RlckRhdGFTZXRPYnNlcnZlcihtT2JzZXJ2ZXIpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAobURyb3BEb3duTGlzdCAhPSBudWxsKSB7CisgICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldEFkYXB0ZXIobUFkYXB0ZXIpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0IHdoZXJlIHRoZSBvcHRpb25hbCBwcm9tcHQgdmlldyBzaG91bGQgYXBwZWFyLiBUaGUgZGVmYXVsdCBpcworICAgICAqIHtAbGluayAjUE9TSVRJT05fUFJPTVBUX0FCT1ZFfS4KKyAgICAgKiAKKyAgICAgKiBAcGFyYW0gcG9zaXRpb24gQSBwb3NpdGlvbiBjb25zdGFudCBkZWNsYXJpbmcgd2hlcmUgdGhlIHByb21wdCBzaG91bGQgYmUgZGlzcGxheWVkLgorICAgICAqIAorICAgICAqIEBzZWUgI1BPU0lUSU9OX1BST01QVF9BQk9WRQorICAgICAqIEBzZWUgI1BPU0lUSU9OX1BST01QVF9CRUxPVworICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldFByb21wdFBvc2l0aW9uKGludCBwb3NpdGlvbikgeworICAgICAgICBtUHJvbXB0UG9zaXRpb24gPSBwb3NpdGlvbjsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAcmV0dXJuIFdoZXJlIHRoZSBvcHRpb25hbCBwcm9tcHQgdmlldyBzaG91bGQgYXBwZWFyLgorICAgICAqIAorICAgICAqIEBzZWUgI1BPU0lUSU9OX1BST01QVF9BQk9WRQorICAgICAqIEBzZWUgI1BPU0lUSU9OX1BST01QVF9CRUxPVworICAgICAqLworICAgIHB1YmxpYyBpbnQgZ2V0UHJvbXB0UG9zaXRpb24oKSB7CisgICAgICAgIHJldHVybiBtUHJvbXB0UG9zaXRpb247CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0IHdoZXRoZXIgdGhpcyB3aW5kb3cgc2hvdWxkIGJlIG1vZGFsIHdoZW4gc2hvd24uCisgICAgICogCisgICAgICogPHA+SWYgYSBwb3B1cCB3aW5kb3cgaXMgbW9kYWwsIGl0IHdpbGwgcmVjZWl2ZSBhbGwgdG91Y2ggYW5kIGtleSBpbnB1dC4KKyAgICAgKiBJZiB0aGUgdXNlciB0b3VjaGVzIG91dHNpZGUgdGhlIHBvcHVw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heXNWaXNpYmxlID0gZHJvcERvd25BbHdheXNWaXNpYmxlOworICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gV2hldGhlciB0aGUgZHJvcC1kb3duIGlzIHZpc2libGUgdW5kZXIgc3BlY2lhbCBjb25kaXRpb25zLgorICAgICAqCisgICAgICogQGhpZGUgT25seSB1c2VkIGJ5IEF1dG9Db21wbGV0ZVRleHRWaWV3IHVuZGVyIHNwZWNpYWwgY29uZGl0aW9ucy4KKyAgICAgKi8KKyAgICBwdWJsaWMgYm9vbGVhbiBpc0Ryb3BEb3duQWx3YXlzVmlzaWJsZSgpIHsKKyAgICAgICAgcmV0dXJuIG1Ecm9wRG93bkFsd2F5c1Zpc2libGU7CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0cyB0aGUgb3BlcmF0aW5nIG1vZGUgZm9yIHRoZSBzb2Z0IGlucHV0IGFyZWEuCisgICAgICoKKyAgICAgKiBAcGFyYW0gbW9kZSBUaGUgZGVzaXJlZCBtb2RlLCBzZWUKKyAgICAgKiAgICAgICAge0BsaW5rIGFuZHJvaWQudmlldy5XaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcyNzb2Z0SW5wdXRNb2RlfQorICAgICAqICAgICAgICBmb3IgdGhlIGZ1bGwgbGlzdAorICAgICAqCisgICAgICogQHNlZSBhbmRyb2lkLnZpZXcuV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMjc29mdElucHV0TW9kZQorICAgICAqIEBzZWUgI2dldFNvZnRJbnB1dE1vZGUoKQorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldFNvZnRJbnB1dE1vZGUoaW50IG1vZGUpIHsKKyAgICAgICAgbVBvcHVwLnNldFNvZnRJbnB1dE1vZGUobW9kZSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgY3VycmVudCB2YWx1ZSBpbiB7QGxpbmsgI3NldFNvZnRJbnB1dE1vZGUoaW50KX0uCisgICAgICoKKyAgICAgKi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0QmFja2dyb3VuZERyYXdhYmxlKGQpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldCBhbiBhbmltYXRpb24gc3R5bGUgdG8gdXNlIHdoZW4gdGhlIHBvcHVwIHdpbmRvdyBpcyBzaG93biBvciBkaXNtaXNzZWQuCisgICAgICogCisgICAgICogQHBhcmFtIGFuaW1hdGlvblN0eWxlIEFuaW1hdGlvbiBzdHlsZSB0byB1c2UuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0QW5pbWF0aW9uU3R5bGUoaW50IGFuaW1hdGlvblN0eWxlKSB7CisgICAgICAgIG1Qb3B1cC5zZXRBbmltYXRpb25TdHlsZShhbmltYXRpb25TdHlsZSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgYW5pbWF0aW9uIHN0eWxlIHRoYXQgd2lsbCBiZSB1c2VkIHdoZW4gdGhlIHBvcHVwIHdpbmRvdyBpcworICAgICAqIHNob3duIG9yIGRpc21pc3NlZC4KKyAgICAgKiAKKyAgICAgKiBAcmV0dXJuIEFuaW1hdGlvbiBzdHlsZSB0aGF0IHdpbGwgYmUgdXNlZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGdldEFuaW1hdGlvblN0eWxlKCkgeworICAgICAgICByZXR1cm4gbVBvcHVwLmdldEFuaW1hdGlvblN0eWxlKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgdmlldyB0aGF0IHdpbGwgYmUgdXNlZCB0byBhbmNob3IgdGhpcyBwb3B1cC4KKyAgICAgKiAKKyAgICAgKiBAcmV0dXJuIFRoZSBwb3B1cCdzIGFuY2hvciB2aWV3CisgICAgICovCisgICAgcHVibGljIFZpZXcgZ2V0QW5jaG9yVmlldygpIHsKKyAgICAgICAgcmV0dXJuIG1Ecm9wRG93bkFuY2hvclZpZXc7CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0cyB0aGUgcG9wdXAncyBhbmNob3Igdmlldy4gVGhpcyBwb3B1cCB3aWxsIGFsd2F5cyBiZSBwb3NpdGlvbmVkIHJlbGF0aXZlIHRvCisgICAgICogdGhlIGFuY2hvciB2aWV3IHdoZW4gc2hvd24uCisgICAgICogCisgICAgICogQHBhcmFtIGFuY2hvciBUaGUgdmlldyB0byB1c2UgYXMgYW4gYW5jaG9yLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldEFuY2hvclZpZXcoVmlldyBhbmNob3IpIHsKKyAgICAgICAgbURyb3BEb3duQW5jaG9yVmlldyA9IGFuY2hvcjsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAcmV0dXJuIFRoZSBob3Jpem9udGFsIG9mZnNldCBvZiB0aGUgcG9wdXAgZnJvbSBpdHMgYW5jaG9yIGluIHBpeGVscy4KKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGdldEhvcml6b250YWxPZmZzZXQoKSB7CisgICAgICAgIHJldHVybiBtRHJvcERvd25Ib3Jpem9udGFsT2Zmc2V0OworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldCB0aGUgaG9yaXpvbnRhbCBvZmZzZXQgb2YgdGhpcyBwb3B1cCBmcm9tIGl0cyBhbmNob3IgdmlldyBpbiBwaXhlbHMuCisgICAgICogCisgICAgICogQHBhcmFtIG9mZnNldCBUaGUgaG9yaXpvbnRhbCBvZmZzZXQgb2YgdGhlIHBvcHVwIGZyb20gaXRzIGFuY2hvci4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRIb3Jpem9udGFsT2Zmc2V0KGludCBvZmZzZXQpIHsKKyAgICAgICAgbURyb3BEb3duSG9yaXpvbnRhbE9mZnNldCA9IG9mZnNldDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAcmV0dXJuIFRoZSB2ZXJ0aWNhbCBvZmZzZXQgb2YgdGhlIHBvcHVwIGZyb20gaXRzIGFuY2hvciBpbiBwaXhlbHMuCisgICAgICovCisgICAgcHVibGljIGludCBnZXRWZXJ0aWNhbE9mZnNldCgpIHsKKyAgICAgICAgcmV0dXJuIG1Ecm9wRG93blZlcnRpY2FsT2Zmc2V0OworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldCB0aGUgdmVydGljYWwgb2Zmc2V0IG9mIHRoaXMgcG9wdXAgZnJvbSBpdHMgYW5jaG9yIHZpZXcgaW4gcGl4ZWxzLgorICAgICAqIAorICAgICAqIEBwYXJhbSBvZmZzZXQgVGhlIHZlcnRpY2FsIG9mZnNldCBvZiB0aGUgcG9wdXAgZnJvbSBpdHMgYW5jaG9yLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldFZlcnRpY2FsT2Zmc2V0KGludCBvZmZzZXQpIHsKKyAgICAgICAgbURyb3BEb3duVmVydGljYWxPZmZzZXQgPSBvZmZzZXQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiBUaGUgd2lkdGggb2YgdGhlIHBvcHVwIHdpbmRvdyBpbiBwaXhlbHMuCisgICAgICovCisgICAgcHVibGljIGludCBnZXRXaWR0aCgpIHsKKyAgICAgICAgcmV0dXJuIG1Ecm9wRG93bldpZHRoOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldHMgdGhlIHdpZHRoIG9mIHRoZSBwb3B1cCB3aW5kb3cgaW4gcGl4ZWxzLiBDYW4gYWxzbyBiZSB7QGxpbmsgI01BVENIX1BBUkVOVH0KKyAgICAgKiBvciB7QGxpbmsgI1dSQVBfQ09OVEVOVH0uCisgICAgICogCisgICAgICogQHBhcmFtIHdpZHRoIFdpZHRoIG9mIHRoZSBwb3B1cCB3aW5kb3cuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0V2lkdGgoaW50IHdpZHRoKSB7CisgICAgICAgIG1Ecm9wRG93bldpZHRoID0gd2lkdGg7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiBUaGUgaGVpZ2h0IG9mIHRoZSBwb3B1cCB3aW5kb3cgaW4gcGl4ZWxzLgorICAgICAqLworICAgIHB1YmxpYyBpbnQgZ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VhZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBwb3N0U2hvdygpIHsKKyAgICAgICAgbUhhbmRsZXIucG9zdChtU2hvd0Ryb3BEb3duUnVubmFibGUpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNob3cgdGhlIHBvcHVwIGxpc3QuIElmIHRoZSBsaXN0IGlzIGFscmVhZHkgc2hvd2luZywgdGhpcyBtZXRob2QKKyAgICAgKiB3aWxsIHJlY2FsY3VsYXRlIHRoZSBwb3B1cCdzIHNpemUgYW5kIHBvc2l0aW9uLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNob3coKSB7CisgICAgICAgIGludCBoZWlnaHQgPSBidWlsZERyb3BEb3duKCk7CisKKyAgICAgICAgaW50IHdpZHRoU3BlYyA9IDA7CisgICAgICAgIGludCBoZWlnaHRTcGVjID0gMDsKKworICAgICAgICBib29sZWFuIG5vSW5wdXRNZXRob2QgPSBpc0lucHV0TWV0aG9kTm90TmVlZGVkKCk7CisKKyAgICAgICAgaWYgKG1Qb3B1cC5pc1Nob3dpbmcoKSkgeworICAgICAgICAgICAgaWYgKG1Ecm9wRG93bldpZHRoID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UKSB7CisgICAgICAgICAgICAgICAgLy8gVGhlIGNhbGwgdG8gUG9wdXBXaW5kb3cncyB1cGRhdGUgbWV0aG9kIGJlbG93IGNhbiBhY2NlcHQgLTEgZm9yIGFueQorICAgICAgICAgICAgICAgIC8vIHZhbHVlIHlvdSBkbyBub3Qgd2FudCB0byB1cGRhdGUuCisgICAgICAgICAgICAgICAgd2lkdGhTcGVjID0gLTE7CisgICAgICAgICAgICB9IGVsc2UgaWYgKG1Ecm9wRG93bldpZHRoID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuV1JBUF9DT05URU5UKSB7CisgICAgICAgICAgICAgICAgd2lkdGhTcGVjID0gZ2V0QW5jaG9yVmlldygpLmdldFdpZHRoKCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHdpZHRoU3BlYyA9IG1Ecm9wRG93bldpZHRoOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAobURyb3BEb3duSGVpZ2h0ID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UKSB7CisgICAgICAgICAgICAgICAgLy8gVGhlIGNhbGwgdG8gUG9wdXBXaW5kb3cncyB1cGRhdGUgbWV0aG9kIGJlbG93IGNhbiBhY2NlcHQgLTEgZm9yIGFueQorICAgICAgICAgICAgICAgIC8vIHZhbHVlIHlvdSBkbyBub3Qgd2FudCB0byB1cGRhdGUuCisgICAgICAgICAgICAgICAgaGVpZ2h0U3BlYyA9IG5vSW5wdXRNZXRob2QgPyBoZWlnaHQgOiBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVDsKKyAgICAgICAgICAgICAgICBpZiAobm9JbnB1dE1ldGhvZCkgeworICAgICAgICAgICAgICAgICAgICBtUG9wdXAuc2V0V2luZG93TGF5b3V0TW9kZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRHJvcERvd25XaWR0aCA9PSBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCA/CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCA6IDAsIDApOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIG1Qb3B1cC5zZXRXaW5kb3dMYXlvdXRNb2RlKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ecm9wRG93bldpZHRoID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UID8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UIDogMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIGlmIChtRHJvcERvd25IZWlnaHQgPT0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQpIHsKKyAgICAgICAgICAgICAgICBoZWlnaHRTcGVjID0gaGVpZ2h0OworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBoZWlnaHRTcGVjID0gbURyb3BEb3duSGVpZ2h0OworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtUG9wdXAuc2V0T3V0c2lkZVRvdWNoYWJsZSghbUZvcmNlSWdub3JlT3V0c2lkZVRvdWNoICYmICFtRHJvcERvd25BbHdheXNWaXNpYmxlKTsKKworICAgICAgICAgICAgbVBvcHVwLnVwZGF0ZShnZXRBbmNob3JWaWV3KCksIG1Ecm9wRG93bkhvcml6b250YWxPZmZzZXQsCisgICAgICAgICAgICAgICAgICAgIG1Ecm9wRG93blZlcnRpY2FsT2Zmc2V0LCB3aWR0aFNwZWMsIGhlaWdodFNwZWMpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaWYgKG1Ecm9wRG93bldpZHRoID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UKSB7CisgICAgICAgICAgICAgICAgd2lkdGhTcGVjID0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQ7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGlmIChtRHJvcERvd25XaWR0aCA9PSBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLldSQVBfQ09OVEVOVCkgeworICAgICAgICAgICAgICAgICAgICBtUG9wdXAuc2V0V2lkdGgoZ2V0QW5jaG9yVmlldygpLmdldFdpZHRoKCkpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIG1Qb3B1cC5zZXRXaWR0aChtRHJvcERvd25XaWR0aCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAobURyb3BEb3duSGVpZ2h0ID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UKSB7CisgICAgICAgICAgICAgICAgaGVpZ2h0U3BlYyA9IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBpZiAobURyb3BEb3duSGVpZ2h0ID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuV1JBUF9DT05URU5UKSB7CisgICAgICAgICAgICAgICAgICAgIG1Qb3B1cC5zZXRIZWlnaHQoaGVpZ2h0KTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBtUG9wdXAuc2V0SGVpZ2h0KG1Ecm9wRG93bkhlaWdodCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtUG9wdXAuc2V0V2luZG93TGF5b3V0TW9kZSh3aWR0aFNwZWMsIGhlaWdodFNwZWMpOworICAgICAgICAgICAgbVBvcHVwLnNldElucHV0TWV0aG9kTW9kZShQb3B1cFdpbmRvdy5JTlBVVF9NRVRIT0RfTkVFREVEKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgLy8gdXNlIG91dHNpZGUgdG91Y2hhYmxlIHRvIGRpc21pc3MgZHJvcCBkb3duIHdoZW4gdG91Y2hpbmcgb3V0c2lkZSBvZiBpdCwgc28KKyAgICAgICAgICAgIC8vIG9ubHkgc2V0IHRoaXMgaWYgdGhlIGRyb3Bkb3duIGlzIG5vdCBhbHdheXMgdmlzaWJsZQorICAgICAgICAgICAgbVBvcHVwLnNldE91dHNpZGVUb3VjaGFibGUoIW1Gb3JjZUlnbm9yZU91dHNpZGVUb3VjaCAmJiAhbURyb3BEb3duQWx3YXlzVmlzaWJsZSk7CisgICAgICAgICAgICBtUG9wdXAuc2V0VG91Y2hJbnRlcmNlcHRvcihtVG91Y2hJbnRlcmNlcHRvcik7CisgICAgICAgICAgICBtUG9wdXAuc2hvd0FzRHJvcERvd24oZ2V0QW5jaG9yVmlldygpLAorICAgICAgICAgICAgICAgICAgICBtRHJvcERvd25Ib3Jpem9udGFsT2Zmc2V0LCBtRHJvcERvd25WZXJ0aWNhbE9mZnNldCk7CisgICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldFNlbGVjdGlvbihMaXN0Vmlldy5JTlZBTElEX1BPU0lUSU9OKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKCFtTW9kYWwgfHwgbURyb3BEb3duTGlzdC5pc0luVG91Y2hNb2RlKCkpIHsKKyAgICAgICAgICAgICAgICBjbGVhckxpc3RTZWxlY3Rpb24oKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghbU1vZGFsKSB7CisgICAgICAgICAgICAgICAgbUhhbmRsZXIucG9zdChtSGlkZVNlbGVjdG9yKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIERpc21pc3MgdGhlIHBvcHVwIHdpbmRvdy4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBkaXNtaXNzKCkgeworICAgICAgICBtUG9wdXAuZGlzbWlzcygpOworICAgICAgICByZW1vdmVQcm9tcHRWaWV3KCk7CisgICAgICAgIG1Qb3B1cC5zZXRDb250ZW50VmlldyhudWxsKTsKKyAgICAgICAgbURyb3BEb3duTGlzdCA9IG51bGw7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHJlbW92ZVByb21wdFZpZXcoKSB7CisgICAgICAgIGlmIChtUHJvbXB0VmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICBmaW5hbCBWaWV3UGFyZW50IHBhcmVudCA9IG1Qcm9tcHRWaWV3LmdldFBhcmVudCgpOworICAgICAgICAgICAgaWYgKHBhcmVudCBpbnN0YW5jZW9mIFZpZXdHcm91cCkgeworICAgICAgICAgICAgICAgIGZpbmFsIFZpZXdHcm91cCBncm91cCA9IChWaWV3R3JvdXApIHBhcmVudDsKKyAgICAgICAgICAgICAgICBncm91cC5yZW1vdmVWaWV3KG1Qcm9tcHRWaWV3KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIENvbnRyb2wgaG93IHRoZSBwb3B1cCBvcGVyYXRlcyB3aXRoIGFuIGlucHV0IG1ldGhvZDogb25lIG9mCisgICAgICoge0BsaW5rICNJTlBVVF9NRVRIT0RfRlJPTV9GT0NVU0FCTEV9LCB7QGxpbmsgI0lOUFVUX01FVEhPRF9ORUVERUR9LAorICAgICAqIG9yIHtAbGluayAjSU5QVVRfTUVUSE9EX05PVF9ORUVERUR9LgorICAgICAqIAorICAgICAqIDxwPklmIHRoZSBwb3B1cCBpcyBzaG93aW5nLCBjYWxsaW5nIHRoaXMgbWV0aG9kIHdpbGwgdGFrZSBlZmZlY3Qgb25seQorICAgICAqIHRoZSBuZXh0IHRpbWUgdGhlIHBvcHVwIGlzIHNob3duIG9yIHRocm91Z2ggYSBtYW51YWwgY2FsbCB0byB0aGUge0BsaW5rICNzaG93KCl9CisgICAgICogbWV0aG9kLjwvcD4KKyAgICAgKiAKKyAgICAgKiBAc2VlICNnZXRJbnB1dE1ldGhvZE1vZGUoKQorICAgICAqIEBzZWUgI3Nob3coKQorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldElucHV0TWV0aG9kTW9kZShpbnQgbW9kZSkgeworICAgICAgICBtUG9wdXAuc2V0SW5wdXRNZXRob2RNb2RlKG1vZGUpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybiB0aGUgY3VycmVudCB2YWx1ZSBpbiB7QGxpbmsgI3NldElucHV0TWV0aG9kTW9kZShpbnQpfS4KKyAgICAgKiAKKyAgICAgKiBAc2VlICNzZXRJbnB1dE1ldGhvZE1vZGUoaW50KQorICAgICAqLworICAgIHB1YmxpYyBpbnQgZ2V0SW5wdXRNZXRob2RNb2RlKCkgeworICAgICAgICByZXR1cm4gbVBvcHVwLmdldElucHV0TWV0aG9kTW9kZSgpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldCB0aGUgc2VsZWN0ZWQgcG9zaXRpb24gb2YgdGhlIGxpc3QuCisgICAgICogT25seSB2YWxpZCB3aGVuIHtAbGluayAjaXNTaG93aW5nKCl9ID09IHtAY29kZSB0cnVlfS4KKyAgICAgKiAKKyAgICAgKiBAcGFyYW0gcG9zaXRpb24gTGlzdCBwb3NpdGlvbiB0byBzZXQgYXMgc2VsZWN0ZWQuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0U2VsZWN0aW9uKGludCBwb3NpdGlvbikgeworICAgICAgICBEcm9wRG93bkxpc3RWaWV3IGxpc3QgPSBtRHJvcERvd25MaXN0OworICAgICAgICBpZiAoaXNTaG93aW5nKCkgJiYgbGlzdCAhPSBudWxsKSB7CisgICAgICAgICAgICBsaXN0Lm1MaXN0U2VsZWN0aW9uSGlkZGVuID0gZmFsc2U7CisgICAgICAgICAgICBsaXN0LnNldFNlbGVjdGlvbihwb3NpdGlvbik7CisgICAgICAgICAgICBpZiAobGlzdC5nZXRDaG9pY2VNb2RlKCkgIT0gTGlzdFZpZXcuQ0hPSUNFX01PREVfTk9ORSkgeworICAgICAgICAgICAgICAgIGxpc3Quc2V0SXRlbUNoZWNrZWQocG9zaXRpb24sIHRydWUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogQ2xlYXIgYW55IGN1cnJlbnQgbGlzdCBzZWxlY3Rpb24uCisgICAgICogT25seSB2YWxpZCB3aGVuIHtAbGluayAjaXNTaG93aW5nKCl9ID09IHtAY29kZSB0cnVlfS4KK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EOworICAgIH0KKworICAgIC8qKgorICAgICAqIFBlcmZvcm0gYW4gaXRlbSBjbGljayBvcGVyYXRpb24gb24gdGhlIHNwZWNpZmllZCBsaXN0IGFkYXB0ZXIgcG9zaXRpb24uCisgICAgICogCisgICAgICogQHBhcmFtIHBvc2l0aW9uIEFkYXB0ZXIgcG9zaXRpb24gZm9yIHBlcmZvcm1pbmcgdGhlIGNsaWNrCisgICAgICogQHJldHVybiB0cnVlIGlmIHRoZSBjbGljayBhY3Rpb24gY291bGQgYmUgcGVyZm9ybWVkLCBmYWxzZSBpZiBub3QuCisgICAgICogICAgICAgICAoZS5nLiBpZiB0aGUgcG9wdXAgd2FzIG5vdCBzaG93aW5nLCB0aGlzIG1ldGhvZCB3b3VsZCByZXR1cm4gZmFsc2UuKQorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIHBlcmZvcm1JdGVtQ2xpY2soaW50IHBvc2l0aW9uKSB7CisgICAgICAgIGlmIChpc1Nob3dpbmcoKSkgeworICAgICAgICAgICAgaWYgKG1JdGVtQ2xpY2tMaXN0ZW5lciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgZmluYWwgRHJvcERvd25MaXN0VmlldyBsaXN0ID0gbURyb3BEb3duTGlzdDsKKyAgICAgICAgICAgICAgICBmaW5hbCBWaWV3IGNoaWxkID0gbGlzdC5nZXRDaGlsZEF0KHBvc2l0aW9uIC0gbGlzdC5nZXRGaXJzdFZpc2libGVQb3NpdGlvbigpKTsKKyAgICAgICAgICAgICAgICBtSXRlbUNsaWNrTGlzdGVuZXIub25JdGVtQ2xpY2sobGlzdCwgY2hpbGQsIHBvc2l0aW9uLCBjaGlsZC5nZXRJZCgpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAcmV0dXJuIFRoZSBjdXJyZW50bHkgc2VsZWN0ZWQgaXRlbSBvciBudWxsIGlmIHRoZSBwb3B1cCBpcyBub3Qgc2hvd2luZy4KKyAgICAgKi8KKyAgICBwdWJsaWMgT2JqZWN0IGdldFNlbGVjdGVkSXRlbSgpIHsKKyAgICAgICAgaWYgKCFpc1Nob3dpbmcoKSkgeworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG1Ecm9wRG93bkxpc3QuZ2V0U2VsZWN0ZWRJdGVtKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiBUaGUgcG9zaXRpb24gb2YgdGhlIGN1cnJlbnRseSBzZWxlY3RlZCBpdGVtIG9yIHtAbGluayBMaXN0VmlldyNJTlZBTElEX1BPU0lUSU9OfQorICAgICAqIGlmIHtAbGluayAjaXNTaG93aW5nKCl9ID09IHtAY29kZSBmYWxzZX0uCisgICAgICogCisgICAgICogQHNlZSBMaXN0VmlldyNnZXRTZWxlY3RlZEl0ZW1Qb3NpdGlvbigpCisgICAgICovCisgICAgcHVibGljIGludCBnZXRTZWxlY3RlZEl0ZW1Qb3NpdGlvbigpIHsKKyAgICAgICAgaWYgKCFpc1Nob3dpbmcoKSkgeworICAgICAgICAgICAgcmV0dXJuIExpc3RWaWV3LklOVkFMSURfUE9TSVRJT047CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG1Ecm9wRG93bkxpc3QuZ2V0U2VsZWN0ZWRJdGVtUG9zaXRpb24oKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAcmV0dXJuIFRoZSBJRCBvZiB0aGUgY3VycmVudGx5IHNlbGVjdGVkIGl0ZW0gb3Ige0BsaW5rIExpc3RWaWV3I0lOVkFMSURfUk9XX0lEfQorICAgICAqIGlmIHtAbGluayAjaXNTaG93aW5nKCl9ID09IHtAY29kZSBmYWxzZX0uCisgICAgICogCisgICAgICogQHNlZSBMaXN0VmlldyNnZXRTZWxlY3RlZEl0ZW1JZCgpCisgICAgICovCisgICAgcHVibGljIGxvbmcgZ2V0U2VsZWN0ZWRJdGVtSWQoKSB7CisgICAgICAgIGlmICghaXNTaG93aW5nKCkpIHsKKyAgICAgICAgICAgIHJldHVybiBMaXN0Vmlldy5JTlZBTElEX1JPV19JRDsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbURyb3BEb3duTGlzdC5nZXRTZWxlY3RlZEl0ZW1JZCgpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gVGhlIFZpZXcgZm9yIHRoZSBjdXJyZW50bHkgc2VsZWN0ZWQgaXRlbSBvciBudWxsIGlmCisgICAgICoge0BsaW5rICNpc1Nob3dpbmcoKX0gPT0ge0Bjb2RlIGZhbHNlfS4KKyAgICAgKiAKKyAgICAgKiBAc2VlIExpc3RWaWV3I2dldFNlbGVjdGVkVmlldygpCisgICAgICovCisgICAgcHVibGljIFZpZXcgZ2V0U2VsZWN0ZWRWaWV3KCkgeworICAgICAgICBpZiAoIWlzU2hvd2luZygpKSB7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbURyb3BEb3duTGlzdC5nZXRTZWxlY3RlZFZpZXcoKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAcmV0dXJuIFRoZSB7QGxpbmsgTGlzdFZpZXd9IGRpc3BsYXllZCB3aXRoaW4gdGhlIHBvcHVwIHdpbmRvdy4KKyAgICAgKiBPbmx5IHZhbGlkIHdoZW4ge0BsaW5rICNpc1Nob3dpbmcoKX0gPT0ge0Bjb2RlIHRydWV9LgorICAgICAqLworICAgIHB1YmxpYyBMaXN0VmlldyBnZXRMaXN0VmlldygpIHsKKyAgICAgICAgcmV0dXJuIG1Ecm9wRG93bkxpc3Q7CisgICAgfQorCisgICAgLyoqCisgICAgICogRmlsdGVyIGtleSBkb3duIGV2ZW50cy4gQnkgZm9yd2FyZGluZyBrZXkgdXAgZXZlbnRzIHRvIHRoaXMgZnVuY3Rpb24sCisgICAgICogdmlld3Mg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B0byBzZWxlY3Qgb25lIG9mIGl0cyBpdGVtcworICAgICAgICAgICAgaWYgKGtleUNvZGUgIT0gS2V5RXZlbnQuS0VZQ09ERV9TUEFDRQorICAgICAgICAgICAgICAgICAgICAmJiAobURyb3BEb3duTGlzdC5nZXRTZWxlY3RlZEl0ZW1Qb3NpdGlvbigpID49IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoa2V5Q29kZSAhPSBLZXlFdmVudC5LRVlDT0RFX0VOVEVSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBrZXlDb2RlICE9IEtleUV2ZW50LktFWUNPREVfRFBBRF9DRU5URVIpKSkgeworICAgICAgICAgICAgICAgIGludCBjdXJJbmRleCA9IG1Ecm9wRG93bkxpc3QuZ2V0U2VsZWN0ZWRJdGVtUG9zaXRpb24oKTsKKyAgICAgICAgICAgICAgICBib29sZWFuIGNvbnN1bWVkOworCisgICAgICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBiZWxvdyA9ICFtUG9wdXAuaXNBYm92ZUFuY2hvcigpOworCisgICAgICAgICAgICAgICAgZmluYWwgTGlzdEFkYXB0ZXIgYWRhcHRlciA9IG1BZGFwdGVyOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGJvb2xlYW4gYWxsRW5hYmxlZDsKKyAgICAgICAgICAgICAgICBpbnQgZmlyc3RJdGVtID0gSW50ZWdlci5NQVhfVkFMVUU7CisgICAgICAgICAgICAgICAgaW50IGxhc3RJdGVtID0gSW50ZWdlci5NSU5fVkFMVUU7CisKKyAgICAgICAgICAgICAgICBpZiAoYWRhcHRlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGFsbEVuYWJsZWQgPSBhZGFwdGVyLmFyZUFsbEl0ZW1zRW5hYmxlZCgpOworICAgICAgICAgICAgICAgICAgICBmaXJzdEl0ZW0gPSBhbGxFbmFibGVkID8gMCA6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbURyb3BEb3duTGlzdC5sb29rRm9yU2VsZWN0YWJsZVBvc2l0aW9uKDAsIHRydWUpOworICAgICAgICAgICAgICAgICAgICBsYXN0SXRlbSA9IGFsbEVuYWJsZWQgPyBhZGFwdGVyLmdldENvdW50KCkgLSAxIDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRHJvcERvd25MaXN0Lmxvb2tGb3JTZWxlY3RhYmxlUG9zaXRpb24oYWRhcHRlci5nZXRDb3VudCgpIC0gMSwgZmFsc2UpOyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGlmICgoYmVsb3cgJiYga2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX0RQQURfVVAgJiYgY3VySW5kZXggPD0gZmlyc3RJdGVtKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgKCFiZWxvdyAmJiBrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfRFBBRF9ET1dOICYmIGN1ckluZGV4ID49IGxhc3RJdGVtKSkgeworICAgICAgICAgICAgICAgICAgICAvLyBXaGVuIHRoZSBzZWxlY3Rpb24gaXMgYXQgdGhlIHRvcCwgd2UgYmxvY2sgdGhlIGtleQorICAgICAgICAgICAgICAgICAgICAvLyBldmVudCB0byBwcmV2ZW50IGZvY3VzIGZyb20gbW92aW5nLgorICAgICAgICAgICAgICAgICAgICBjbGVhckxpc3RTZWxlY3Rpb24oKTsKKyAgICAgICAgICAgICAgICAgICAgbVBvcHVwLnNldElucHV0TWV0aG9kTW9kZShQb3B1cFdpbmRvdy5JTlBVVF9NRVRIT0RfTkVFREVEKTsKKyAgICAgICAgICAgICAgICAgICAgc2hvdygpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAvLyBXQVJOSU5HOiBQbGVhc2UgcmVhZCB0aGUgY29tbWVudCB3aGVyZSBtTGlzdFNlbGVjdGlvbkhpZGRlbgorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICBpcyBkZWNsYXJlZAorICAgICAgICAgICAgICAgICAgICBtRHJvcERvd25MaXN0Lm1MaXN0U2VsZWN0aW9uSGlkZGVuID0gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgY29uc3VtZWQgPSBtRHJvcERvd25MaXN0Lm9uS2V5RG93bihrZXlDb2RlLCBldmVudCk7CisgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJLZXkgZG93bjogY29kZT0iICsga2V5Q29kZSArICIgbGlzdCBjb25zdW1lZD0iICsgY29uc3VtZWQpOworCisgICAgICAgICAgICAgICAgaWYgKGNvbnN1bWVkKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIElmIGl0IGhhbmRsZWQgdGhlIGtleSBldmVudCwgdGhlbiB0aGUgdXNlciBpcworICAgICAgICAgICAgICAgICAgICAvLyBuYXZpZ2F0aW5nIGluIHRoZSBsaXN0LCBzbyB3ZSBzaG91bGQgcHV0IGl0IGluIGZyb250LgorICAgICAgICAgICAgICAgICAgICBtUG9wdXAuc2V0SW5wdXRNZXRob2RNb2RlKFBvcHVwV2luZG93LklOUFVUX01FVEhPRF9OT1RfTkVFREVEKTsKKyAgICAgICAgICAgICAgICAgICAgLy8gSGVyZSdzIGEgbGl0dGxlIHRyaWNrIHdlIG5lZWQgdG8gZG8gdG8gbWFrZSBzdXJlIHRoYXQKKyAgICAgICAgICAgICAgICAgICAgLy8gdGhlIGxpc3QgdmlldyBpcyBhY3R1YWxseSBzaG93aW5nIGl0cyBmb2N1cyBpbmRpY2F0b3IsCisgICAgICAgICAgICAgICAgICAgIC8vIGJ5IGVuc3VyaW5nIGl0IGhhcyBmb2N1cyBhbmQgZ2V0dGluZyBpdHMgd2luZG93IG91dAorICAgICAgICAgICAgICAgICAgICAvLyBvZiB0b3VjaCBtb2RlLgorICAgICAgICAgICAgICAgICAgICBtRHJvcERvd25MaXN0LnJlcXVlc3RGb2N1c0Zyb21Ub3VjaCgpOworICAgICAgICAgICAgICAgICAgICBzaG93KCk7CisKKyAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChrZXlDb2RlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBhdm9pZCBwYXNzaW5nIHRoZSBmb2N1cyBmcm9tIHRoZSB0ZXh0IHZpZXcgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBuZXh0IGNvbXBvbmVudAorICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0VOVEVSOgorICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0RQQURfQ0VOVEVSOgorICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0RQQURfRE9XTjoKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1VQOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGJlbG93ICYmIGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX0RPV04pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdoZW4gdGhlIHNlbGVjdGlvbiBpcyBhdCB0aGUgYm90dG9tLCB3ZSBibG9jayB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGV2ZW50IHRvIGF2b2lkIGdvaW5nIHRvIHRoZSBuZXh0IGZvY3VzYWJsZSB3aWRnZXQKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXJJbmRleCA9PSBsYXN0SXRlbSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFiZWxvdyAmJiBrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfRFBBRF9VUCAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1ckluZGV4ID09IGZpcnN0SXRlbSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgLyoqCisgICAgICogRmlsdGVyIGtleSBkb3duIGV2ZW50cy4gQnkgZm9yd2FyZGluZyBrZXkgdXAgZXZlbnRzIHRvIHRoaXMgZnVuY3Rpb24sCisgICAgICogdmlld3MgdXNpbmcgbm9uLW1vZGFsIExpc3RQb3B1cFdpbmRvdyBjYW4gaGF2ZSBpdCBoYW5kbGUga2V5IHNlbGVjdGlvbiBvZiBpdGVtcy4KKyAgICAgKiAgCisgICAgICogQHBhcmFtIGtleUNvZGUga2V5Q29kZSBwYXJhbSBwYXNzZWQgdG8gdGhlIGhvc3QgdmlldydzIG9uS2V5VXAKKyAgICAgKiBAcGFyYW0gZXZlbnQgZXZlbnQgcGFyYW0gcGFzc2VkIHRvIHRoZSBob3N0IHZpZXcncyBvbktleVVwCisgICAgICogQHJldHVybiB0cnVlIGlmIHRoZSBldmVudCB3YXMgaGFuZGxlZCwgZmFsc2UgaWYgaXQgd2FzIGlnbm9yZWQuCisgICAgICogCisgICAgICogQHNlZSAjc2V0TW9kYWwoYm9vbGVhbikKKyAgICAgKi8KKyAgICBwdWJsaWMgYm9vbGVhbiBvbktleVVwKGludCBrZXlDb2RlLCBLZXlFdmVudCBldmVudCkgeworICAgICAgICBpZiAoaXNTaG93aW5nKCkgJiYgbURyb3BEb3duTGlzdC5nZXRTZWxlY3RlZEl0ZW1Qb3NpdGlvbigpID49IDApIHsKKyAgICAgICAgICAgIGJvb2xlYW4gY29uc3VtZWQgPSBtRHJvcERvd25MaXN0Lm9uS2V5VXAoa2V5Q29kZSwgZXZlbnQpOworICAgICAgICAgICAgaWYgKGNvbnN1bWVkKSB7CisgICAgICAgICAgICAgICAgc3dpdGNoIChrZXlDb2RlKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBsaXN0IGFjY2VwdHMgdGhlIGtleSBldmVudHMgYW5kIHRoZSBrZXkgZXZlbnQKKyAgICAgICAgICAgICAgICAgICAgLy8gd2FzIGEgY2xpY2ssIHRoZSB0ZXh0IHZpZXcgZ2V0cyB0aGUgc2VsZWN0ZWQgaXRlbQorICAgICAgICAgICAgICAgICAgICAvLyBmcm9tIHRoZSBkcm9wIGRvd24gYXMgaXRzIGNvbnRlbnQKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0VOVEVSOgorICAgICAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRFBBRF9DRU5URVI6CisgICAgICAgICAgICAgICAgICAgICAgICBkaXNtaXNzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gY29uc3VtZWQ7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIC8qKgorICAgICAqIEZpbHRlciBwcmUtSU1FIGtleSBldmVudHMuIEJ5IGZvcndhcmRpbmcge0BsaW5rIFZpZXcjb25LZXlQcmVJbWUoaW50LCBLZXlFdmVudCl9CisgICAgICogZXZlbnRzIHRvIHRoaXMgZnVuY3Rpb24sIHZpZXdzIHVzaW5nIExpc3RQb3B1cFdpbmRvdyBjYW4gaGF2ZSBpdCBkaXNtaXNzIHRoZSBwb3B1cAorICAgICAqIHdoZW4gdGhlIGJhY2sga2V5IGlzIHByZXNzZWQuCisgICAgICogIAorICAgICAqIEBwYXJhbSBrZXlDb2RlIGtleUNvZGUgcGFyYW0gcGFzc2VkIHRvIHRoZSBob3N0IHZpZXcncyBvbktleVByZUltZQorICAgICAqIEBwYXJhbSBldmVudCBldmVudCBwYXJhbSBwYXNzZWQgdG8gdGhlIGhvc3QgdmlldydzIG9uS2V5UHJlSW1lCisgICAgICogQHJldHVybiB0cnVlIGlmIHRoZSBldmVudCB3YXMgaGFuZGxlZCwgZmFsc2UgaWYgaXQgd2FzIGlnbm9yZWQuCisgICAgICogCisgICAgICogQHNlZSAjc2V0TW9kYWwoYm9vbGVhbikKKyAgICAgKi8KKyAgICBwdWJsaWMgYm9vbGVhbiBvbktleVByZUltZShpbnQga2V5Q29kZSwgS2V5RXZlbnQgZXZlbnQpIHsKKyAgICAgICAgaWYgKGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9CQUNLICYmIGlzU2hvd2luZygpKSB7CisgICAgICAgICAgICAvLyBzcGVjaWFsIGNhc2UgZm9yIHRoZSBiYWNrIGtleSwgd2UgZG8gbm90IGV2ZW4gdHJ5IHRvIHNlbmQgaXQKKyAgICAgICAgICAgIC8vIHRvIHRoZSBkcm9wIGRvd24gbGlzdCBidXQgaW5zdGVhZCwgY29uc3VtZSBpdCBpbW1lZGlhdGVseQorICAgICAgICAgICAgZmluYWwgVmlldyBhbmNob3JWaWV3ID0gbURyb3BEb3duQW5jaG9yVmlldzsKKyAgICAgICAgICAgIGlmIChldmVudC5nZXRBY3Rpb24oKSA9PSBLZXlFdmVudC5BQ1RJT05fRE9XTiAmJiBldmVudC5nZXRSZXBlYXRDb3VudCgpID09IDApIHsKKyAgICAgICAgICAgICAgICBhbmNob3JWaWV3LmdldEtleURpc3BhdGNoZXJTdGF0ZSgpLnN0YXJ0VHJhY2tpbmcoZXZlbnQsIHRoaXMpOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfSBlbHNlIGlmIChldmVudC5nZXRBY3Rpb24oKSA9PSBLZXlFdmVudC5BQ1RJT05fVVApIHsKKyAgICAgICAgICAgICAgICBhbmNob3JWaWV3LmdldEtleURpc3BhdGNoZXJTdGF0ZSgpLmhhbmRsZVVwRXZlbnQoZXZlbnQpOworICAgICAgICAgICAgICAgIGlmIChldmVudC5pc1RyYWNraW5nKCkgJiYgIWV2ZW50LmlzQ2FuY2VsZWQoKSkgeworICAgICAgICAgICAgICAgICAgICBkaXNtaXNzKCk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgLyoqCisgICAgICogPHA+QnVpbGRzIHRoZSBwb3B1cCB3aW5kb3cncyBjb250ZW50IGFuZCByZXR1cm5zIHRoZSBoZWlnaHQgdGhlIHBvcHVwCisgICAgICogc2hvdWxkIGhhdmUuIFJldHVybnMgLTEgd2hlbiB0aGUgY29udGVudCBhbHJlYWR5IGV4aXN0cy48L3A+CisgICAgICoKKyAgICAgKiBAcmV0dXJuIHRoZSBjb250ZW50J3MgaGVpZ2h0IG9yIC0xIGlmIGNvbnRlbnQgYWxyZWFkeSBleGlzdHMKKyAgICAgKi8KKyAgICBwcml2YXRlIGludCBidWlsZERyb3BEb3duKCkgeworICAgICAgICBWaWV3R3JvdXAgZHJvcERvd25WaWV3OworICAgICAgICBpbnQgb3RoZXJIZWlnaHRzID0gMDsKKworICAgICAgICBpZiAobURyb3BEb3duTGlzdCA9PSBudWxsKSB7CisgICAgICAgICAgICBDb250ZXh0IGNvbnRleHQgPSBtQ29udGV4dDsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGlzIFJ1bm5hYmxlIGV4aXN0cyBmb3IgdGhlIHNvbGUgcHVycG9zZSBvZiBjaGVja2luZyBpZiB0aGUgdmlldyBsYXlvdXQgaGFzIGdvdAorICAgICAgICAgICAgICogY29tcGxldGVkIGFuZCBpZiBzbyBjYWxsIHNob3dEcm9wRG93biB0byBkaXNwbGF5IHRoZSBkcm9wIGRvd24uIFRoaXMgaXMgdXNlZCB0byBzaG93CisgICAgICAgICAgICAgKiB0aGUgZHJvcCBkb3duIGFzIHNvb24gYXMgcG9zc2libGUgYWZ0ZXIgdXNlciBvcGVucyB1cCB0aGUgc2VhcmNoIGRpYWxvZywgd2l0aG91dAorICAgICAgICAgICAgICogd2FpdGluZyBmb3IgdGhlIG5vcm1hbCBVSSBwaXBlbGluZSB0byBkbyBpdCdzIGpvYiB3aGljaCBpcyBzbG93ZXIgdGhhbiB0aGlzIG1ldGhvZC4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgbVNob3dEcm9wRG93blJ1bm5hYmxlID0gbmV3IFJ1bm5hYmxlKCkgeworICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gVmlldyBsYXlvdXQgc2hvdWxkIGJlIGFsbCBkb25lIGJlZm9yZSBkaXNwbGF5aW5nIHRoZSBkcm9wIGRvd24uCisgICAgICAgICAgICAgICAgICAgIFZpZXcgdmlldyA9IGdldEFuY2hvclZpZXcoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHZpZXcgIT0gbnVsbCAmJiB2aWV3LmdldFdpbmRvd1Rva2VuKCkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2hvdygpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgbURyb3BEb3duTGlzdCA9IG5ldyBEcm9wRG93bkxpc3RWaWV3KGNvbnRleHQsICFtTW9kYWwpOworICAgICAgICAgICAgaWYgKG1Ecm9wRG93bkxpc3RIaWdobGlnaHQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1Ecm9wRG93bkxpc3Quc2V0U2VsZWN0b3IobURyb3BEb3duTGlzdEhpZ2hsaWdodCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldEFkYXB0ZXIobUFkYXB0ZXIpOworICAgICAgICAgICAgbURyb3BEb3duTGlzdC5zZXRWZXJ0aWNhbEZhZGluZ0VkZ2VFbmFibGVkKHRydWUpOworICAgICAgICAgICAgbURyb3BEb3duTGlzdC5zZXRPbkl0ZW1DbGlja0xpc3RlbmVyKG1JdGVtQ2xpY2tMaXN0ZW5lcik7CisgICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldEZvY3VzYWJsZSh0cnVlKTsKKyAgICAgICAgICAgIG1Ecm9wRG93bkxpc3Quc2V0Rm9jdXNhYmxlSW5Ub3VjaE1vZGUodHJ1ZSk7CisgICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldE9uSXRlbVNlbGVjdGVkTGlzdGVuZXIobmV3IEFkYXB0ZXJWaWV3Lk9uSXRlbVNlbGVjdGVkTGlzdGVuZXIoKSB7CisgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25JdGVtU2VsZWN0ZWQoQWRhcHRlclZpZXc8Pz4gcGFyZW50LCBWaWV3IHZpZXcsCisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgcG9zaXRpb24sIGxvbmcgaWQpIHsKKworICAgICAgICAgICAgICAgICAgICBpZiAocG9zaXRpb24gIT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIERyb3BEb3duTGlzdFZpZXcgZHJvcERvd25MaXN0ID0gbURyb3BEb3duTGlzdDsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRyb3BEb3duTGlzdCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJvcERvd25MaXN0Lm1MaXN0U2VsZWN0aW9uSGlkZGVuID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbk5vdGhpbmdTZWxlY3RlZChBZGFwdGVyVmlldzw/PiBwYXJlbnQpIHsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIG1Ecm9wRG93bkxpc3Quc2V0T25TY3JvbGxMaXN0ZW5lcihtU2Nyb2xsTGlzdGVuZXIpOworCisgICAgICAgICAgICBpZiAobUl0ZW1TZWxlY3RlZExpc3RlbmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldE9uSXRlbVNlbGVjdGVkTGlzdGVuZXIobUl0ZW1TZWxlY3RlZExpc3RlbmVyKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZHJvcERvd25WaWV3ID0gbURyb3BEb3duTGlzdDsKKworICAgICAgICAgICAgVmlldyBoaW50VmlldyA9IG1Qcm9tcHRWaWV3OworICAgICAgICAgICAgaWYgKGhpbnRWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAvLyBpZiBhbiBoaW50IGhhcyBiZWVuIHNwZWNpZmllZCwgd2UgYWNjb21vZGF0ZSBtb3JlIHNwYWNlIGZvciBpdCBhbmQKKyAgICAgICAgICAgICAgICAvLyBhZGQgYSB0ZXh0IHZpZXcgaW4gdGhlIGRyb3AgZG93biBtZW51LCBhdCB0aGUgYm90dG9tIG9mIHRoZSBsaXN0CisgICAgICAgICAgICAgICAgTGluZWFyTGF5b3V0IGhpbnRDb250YWluZXIgPSBuZXcgTGluZWFyTGF5b3V0KGNvbnRleHQpOworICAgICAgICAgICAgICAgIGhpbnRDb250YWluZXIuc2V0T3JpZW50YXRpb24oTGluZWFyTGF5b3V0LlZFUlRJQ0FMKTsKKworICAgICAgICAgICAgICAgIExpbmVhckxheW91dC5MYXlvdXRQYXJhbXMgaGludFBhcmFtcyA9IG5ldyBMaW5lYXJMYXlvdXQuTGF5b3V0UGFyYW1zKAorICAgICAgICAgICAgICAgICAgICAgICAgVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQsIDAsIDEuMGYKKyAgICAgICAgICAgICAgICApOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIHN3aXRjaCAobVByb21wdFBvc2l0aW9uKSB7CisgICAgICAgICAgICAgICAgY2FzZSBQT1NJVElPTl9QUk9NUFRfQkVMT1c6CisgICAgICAgICAgICAgICAgICAgIGhpbnRDb250YWluZXIuYWRkVmlldyhkcm9wRG93blZpZXcsIGhpbnRQYXJhbXMpOworICAgICAgICAgICAgICAgICAgICBoaW50Q29udGFpbmVyLmFkZFZpZXcoaGludFZpZXcpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgY2FzZSBQT1NJVElPTl9QUk9NUFRfQUJPVkU6CisgICAgICAgICAgICAgICAgICAgIGhpbnRDb250YWluZXIuYWRkVmlldyhoaW50Vmlldyk7CisgICAgICAgICAgICAgICAgICAgIGhpbnRDb250YWluZXIuYWRkVmlldyhkcm9wRG93blZpZXcsIGhpbnRQYXJhbXMpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiSW52YWxpZCBoaW50IHBvc2l0aW9uICIgKyBtUHJvbXB0UG9zaXRpb24pOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBtZWFzdXJlIHRoZSBoaW50J3MgaGVpZ2h0IHRvIGZpbmQgaG93IG11Y2ggbW9yZSB2ZXJ0aWNhbCBzcGFjZQorICAgICAgICAgICAgICAgIC8vIHdlIG5lZWQgdG8gYWRkIHRvIHRoZSBkcm9wIGRvd24ncyBoZWlnaHQKKyAgICAgICAgICAgICAgICBpbnQgd2lkdGhTcGVjID0gTWVhc3VyZVNwZWMubWFrZU1lYXN1cmVTcGVjKG1Ecm9wRG93bldpZHRoLCBNZWFzdXJlU3BlYy5BVF9NT1NUKTsKKyAgICAgICAgICAgICAgICBpbnQgaGVpZ2h0U3BlYyA9IE1lYXN1cmVTcGVjLlVOU1BFQ0lGSUVEOworICAgICAgICAgICAgICAgIGhpbnRWaWV3Lm1lYXN1cmUod2lkdGhTcGVjLCBoZWlnaHRTcGVjKTsKKworICAgICAgICAgICAgICAgIGhpbnRQYXJhbXMgPSAoTGluZWFyTGF5b3V0LkxheW91dFBhcmFtcykgaGludFZpZXcuZ2V0TGF5b3V0UGFyYW1zKCk7CisgICAgICAgICAgICAgICAgb3RoZXJIZWlnaHRzID0gaGludFZpZXcuZ2V0TWVhc3VyZWRIZWlnaHQoKSArIGhpbnRQYXJhbXMudG9wTWFyZ2luCisgICAgICAgICAgICAgICAgICAgICAgICArIGhpbnRQYXJhbXMuYm90dG9tTWFyZ2luOworCisgICAgICAgICAgICAgICAgZHJvcERvd25WaWV3ID0gaGludENvbnRhaW5lcjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbVBvcHVwLnNldENvbnRlbnRWaWV3KGRyb3BEb3duVmlldyk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBkcm9wRG93blZpZXcgPSAoVmlld0dyb3VwKSBtUG9wdXAuZ2V0Q29udGVudFZpZXcoKTsKKyAgICAgICAgICAgIGZpbmFsIFZpZXcgdmlldyA9IG1Qcm9tcHRWaWV3OworICAgICAgICAgICAgaWYgKHZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIExpbmVhckxheW91dC5MYXlvdXRQYXJhbXMgaGludFBhcmFtcyA9CisgICAgICAgICAgICAgICAgICAgICAgICAoTGluZWFyTGF5b3V0LkxheW91dFBhcmFtcykgdmlldy5nZXRMYXlvdXRQYXJhbXMoKTsKKyAgICAgICAgICAgICAgICBvdGhlckhlaWdodHMgPSB2aWV3LmdldE1lYXN1cmVkSGVpZ2h0KCkgKyBoaW50UGFyYW1zLnRvcE1hcmdpbgorICAgICAgICAgICAgICAgICAgICAgICAgKyBoaW50UGFyYW1zLmJvdHRvbU1hcmdpbjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIE1heCBoZWlnaHQgYXZhaWxhYmxlIG9uIHRoZSBzY3JlZW4gZm9yIGEgcG9wdXAuCisgICAgICAgIGJvb2xlYW4gaWdub3JlQm90dG9tRGVjb3JhdGlvbnMgPQorICAgICAgICAgICAgICAgIG1Qb3B1cC5nZXRJbnB1dE1ldGhvZE1vZGUoKSA9PSBQb3B1cFdpbmRvdy5JTlBVVF9NRVRIT0RfTk9UX05FRURFRDsKKyAgICAgICAgZmluYWwgaW50IG1heEhlaWdodCA9IG1Qb3B1cC5nZXRNYXhBdmFpbGFibGVIZWlnaHQoCisgICAgICAgICAgICAgICAgZ2V0QW5jaG9yVmlldygpLCBtRHJvcERvd25WZXJ0aWNhbE9mZnNldCwgaWdub3JlQm90dG9tRGVjb3JhdGlvbnMpOworCisgICAgICAgIC8vIGdldE1heEF2YWlsYWJsZUhlaWdodCgpIHN1YnRyYWN0cyB0aGUgcGFkZGluZywgc28gd2UgcHV0IGl0IGJhY2ssCisgICAgICAgIC8vIHRvIGdldCB0aGUgYXZhaWxhYmxlIGhlaWdodCBmb3IgdGhlIHdob2xlIHdpbmRvdworICAgICAgICBpbnQgcGFkZGluZyA9IDA7CisgICAgICAgIERyYXdhYmxlIGJhY2tncm91bmQgPSBtUG9wdXAuZ2V0QmFja2dyb3VuZCgpOworICAgICAgICBpZiAoYmFja2dyb3VuZCAhPSBudWxsKSB7CisgICAgICAgICAgICBiYWNrZ3JvdW5kLmdldFBhZGRpbmcobVRlbXBSZWN0KTsKKyAgICAgICAgICAgIHBhZGRpbmcgPSBtVGVtcFJlY3QudG9wICsgbVRlbXBSZWN0LmJvdHRvbTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChtRHJvcERvd25BbHdheXNWaXNpYmx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l0CisgICAgICAgICAqIHJldHVybnMgc3VwZXIuaXNJblRvdWNoTW9kZSgpLgorICAgICAgICAgKi8KKyAgICAgICAgcHJpdmF0ZSBib29sZWFuIG1MaXN0U2VsZWN0aW9uSGlkZGVuOworICAgICAgICAKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRydWUgaWYgdGhpcyB3cmFwcGVyIHNob3VsZCBmYWtlIGZvY3VzLgorICAgICAgICAgKi8KKyAgICAgICAgcHJpdmF0ZSBib29sZWFuIG1IaWphY2tGb2N1czsKKworICAgICAgICAvKioKKyAgICAgICAgICogPHA+Q3JlYXRlcyBhIG5ldyBsaXN0IHZpZXcgd3JhcHBlci48L3A+CisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSBjb250ZXh0IHRoaXMgdmlldydzIGNvbnRleHQKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBEcm9wRG93bkxpc3RWaWV3KENvbnRleHQgY29udGV4dCwgYm9vbGVhbiBoaWphY2tGb2N1cykgeworICAgICAgICAgICAgc3VwZXIoY29udGV4dCwgbnVsbCwgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5hdHRyLmRyb3BEb3duTGlzdFZpZXdTdHlsZSk7CisgICAgICAgICAgICBtSGlqYWNrRm9jdXMgPSBoaWphY2tGb2N1czsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiA8cD5Bdm9pZHMgamFycmluZyBzY3JvbGxpbmcgZWZmZWN0IGJ5IGVuc3VyaW5nIHRoYXQgbGlzdCBlbGVtZW50cworICAgICAgICAgKiBtYWRlIG9mIGEgdGV4dCB2aWV3IGZpdCBvbiBhIHNpbmdsZSBsaW5lLjwvcD4KKyAgICAgICAgICoKKyAgICAgICAgICogQHBhcmFtIHBvc2l0aW9uIHRoZSBpdGVtIGluZGV4IGluIHRoZSBsaXN0IHRvIGdldCBhIHZpZXcgZm9yCisgICAgICAgICAqIEByZXR1cm4gdGhlIHZpZXcgZm9yIHRoZSBzcGVjaWZpZWQgaXRlbQorICAgICAgICAgKi8KKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIFZpZXcgb2J0YWluVmlldyhpbnQgcG9zaXRpb24sIGJvb2xlYW5bXSBpc1NjcmFwKSB7CisgICAgICAgICAgICBWaWV3IHZpZXcgPSBzdXBlci5vYnRhaW5WaWV3KHBvc2l0aW9uLCBpc1NjcmFwKTsKKworICAgICAgICAgICAgaWYgKHZpZXcgaW5zdGFuY2VvZiBUZXh0VmlldykgeworICAgICAgICAgICAgICAgICgoVGV4dFZpZXcpIHZpZXcpLnNldEhvcml6b250YWxseVNjcm9sbGluZyh0cnVlKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIHZpZXc7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGJvb2xlYW4gaXNJblRvdWNoTW9kZSgpIHsKKyAgICAgICAgICAgIC8vIFdBUk5JTkc6IFBsZWFzZSByZWFkIHRoZSBjb21tZW50IHdoZXJlIG1MaXN0U2VsZWN0aW9uSGlkZGVuIGlzIGRlY2xhcmVkCisgICAgICAgICAgICByZXR1cm4gKG1IaWphY2tGb2N1cyAmJiBtTGlzdFNlbGVjdGlvbkhpZGRlbikgfHwgc3VwZXIuaXNJblRvdWNoTW9kZSgpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIDxwPlJldHVybnMgdGhlIGZvY3VzIHN0YXRlIGluIHRoZSBkcm9wIGRvd24uPC9wPgorICAgICAgICAgKgorICAgICAgICAgKiBAcmV0dXJuIHRydWUgYWx3YXlzIGlmIGhpamFja2luZyBmb2N1cworICAgICAgICAgKi8KKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIGhhc1dpbmRvd0ZvY3VzKCkgeworICAgICAgICAgICAgcmV0dXJuIG1IaWphY2tGb2N1cyB8fCBzdXBlci5oYXNXaW5kb3dGb2N1cygpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIDxwPlJldHVybnMgdGhlIGZvY3VzIHN0YXRlIGluIHRoZSBkcm9wIGRvd24uPC9wPgorICAgICAgICAgKgorICAgICAgICAgKiBAcmV0dXJuIHRydWUgYWx3YXlzIGlmIGhpamFja2luZyBmb2N1cworICAgICAgICAgKi8KKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIGlzRm9jdXNlZCgpIHsKKyAgICAgICAgICAgIHJldHVybiBtSGlqYWNrRm9jdXMgfHwgc3VwZXIuaXNGb2N1c2VkKCk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogPHA+UmV0dXJucyB0aGUgZm9jdXMgc3RhdGUgaW4gdGhlIGRyb3AgZG93bi48L3A+CisgICAgICAgICAqCisgICAgICAgICAqIEByZXR1cm4gdHJ1ZSBhbHdheXMgaWYgaGlqYWNraW5nIGZvY3VzCisgICAgICAgICAqLworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGJvb2xlYW4gaGFzRm9jdXMoKSB7CisgICAgICAgICAgICByZXR1cm4gbUhpamFja0ZvY3VzIHx8IHN1cGVyLmhhc0ZvY3VzKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGNsYXNzIFBvcHVwRGF0YVNldE9ic2VydmVyIGV4dGVuZHMgRGF0YVNldE9ic2VydmVyIHsKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2hhbmdlZCgpIHsKKyAgICAgICAgICAgIGlmIChpc1Nob3dpbmcoKSkgeworICAgICAgICAgICAgICAgIC8vIFJlc2l6ZSB0aGUgcG9wdXAgdG8gZml0IG5ldyBjb250ZW50CisgICAgICAgICAgICAgICAgc2hvdygpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgb25JbnZhbGlkYXRlZCgpIHsKKyAgICAgICAgICAgIGRpc21pc3MoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgTGlzdFNlbGVjdG9ySGlkZXIgaW1wbGVtZW50cyBSdW5uYWJsZSB7CisgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgIGNsZWFyTGlzdFNlbGVjdGlvbigpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBjbGFzcyBSZXNpemVQb3B1cFJ1bm5hYmxlIGltcGxlbWVudHMgUnVubmFibGUgeworICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICBtUG9wdXAuc2V0SW5wdXRNZXRob2RNb2RlKFBvcHVwV2luZG93LklOUFVUX01FVEhPRF9OT1RfTkVFREVEKTsKKyAgICAgICAgICAgIHNob3coKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgUG9wdXBUb3VjaEludGVyY2VwdG9yIGltcGxlbWVudHMgT25Ub3VjaExpc3RlbmVyIHsKKyAgICAgICAgcHVibGljIGJvb2xlYW4gb25Ub3VjaChWaWV3IHYsIE1vdGlvbkV2ZW50IGV2ZW50KSB7CisgICAgICAgICAgICBmaW5hbCBpbnQgYWN0aW9uID0gZXZlbnQuZ2V0QWN0aW9uKCk7CisgICAgICAgICAgICBmaW5hbCBpbnQgeCA9IChpbnQpIGV2ZW50LmdldFgoKTsKKyAgICAgICAgICAgIGZpbmFsIGludCB5ID0gKGludCkgZXZlbnQuZ2V0WSgpOworICAgICAgICAgICAgCisgICAgICAgICAgICBpZiAoYWN0aW9uID09IE1vdGlvbkV2ZW50LkFDVElPTl9ET1dOICYmCisgICAgICAgICAgICAgICAgICAgIG1Qb3B1cCAhPSBudWxsICYmIG1Qb3B1cC5pc1Nob3dpbmcoKSAmJgorICAgICAgICAgICAgICAgICAgICAoeCA+PSAwICYmIHggPCBnZXRXaWR0aCgpICYm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AgIFR5cGVkQXJyYXkgYSA9IGNvbnRleHQub2J0YWluU3R5bGVkQXR0cmlidXRlcyhhdHRycywKICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5TcGlubmVyLCBkZWZTdHlsZSwgMCk7CiAgICAgICAgIAotICAgICAgICBtUHJvbXB0ID0gYS5nZXRTdHJpbmcoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuU3Bpbm5lcl9wcm9tcHQpOworICAgICAgICBmaW5hbCBpbnQgbW9kZSA9IGEuZ2V0SW50KGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLlNwaW5uZXJfc3Bpbm5lck1vZGUsCisgICAgICAgICAgICAgICAgTU9ERV9ESUFMT0cpOworICAgICAgICAKKyAgICAgICAgc3dpdGNoIChtb2RlKSB7CisgICAgICAgIGNhc2UgTU9ERV9ESUFMT0c6IHsKKyAgICAgICAgICAgIG1Qb3B1cCA9IG5ldyBEaWFsb2dQb3B1cCgpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGNhc2UgTU9ERV9EUk9QRE9XTjogeworICAgICAgICAgICAgZmluYWwgaW50IGhpbnRSZXNvdXJjZSA9IGEuZ2V0UmVzb3VyY2VJZCgKKyAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuU3Bpbm5lcl9wb3B1cFByb21wdFZpZXcsIDApOworCisgICAgICAgICAgICBEcm9wZG93blBvcHVwIHBvcHVwID0gbmV3IERyb3Bkb3duUG9wdXAoY29udGV4dCwgYXR0cnMsIGRlZlN0eWxlLCBoaW50UmVzb3VyY2UpOworCisgICAgICAgICAgICBwb3B1cC5zZXRCYWNrZ3JvdW5kRHJhd2FibGUoYS5nZXREcmF3YWJsZSgKKyAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWw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2V0VGl0bGUobVByb21wdCk7CisgICAgICAgICAgICBpZiAoIW1Qb3B1cC5pc1Nob3dpbmcoKSkgeworICAgICAgICAgICAgICAgIG1Qb3B1cC5zaG93KCk7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBtUG9wdXAgPSBidWlsZGVyLnNldFNpbmdsZUNob2ljZUl0ZW1zKGFkYXB0ZXIsIGdldFNlbGVjdGVkSXRlbVBvc2l0aW9uKCksIHRoaXMpLnNob3coKTsKICAgICAgICAgfQogCiAgICAgICAgIHJldHVybiBoYW5kbGVkOwpAQCAtMjcxLDcgKzMyMSw3IEBACiAgICAgICogQHBhcmFtIHByb21wdCB0aGUgcHJvbXB0IHRvIHNldAogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHNldFByb21wdChDaGFyU2VxdWVuY2UgcHJvbXB0KSB7Ci0gICAgICAgIG1Qcm9tcHQgPSBwcm9tcHQ7CisgICAgICAgIG1Qb3B1cC5zZXRQcm9tcHRUZXh0KHByb21wdCk7CiAgICAgfQogCiAgICAgLyoqCkBAIC0yNzksMTQgKzMyOSwxNCBAQAogICAgICAqIEBwYXJhbSBwcm9tcHRJZCB0aGUgcmVzb3VyY2UgSUQgb2YgdGhlIHByb21wdCB0byBkaXNwbGF5IHdoZW4gdGhlIGRpYWxvZyBpcyBzaG93bgogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHNldFByb21wdElkKGludCBwcm9tcHRJZCkgewotICAgICAgICBtUHJvbXB0ID0gZ2V0Q29udGV4dCgpLmdldFRleHQocHJvbXB0SWQpOworICAgICAgICBzZXRQcm9tcHQoZ2V0Q29udGV4dCgpLmdldFRleHQocHJvbXB0SWQpKTsKICAgICB9CiAKICAgICAvKioKICAgICAgKiBAcmV0dXJuIFRoZSBwcm9tcHQgdG8gZGlzcGxheSB3aGVuIHRoZSBkaWFsb2cgaXMgc2hvd24KICAgICAgKi8KICAgICBwdWJsaWMgQ2hhclNlcXVlbmNlIGdldFByb21wdCgpIHsKLSAgICAgICAgcmV0dXJuIG1Qcm9tcHQ7CisgICAgICAgIHJldHVybiBtUG9wdXAuZ2V0SGludFRleHQoKTsKICAgICB9CiAgICAgCiAgICAgLyoqCkBAIC0zODQsNCArNDM0LDEyMyBAQAogICAgICAgICAgICAgcmV0dXJuIGdldENvdW50KCkgPT0gMDsKICAgICAgICAgfQogICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBJbXBsZW1lbnRzIHNvbWUgc29ydCBvZiBwb3B1cCBzZWxlY3Rpb24gaW50ZXJmYWNlIGZvciBzZWxlY3RpbmcgYSBzcGlubmVyIG9wdGlvbi4KKyAgICAgKiBBbGxvd3MgZm9yIGRpZmZlcmVudCBzcGlubmVyIG1vZGVzLgorICAgICAqLworICAgIHByaXZhdGUgaW50ZXJmYWNlIFNwaW5uZXJQb3B1cCB7CisgICAgICAgIHB1YmxpYyB2b2lkIHNldEFkYXB0ZXIoTGlzdEFkYXB0ZXIgYWRhcHRlcik7CisgICAgICAgIAorICAgICAgICAvKioKKyAgICAgICAgICogU2hvdyB0aGUgcG9wdXAKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyB2b2lkIHNob3coKTsKKyAgICAgICAgCisgICAgICAgIC8qKgorICAgICAgICAgKiBEaXNtaXNzIHRoZSBwb3B1cAorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHZvaWQgZGlzbWlzcygpOworICAgICAgICAKKyAgICAgICAgLyoqCisgICAgICAgICAqIEByZXR1cm4gdHJ1ZSBpZiB0aGUgcG9wdXAgaXMgc2hvd2luZywgZmFsc2Ugb3RoZXJ3aXNlLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGJvb2xlYW4gaXNTaG93aW5nKCk7CisgICAgICAgIAorICAgICAgICAvKioKKyAgICAgICAgICogU2V0IGhpbnQgdGV4dCB0byBiZSBkaXNwbGF5ZWQgdG8gdGhlIHVzZXIuIFRoaXMgc2hvdWxkIHByb3ZpZGUKKyAgICAgICAgICogYSBkZXNjcmlwdGlvbiBvZiB0aGUgY2hvaWNlIGJlaW5nIG1hZGUuCisgICAgICAgICAqIEBwYXJhbSBoaW50VGV4dCBIaW50IHRleHQgdG8gc2V0LgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHZvaWQgc2V0UHJvbXB0VGV4dChDaGFyU2VxdWVuY2UgaGludFRleHQpOworICAgICAgICBwdWJsaWMgQ2hhclNlcXVlbmNlIGdldEhpbnRUZXh0KCk7CisgICAgfQorICAgIAorICAgIHByaXZhdGUgY2xhc3MgRGlhbG9nUG9wdXAgaW1wbGVtZW50cyBTcGlubmVyUG9wdXAsIERpYWxvZ0ludGVyZmFjZS5PbkNsaWNrTGlzdGVuZXIgeworICAgICAgICBwcml2YXRlIEFsZXJ0RGlhbG9nIG1Qb3B1cDsKKyAgICAgICAgcHJpdmF0ZSBMaXN0QWRhcHRlciBtTGlzdEFkYXB0ZXI7CisgICAgICAgIHByaXZhdGUgQ2hhclNlcXVlbmNlIG1Qcm9tcHQ7CisKKyAgICAgICAgcHVibGljIHZvaWQgZGlzbWlzcygpIHsKKyAgICAgICAgICAgIG1Qb3B1cC5kaXNtaXNzKCk7CisgICAgICAgICAgICBtUG9wdXAgPSBudWxsOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIGJvb2xlYW4gaXNTaG93aW5nKCkgeworICAgICAgICAgICAgcmV0dXJuIG1Qb3B1cCAhPSBudWxsID8gbVBvcHVwLmlzU2hvd2luZygpIDogZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBzZXRBZGFwdGVyKExpc3RBZGFwdGVyIGFkYXB0ZXIpIHsKKyAgICAgICAgICAgIG1MaXN0QWRhcHRlciA9IGFkYXB0ZXI7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBzZXRQcm9tcHRUZXh0KENoYXJTZXF1ZW5jZSBoaW50VGV4dCkgeworICAgICAgICAgICAgbVByb21wdCA9IGhpbnRUZXh0OworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBwdWJsaWMgQ2hhclNlcXVlbmNlIGdldEhpbnRUZXh0KCkgeworICAgICAgICAgICAgcmV0dXJuIG1Qcm9tcHQ7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBzaG93KCkgeworICAgICAgICAgICAgQWxlcnREaWFsb2cuQnVpbGRlciBidWlsZGVyID0gbmV3IEFsZXJ0RGlhbG9nLkJ1aWxkZXIoZ2V0Q29udGV4dCgpKTsKKyAgICAgICAgICAgIGlmIChtUHJvbXB0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBidWlsZGVyLnNldFRpdGxlKG1Qcm9tcHQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbVBvcHVwID0gYnVpbGRlci5zZXRTaW5nbGVDaG9pY2VJdGVtcyhtTGlzdEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgIGdldFNlbGVjdGVkSXRlbVBvc2l0aW9uKCksIHRoaXMpLnNob3coKTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgcHVibGljIHZvaWQgb25DbGljayhEaWFsb2dJbnRlcmZhY2UgZGlhbG9nLCBpbnQgd2hpY2gpIHsKKyAgICAgICAgICAgIHNldFNlbGVjdGlvbih3aGljaCk7CisgICAgICAgICAgICBkaXNtaXNzKCk7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHJpdmF0ZSBjbGFzcyBEcm9wZG93blBvcHVwIGV4dGVuZHMgTGlzdFBvcHVwV2luZG93IGltcGxlbWVudHMgU3Bpbm5lclBvcHVwIHsKKyAgICAgICAgcHJpdmF0ZSBDaGFyU2VxdWVuY2UgbUhpbnRUZXh0OworICAgICAgICBwcml2YXRlIFRleHRWaWV3IG1IaW50VmlldzsKKyAgICAgICAgcHJpdmF0ZSBpbnQgbUhpbnRSZXNvdXJjZTsKKyAgICAgICAgCisgICAgICAgIHB1YmxpYyBEcm9wZG93blBvcHVwKENvbnRleHQgY29udGV4dCwgQXR0cmlidXRlU2V0IGF0dHJzLAorICAgICAgICAgICAgICAgIGludCBkZWZTdHlsZVJlcywgaW50IGhpbnRSZXNvdXJjZSkgeworICAgICAgICAgICAgc3VwZXIoY29udGV4dCwgYXR0cnMsIDAsIGRlZlN0eWxlUmVzKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgbUhpbnRSZXNvdXJjZSA9IGhpbnRSZXNvdXJjZTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgc2V0QW5jaG9yVmlldyhTcGlubmVyLnRoaXMpOworICAgICAgICAgICAgc2V0TW9kYWwodHJ1ZSk7CisgICAgICAgICAgICBzZXRQcm9tcHRQb3NpdGlvbihQT1NJVElPTl9QUk9NUFRfQkVMT1cpOworICAgICAgICAgICAgc2V0T25JdGVtQ2xpY2tMaXN0ZW5lcihuZXcgT25JdGVtQ2xpY2tMaXN0ZW5lcigpIHsKKyAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkl0ZW1DbGljayhBZGFwdGVyVmlldyBwYXJlbnQsIFZpZXcgdiwgaW50IHBvc2l0aW9uLCBsb25nIGlkKSB7CisgICAgICAgICAgICAgICAgICAgIFNwaW5uZXIudGhpcy5zZXRTZWxlY3Rpb24ocG9zaXRpb24pOworICAgICAgICAgICAgICAgICAgICBkaXNtaXNzKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHB1YmxpYyBDaGFyU2VxdWVuY2UgZ2V0SGludFRleHQoKSB7CisgICAgICAgICAgICByZXR1cm4gbUhpbnRUZXh0OworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBwdWJsaWMgdm9pZCBzZXRQcm9tcHRUZXh0KENoYXJTZXF1ZW5jZSBoaW50VGV4dCkgeworICAgICAgICAgICAgbUhpbnRUZXh0ID0gaGludFRleHQ7CisgICAgICAgICAgICBpZiAobUhpbnRWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtSGludFZpZXcuc2V0VGV4dChoaW50VGV4dCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHB1YmxpYyB2b2lkIHNob3coKSB7CisgICAgICAgICAgICBpZiAobUhpbnRWaWV3ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBUZXh0VmlldyB0ZXh0VmlldyA9IChUZXh0VmlldykgTGF5b3V0SW5mbGF0ZXIuZnJvbShnZXRDb250ZXh0KCkpLmluZmxhdGUoCisgICAgICAgICAgICAgICAgICAgICAgICBtSGludFJlc291cmNlLCBudWxsKS5maW5kVmlld0J5SWQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC50ZXh0MSk7CisgICAgICAgICAgICAgICAgdGV4dFZpZXcuc2V0VGV4dChtSGludFRleHQpOworICAgICAgICAgICAgICAgIHNldFByb21wdFZpZXcodGV4dFZpZXcpOworICAgICAgICAgICAgICAgIG1IaW50VmlldyA9IHRleHRWaWV3OworICAgICAgICAgICAgfQorICAgICAgICAgICAgc3VwZXIuc2hvdygpOworICAgICAgICAgICAgZ2V0TGlzdFZpZXcoKS5zZXRDaG9pY2VNb2RlKExpc3RWaWV3LkNIT0lDRV9NT0RFX1NJTkdMRSk7CisgICAgICAgICAgICBzZXRTZWxlY3Rpb24oU3Bpbm5lci50aGlzLmdldFNlbGVjdGVkSXRlbVBvc2l0aW9uKCkpOworICAgICAgICB9CisgICAgfQogfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvd2lkZ2V0L1RleHRWaWV3LmphdmEgYi9jb3JlL2phdmEvYW5kcm9pZC93aWRnZXQvVGV4dFZpZXcuamF2YQppbmRleCBlNmVkNzBhLi4xNzk2N2Q5IDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC93aWRnZXQvVGV4dFZpZXcuamF2YQorKysgYi9jb3JlL2phdmEvYW5kcm9pZC93aWRnZXQvVGV4dFZpZXcuamF2YQpAQCAtMzIxLDYgKzMyMSw3IEBACiAgICAgICAgIHRoaXMoY29udGV4dCwgYXR0cnMsIGNvbS5hbmRyb2lkLmludGVybmFsLlIuYXR0ci50ZXh0Vmlld1N0eWxlKTsKICAgICB9CiAKKyAgICBAU3VwcHJlc3NXYXJuaW5ncygiZGVwcmVjYXRpb24iKQogICAgIHB1YmxpYyBUZXh0VmlldyhDb250ZXh0IGNvbnRleHQsCiAgICAgICAgICAgICAgICAgICAgIEF0dHJpYnV0ZVNldCBhdHRycywKICAgICAgICAgICAgICAgICAgICAgaW50IGRlZlN0eWxlKSB7CkBAIC03MTQsNyArNzE1LDcgQEAKICAgICAgICAgfQogCiAgICAgICAgIGlmIChpbnB1dE1ldGhvZCAhPSBudWxsKSB7Ci0gICAgICAgICAgICBDbGFzcyBjOworICAgICAgICAgICAgQ2xhc3M8Pz4gYzsKIAogICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICBjID0gQ2xhc3MuZm9yTmFtZShpbnB1dE1ldGhvZC50b1N0cmluZygpKTsKQEAgLTIzMzUsNiArMjMzNiw3IEBACiAgICAgICAgICAgICByZXR1cm4gc3RyICsgIn0iOwogICAgICAgICB9CiAKKyAgICAgICAgQFN1cHByZXNzV2FybmluZ3MoImhpZGluZyIpCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgUGFyY2VsYWJsZS5DcmVhdG9yPFNhdmVkU3RhdGU+IENSRUFUT1IKICAgICAgICAgICAgICAgICA9IG5ldyBQYXJjZWxhYmxlLkNyZWF0b3I8U2F2ZWRTdGF0ZT4oKSB7CiAgICAgICAgICAgICBwdWJsaWMgU2F2ZWRTdGF0ZSBjcmVhdGVGcm9tUGFyY2VsKFBhcmNlbCBpbikgewpAQCAtMjc1Niw2ICsyNzU4LDcgQEAKICAgICAgICAgICAgIHJldHVybiBtQ2hhcnNbb2ZmICsgbVN0YXJ0XTsKICAgICAgICAgfQogCisgICAgICAgIEBPdmVycmlkZQogICAgICAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgewogICAgICAgICAgICAgcmV0dXJuIG5ldyBTdHJpbmcobUNoYXJzLCBtU3RhcnQsIG1MZW5ndGgpOwogICAgICAgICB9CkBAIC0yNzgxLDYgKzI3ODQsMTQgQEAKICAgICAgICAgICAgIGMuZHJhd1RleHQobUNoYXJzLCBzdGFydCArIG1TdGFydCwgZW5kIC0gc3RhcnQsIHgsIHksIHApOwogICAgICAgICB9CiAKKyAgICAgICAgcHVibGljIHZvaWQgZHJhd1RleHRSdW4oQ2FudmFzIGMsIGludCBzdGFydCwgaW50IGVuZCwKKyAgICAgICAgICAgICAgICBpbnQgY29udGV4dFN0YXJ0LCBpbnQgY29udGV4dEVuZCwgZmxvYXQgeCwgZmxvYXQgeSwgaW50IGZsYWdzLCBQYWludCBwKSB7CisgICAgICAgICAgICBpbnQgY291bnQgPSBlbmQgLSBzdGFydDsKKyAgICAgICAgICAgIGludCBjb250ZXh0Q291bnQgPSBjb250ZXh0RW5kIC0gY29udGV4dFN0YXJ0OworICAgICAgICAgICAgYy5kcmF3VGV4dFJ1bihtQ2hhcnMsIHN0YXJ0ICsgbVN0YXJ0LCBjb3VudCwgY29udGV4dFN0YXJ0ICsgbVN0YXJ0LAorICAgICAgICAgICAgICAgICAgICBjb250ZXh0Q291bnQsIHgsIHksIGZsYWdzLCBwKTsKKyAgICAgICAgfQorCiAgICAgICAgIHB1YmxpYyBmbG9hdCBtZWFzdXJlVGV4dChpbnQgc3RhcnQsIGludCBlbmQsIFBhaW50IHApIHsKICAgICAgICAgICAgIHJldHVybiBwLm1lYXN1cmVUZXh0KG1DaGFycywgc3RhcnQgKyBtU3RhcnQsIGVuZCAtIHN0YXJ0KTsKICAgICAgICAgfQpAQCAtMjc4OCw2ICsyNzk5LDIzIEBACiAgICAgICAgIHB1YmxpYyBpbnQgZ2V0VGV4dFdpZHRocyhpbnQgc3RhcnQsIGludCBlbmQsIGZsb2F0W10gd2lkdGhzLCBQYWludCBwKSB7CiAgICAgICAgICAgICByZXR1cm4gcC5nZXRUZXh0V2lkdGhzKG1DaGFycywgc3RhcnQgKyBtU3RhcnQsIGVuZCAtIHN0YXJ0LCB3aWR0aHMpOwogICAgICAgICB9CisKKyAgICAgICAgcHVibGljIGZsb2F0IGdldFRleHRSdW5BZHZhbmNlcyhpbnQgc3RhcnQsIGludCBlbmQsIGludCBjb250ZXh0U3RhcnQsCisgICAgICAgICAgICAgICAgaW50IGNvbnRleHRFbmQsIGludCBmbGFncywgZmxvYXRbXSBhZHZhbmNlcywgaW50IGFkdmFuY2VzSW5kZXgsCisgICAgICAgICAgICAgICAgUGFpbnQgcCkgeworICAgICAgICAgICAgaW50IGNvdW50ID0gZW5kIC0gc3RhcnQ7CisgICAgICAgICAgICBpbnQgY29udGV4dENvdW50ID0gY29udGV4dEVuZCAtIGNvbnRleHRTdGFydDsKKyAgICAgICAgICAgIHJldHVybiBwLmdldFRleHRSdW5BZHZhbmNlcyhtQ2hhcnMsIHN0YXJ0ICsgbVN0YXJ0LCBjb3VudCwKKyAgICAgICAgICAgICAgICAgICAgY29udGV4dFN0YXJ0ICsgbVN0YXJ0LCBjb250ZXh0Q291bnQsIGZsYWdzLCBhZHZhbmNlcywKKyAgICAgICAgICAgICAgICAgICAgYWR2YW5jZXNJbmRleCk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgaW50IGdldFRleHRSdW5DdXJzb3IoaW50IGNvbnRleHRTdGFydCwgaW50IGNvbnRleHRFbmQsIGludCBmbGFncywKKyAgICAgICAgICAgICAgICBpbnQgb2Zmc2V0LCBpbnQgY3Vyc29yT3B0LCBQYWludCBwKSB7CisgICAgICAgICAgICBpbnQgY29udGV4dENvdW50ID0gY29udGV4dEVuZCAtIGNvbnRleHRTdGFydDsKKyAgICAgICAgICAgIHJldHVybiBwLmdldFRleHRSdW5DdXJzb3IobUNoYXJzLCBjb250ZXh0U3RhcnQgKyBtU3RhcnQsCisgICAgICAgICAgICAgICAgICAgIGNvbnRleHRDb3VudCwgZmxhZ3M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nQgPSBtUHJldlN0YXJ0OworICAgICAgICAgICAgdGhpcy5tUHJldkVuZCA9IG1QcmV2RW5kOworICAgICAgICAgICAgdGhpcy5tTmV3U3RhcnQgPSBtTmV3U3RhcnQ7CisgICAgICAgICAgICB0aGlzLm1OZXdFbmQgPSBtTmV3RW5kOwogICAgICAgICB9Ci0gICAgICAgIAorCisgICAgICAgIEBPdmVycmlkZQogICAgICAgICBwcm90ZWN0ZWQgdm9pZCBvblJlY2VpdmVSZXN1bHQoaW50IHJlc3VsdENvZGUsIEJ1bmRsZSByZXN1bHREYXRhKSB7Ci0gICAgICAgICAgICBpZiAocmVzdWx0Q29kZSAhPSBJbnB1dE1ldGhvZE1hbmFnZXIuUkVTVUxUX1NIT1dOKSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgaW50IGxlbiA9IG1UZXh0Lmxlbmd0aCgpOwotICAgICAgICAgICAgICAgIGlmIChtTmV3U3RhcnQgPiBsZW4pIHsKLSAgICAgICAgICAgICAgICAgICAgbU5ld1N0YXJ0ID0gbGVuOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAobU5ld0VuZCA+IGxlbikgewotICAgICAgICAgICAgICAgICAgICBtTmV3RW5kID0gbGVuOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBTZWxlY3Rpb24uc2V0U2VsZWN0aW9uKChTcGFubmFibGUpbVRleHQsIG1OZXdTdGFydCwgbU5ld0VuZCk7CisgICAgICAgICAgICBpbnQgc3RhcnQgPSBtTmV3U3RhcnQ7CisgICAgICAgICAgICBpbnQgZW5kID0gbU5ld0VuZDsKKworICAgICAgICAgICAgLy8gTW92ZSB0aGUgY3Vyc29yIHRvIHRoZSBuZXcgcG9zaXRpb24sIHVubGVzcyB0aGlzIHRhcCB3YXMgYWN0dWFsbHkKKyAgICAgICAgICAgIC8vIHVzZSB0byBzaG93IHRoZSBJTU0uIExlYXZlIGN1cnNvciB1bmNoYW5nZWQgaW4gdGhhdCBjYXNlLgorICAgICAgICAgICAgaWYgKHJlc3VsdENvZGUgPT0gSW5wdXRNZXRob2RNYW5hZ2VyLlJFU1VMVF9TSE9XTikgeworICAgICAgICAgICAgICAgIHN0YXJ0ID0gbVByZXZTdGFydDsKKyAgICAgICAgICAgICAgICBlbmQgPSBtUHJldkVuZDsKICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZmluYWwgaW50IGxlbiA9IG1UZXh0Lmxlbmd0aCgpOworICAgICAgICAgICAgaWYgKHN0YXJ0ID4gbGVuKSB7CisgICAgICAgICAgICAgICAgc3RhcnQgPSBsZW47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoZW5kID4gbGVuKSB7CisgICAgICAgICAgICAgICAgZW5kID0gbGVuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgU2VsZWN0aW9uLnNldFNlbGVjdGlvbigoU3Bhbm5hYmxlKW1UZXh0LCBzdGFydCwgZW5kKTsKICAgICAgICAgfQogICAgIH0KICAgICAKQEAgLTY1NjIsNyArNjYxMSw3IEBACiAgICAgICAgICAgICBtVG91Y2hGb2N1c1NlbGVjdGVkID0gZmFsc2U7CiAgICAgICAgICAgICBtU2Nyb2xsZWQgPSBmYWxzZTsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBmaW5hbCBib29sZWFuIHN1cGVyUmVzdWx0ID0gc3VwZXIub25Ub3VjaEV2ZW50KGV2ZW50KTsKIAogICAgICAgICAvKgpAQCAtNjU3NSw3ICs2NjI0LDggQEAKICAgICAgICAgICAgIHJldHVybiBzdXBlclJlc3VsdDsKICAgICAgICAgfQogCi0gICAgICAgIGlmICgobU1vdmVtZW50ICE9IG51bGwgfHwgb25DaGVja0lzVGV4dEVkaXRvcigpKSAmJiBtVGV4dCBpbnN0YW5jZW9mIFNwYW5uYWJsZSAmJiBtTGF5b3V0ICE9IG51bGwpIHsKKyAgICAgICAgaWYgKChtTW92ZW1lbnQgIT0gbnVsbCB8fCBvbkNoZWNrSXNUZXh0RWRpdG9yKCkpICYmCisgICAgICAgICAgICAgICAgbVRleHQgaW5zdGFuY2VvZiBTcGFubmFibGUgJiYgbUxheW91dCAhPSBudWxsKSB7CiAgICAgICAgICAgICAKICAgICAgICAgICAgIGJvb2xlYW4gaGFuZGxlZCA9IGZhbHNlOwogICAgICAgICAgICAgCkBAIC02NTkwLDI5ICs2NjQwLDE3IEBACiAgICAgICAgICAgICAgICAgaWYgKGFjdGlvbiA9PSBNb3Rpb25FdmVudC5BQ1RJT05fVVAgJiYgaXNGb2N1c2VkKCkgJiYgIW1TY3JvbGxlZCkgewogICAgICAgICAgICAgICAgICAgICBJbnB1dE1ldGhvZE1hbmFnZXIgaW1tID0gKElucHV0TWV0aG9kTWFuYWdlcikKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXRDb250ZXh0KCkuZ2V0U3lzdGVtU2VydmljZShDb250ZXh0LklOUFVUX01FVEhPRF9TRVJWSUNFKTsKLSAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgICAgIC8vIFRoaXMgaXMgZ29pbmcgdG8gYmUgZ3Jvc3MuLi4gIGlmIHRhcHBpbmcgb24gdGhlIHRleHQgdmlldwotICAgICAgICAgICAgICAgICAgICAvLyBjYXVzZXMgdGhlIElNRSB0byBiZSBkaXNwbGF5ZWQsIHdlIGRvbid0IHdhbnQgdGhlIHNlbGVjdGlvbgotICAgICAgICAgICAgICAgICAgICAvLyB0byBjaGFuZ2UuICBCdXQgdGhlIHNlbGVjdGlvbiBoYXMgYWxyZWFkeSBjaGFuZ2VkLCBhbmQKLSAgICAgICAgICAgICAgICAgICAgLy8gd2Ugd29uJ3Qga25vdyByaWdodCBhd2F5IHdoZXRoZXIgdGhlIElNRSBpcyBnZXR0aW5nCi0gICAgICAgICAgICAgICAgICAgIC8vIGRpc3BsYXllZCwgc28uLi4KLSAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgICAgIGludCBuZXdTZWxTdGFydCA9IFNlbGVjdGlvbi5nZXRTZWxlY3Rpb25TdGFydChtVGV4dCk7Ci0gICAgICAgICAgICAgICAgICAgIGludCBuZXdTZWxFbmQgPSBTZWxlY3Rpb24uZ2V0U2VsZWN0aW9uRW5kKG1UZXh0KTsKKworICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgbmV3U2VsU3RhcnQgPSBTZWxlY3Rpb24uZ2V0U2VsZWN0aW9uU3RhcnQobVRleHQpOworICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgbmV3U2VsRW5kID0gU2VsZWN0aW9uLmdldFNlbGVjdGlvbkVuZChtVGV4dCk7CisKICAgICAgICAgICAgICAgICAgICAgQ29tbWl0U2VsZWN0aW9uUmVjZWl2ZXIgY3NyID0gbnVsbDsKICAgICAgICAgICAgICAgICAgICAgaWYgKG5ld1NlbFN0YXJ0ICE9IG9sZFNlbFN0YXJ0IHx8IG5ld1NlbEVuZCAhPSBvbGRTZWxFbmQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNzciA9IG5ldyBDb21taXRTZWxlY3Rpb25SZWNlaXZlcigpOwotICAgICAgICAgICAgICAgICAgICAgICAgY3NyLm1OZXdTdGFydCA9IG5ld1NlbFN0YXJ0OwotICAgICAgICAgICAgICAgICAgICAgICAgY3NyLm1OZXdFbmQgPSBuZXdTZWxFbmQ7CisgICAgICAgICAgICAgICAgICAgICAgICBjc3IgPSBuZXcgQ29tbWl0U2VsZWN0aW9uUmVjZWl2ZXIob2xkU2VsU3RhcnQsIG9sZFNlbEVuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3U2VsU3RhcnQsIG5ld1NlbEVuZCk7CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgICAgIGlmIChpbW0uc2hvd1NvZnRJbnB1dCh0aGlzLCAwLCBjc3IpICYmIGNzciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGUgSU1FIG1pZ2h0IGdldCBzaG93biAtLSByZXZlcnQgdG8gdGhlIG9sZAotICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2VsZWN0aW9uLCBhbmQgY2hhbmdlIHRvIHRoZSBuZXcgd2hlbiB3ZSBmaW5hbGx5Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBmaW5kIG91dCBvZiBpdCBpcyBva2F5LgotICAgICAgICAgICAgICAgICAgICAgICAgU2VsZWN0aW9uLnNldFNlbGVjdGlvbigoU3Bhbm5hYmxlKW1UZXh0LCBvbGRTZWxTdGFydCwgb2xkU2VsRW5kKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZWQgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaGFuZGxlZCA9IGltbS5zaG93U29mdElucHV0KHRoaXMsIDAsIGNzcikgJiYgKGNzciAhPSBudWxsKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKQEAgLTY2NTcsNyArNjY5NSw3IEBACiAgICAgfQogCiAgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgQmxpbmsgZXh0ZW5kcyBIYW5kbGVyIGltcGxlbWVudHMgUnVubmFibGUgewotICAgICAgICBwcml2YXRlIFdlYWtSZWZlcmVuY2U8VGV4dFZpZXc+IG1WaWV3OworICAgICAgICBwcml2YXRlIGZpbmFsIFdlYWtSZWZlcmVuY2U8VGV4dFZpZXc+IG1WaWV3OwogICAgICAgICBwcml2YXRlIGJvb2xlYW4gbUNhbmNlbGxlZDsKIAogICAgICAgICBwdWJsaWMgQmxpbmsoVGV4dFZpZXcgdikgewpAQCAtNzI5MSw2ICs3MzI5LDcgQEAKICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgIH0KIAorICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBib29sZWFuIHBlcmZvcm1Mb25nQ2xpY2soKSB7CiAgICAgICAgIGlmIChzdXBlci5wZXJmb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mFtIGFuaW1hdGUgV2hldGhlciBvciBub3QgdG8gdXNlIHRoZSBpbiBhbmQgb3V0IGFuaW1hdGlvbnMsIGRlZmF1bHRzCisgICAgICogICAgICAgICAgICB0byB0cnVlLgorICAgICAqLworICAgIHZvaWQgc2hvd09ubHkoaW50IGNoaWxkSW5kZXgsIGJvb2xlYW4gYW5pbWF0ZSkgeworICAgICAgICBmaW5hbCBpbnQgY291bnQgPSBnZXRDaGlsZENvdW50KCk7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgeworICAgICAgICAgICAgZmluYWwgVmlldyBjaGlsZCA9IGdldENoaWxkQXQoaSk7CisgICAgICAgICAgICBpZiAoaSA9PSBjaGlsZEluZGV4KSB7CisgICAgICAgICAgICAgICAgaWYgKGFuaW1hdGUgJiYgbUluQW5pbWF0aW9uICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgY2hpbGQuc3RhcnRBbmltYXRpb24obUluQW5pbWF0aW9uKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY2hpbGQuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOworICAgICAgICAgICAgICAgIG1GaXJzdFRpbWUgPSBmYWxzZTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgaWYgKGFuaW1hdGUgJiYgbU91dEFuaW1hdGlvbiAhPSBudWxsICYmIGNoaWxkLmdldFZpc2liaWxpdHkoKSA9PSBWaWV3LlZJU0lCTEUpIHsKKyAgICAgICAgICAgICAgICAgICAgY2hpbGQuc3RhcnRBbmltYXRpb24obU91dEFuaW1hdGlvbik7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaGlsZC5nZXRBbmltYXRpb24oKSA9PSBtSW5BbmltYXRpb24pCisgICAgICAgICAgICAgICAgICAgIGNoaWxkLmNsZWFyQW5pbWF0aW9uKCk7CisgICAgICAgICAgICAgICAgY2hpbGQuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIC8qKgogICAgICAqIFNob3dzIG9ubHkgdGhlIHNwZWNpZmllZCBjaGlsZC4gVGhlIG90aGVyIGRpc3BsYXlzIFZpZXdzIGV4aXQgdGhlIHNjcmVlbgogICAgICAqIHdpdGggdGhlIHtAbGluayAjZ2V0T3V0QW5pbWF0aW9uKCkgb3V0IGFuaW1hdGlvbn0gYW5kIHRoZSBzcGVjaWZpZWQgY2hpbGQKICAgICAgKiBlbnRlcnMgdGhlIHNjcmVlbiB3aXRoIHRoZSB7QGxpbmsgI2dldEluQW5pbWF0aW9uKCkgaW4gYW5pbWF0aW9ufS4KQEAgLTEzNSwyNCArMTcwLDggQEAKICAgICAgKiBAcGFyYW0gY2hpbGRJbmRleCBUaGUgaW5kZXggb2YgdGhlIGNoaWxkIHRvIGJlIHNob3duLgogICAgICAqLwogICAgIHZvaWQgc2hvd09ubHkoaW50IGNoaWxkSW5kZXgpIHsKLSAgICAgICAgZmluYWwgaW50IGNvdW50ID0gZ2V0Q2hpbGRDb3VudCgpOwotICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKLSAgICAgICAgICAgIGZpbmFsIFZpZXcgY2hpbGQgPSBnZXRDaGlsZEF0KGkpOwotICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBjaGVja0ZvckZpcnN0ID0gKCFtRmlyc3RUaW1lIHx8IG1BbmltYXRlRmlyc3RUaW1lKTsKLSAgICAgICAgICAgIGlmIChpID09IGNoaWxkSW5kZXgpIHsKLSAgICAgICAgICAgICAgICBpZiAoY2hlY2tGb3JGaXJzdCAmJiBtSW5BbmltYXRpb24gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBjaGlsZC5zdGFydEFuaW1hdGlvbihtSW5BbmltYXRpb24pOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBjaGlsZC5zZXRWaXNpYmlsaX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uVmlldy5zZXREaXNwbGF5T3B0aW9ucyhvcHRpb25zKTsKKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgc2V0RGlzcGxheU9wdGlvbnMoaW50IG9wdGlvbnMsIGludCBtYXNrKSB7CisgICAgICAgIGZpbmFsIGludCBjdXJyZW50ID0gbUFjdGlvblZpZXcuZ2V0RGlzcGxheU9wdGlvbnMoKTsgCisgICAgICAgIG1BY3Rpb25WaWV3LnNldERpc3BsYXlPcHRpb25zKChvcHRpb25zICYgbWFzaykgfCAoY3VycmVudCAmIH5tYXNrKSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0QmFja2dyb3VuZERyYXdhYmxlKERyYXdhYmxlIGQpIHsKKyAgICAgICAgbUFjdGlvblZpZXcuc2V0QmFja2dyb3VuZERyYXdhYmxlKGQpOworICAgIH0KKworICAgIHB1YmxpYyBWaWV3IGdldEN1c3RvbU5hdmlnYXRpb25WaWV3KCkgeworICAgICAgICByZXR1cm4gbUFjdGlvblZpZXcuZ2V0Q3VzdG9tTmF2aWdhdGlvblZpZXcoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgQ2hhclNlcXVlbmNlIGdldFRpdGxlKCkgeworICAgICAgICByZXR1cm4gbUFjdGlvblZpZXcuZ2V0VGl0bGUoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgQ2hhclNlcXVlbmNlIGdldFN1YnRpdGxlKCkgeworICAgICAgICByZXR1cm4gbUFjdGlvblZpZXcuZ2V0U3VidGl0bGUoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldE5hdmlnYXRpb25Nb2RlKCkgeworICAgICAgICByZXR1cm4gbUFjdGlvblZpZXcuZ2V0TmF2aWdhdGlvbk1vZGUoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldERpc3BsYXlPcHRpb25zKCkgeworICAgICAgICByZXR1cm4gbUFjdGlvblZpZXcuZ2V0RGlzcGxheU9wdGlvbnMoKTsKKyAgICB9Cit9CmRp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sZWQpIHJldHVybjsKIAogICAgICAgICAvKgotICAgICAgICAgKiBJZiB3ZSdyZSBhbHJlYWR5IHdyaXRpbmcgYSBzbmFwc2hvdCwgZG9uJ3QgYm90aGVyIGVucXVlaW5nIGFub3RoZXIKKyAgICAgICAgICogSWYgd2UncmUgYWxyZWFkeSB3cml0aW5nIGEgc25hcHNob3QsIGRvbid0IGJvdGhlciBlbnF1ZXVlaW5nIGFub3RoZXIKICAgICAgICAgICogcmVxdWVzdCByaWdodCBub3cuIFRoaXMgd2lsbCByZWR1Y2UgdGhlIG51bWJlciBvZiBpbmRpdmlkdWFsCiAgICAgICAgICAqIHNuYXBzaG90cyBhbmQgaW4gdHVybiB0aGUgdG90YWwgYW1vdW50IG9mIG1lbW9yeSBjb25zdW1lZCAob25lIGJpZwogICAgICAgICAgKiBzbmFwc2hvdCBpcyBzbWFsbGVyIHRoYW4gTiBzdWJzZXQgc25hcHNob3RzKS4KICAgICAgICAgICovCi0gICAgICAgIGlmICghcGVuZGluZykgewotICAgICAgICAgICAgcGVuZGluZyA9IHRydWU7CisgICAgICAgIGlmIChwZW5kaW5nLmNvbXBhcmVBbmRTZXQoZmFsc2UsIHRydWUpKSB7CiAgICAgICAgICAgICBzbmFwc2hvdFdyaXRlci5leGVjdXRlKG5ldyBSdW5uYWJsZSgpIHsKICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyBkaXIgPSAiL3NkY2FyZC9zbmFwc2hvdHMiOwogICAgICAgICAgICAgICAgICAgICBpZiAoIWRpck1hZGUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBGaWxlKGRpcikubWtkaXJzKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV3IEZpbGUoZGlyKS5pc0RpcmVjdG9yeSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBGaWxlIGRpciA9IG5ldyBGaWxlKFNOQVBTSE9UX0RJUik7CisgICAgICAgICAgICAgICAgICAgICAgICBkaXIubWtkaXJzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgZGlyZWN0b3J5IG5lZWRzIHRvIGJlIHdyaXRhYmxlIHRvIGFueWJvZHkKKyAgICAgICAgICAgICAgICAgICAgICAgIGRpci5zZXRXcml0YWJsZSh0cnVlLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgZGlyZWN0b3J5IG5lZWRzIHRvIGJlIGV4ZWN1dGFibGUgdG8gYW55Ym9keQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gZG9uJ3Qga25vdyB3aHkgeWV0LCBidXQgbW9kZSA3MjMgd291bGQgd29yaywgd2hpbGUKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIG1vZGUgNzIyIHRocm93cyBGaWxlTm90Rm91bmRFeGVjcHRpb24gYXQgbGluZSAxNTEKKyAgICAgICAgICAgICAgICAgICAgICAgIGRpci5zZXRFeGVjdXRhYmxlKHRydWUsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXcgRmlsZShTTkFQU0hPVF9ESVIpLmlzRGlyZWN0b3J5KCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXJNYWRlID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiQ3JlYXRpb24gb2YgIiArIGRpciArICIgZmFpbGVkLiIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkNyZWF0aW9uIG9mICIgKyBTTkFQU0hPVF9ESVIgKyAiIGZhaWxlZC4iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZW5kaW5nLnNldChmYWxzZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZVNuYXBzaG90KGRpciwgbmFtZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZVNuYXBzaG90KFNOQVBTSE9UX0RJUiwgcHJvY2Vzc05hbWUsIHBhY2thZ2VJbmZvKTsKICAgICAgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBlbmRpbmcgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBlbmRpbmcuc2V0KGZhbHNlKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0pOwpAQCAtMTEwLDEzICsxMjMsMTMgQEAKICAgICAgKi8KICAgICBwdWJsaWMgc3RhdGljIHZvaWQgd3JpdGVaeWdvdGVTbmFwc2hvdCgpIHsKICAgICAgICAgaWYgKCFlbmFibGVkKSByZXR1cm47Ci0KLSAgICAgICAgU3RyaW5nIGRpciA9ICIvZGF0YS96eWdvdGUvc25hcHNob3RzIjsKLSAgICAgICAgbmV3IEZpbGUoZGlyKS5ta2RpcnMoKTsKLSAgICAgICAgd3JpdGVTbmFwc2hvdChkaXIsICJ6eWdvdGUiKTsKKyAgICAgICAgd3JpdGVTbmFwc2hvdCgienlnb3RlIiwgbnVsbCk7CiAgICAgfQogCi0gICAgcHJpdmF0ZSBzdGF0aWMgdm9pZCB3cml0ZVNuYXBzaG90KFN0cmluZyBkaXIsIFN0cmluZyBuYW1lKSB7CisgICAgLyoqCisgICAgICogcGFzcyBpbiBQYWNrYWdlSW5mbyB0byByZXRyaWV2ZSB2YXJpb3VzIHZhbHVlcyBmb3Igc25hcHNob3QgaGVhZGVyCisgICAgICovCisgICAgcHJpdmF0ZSBzdGF0aWMgdm9pZCB3cml0ZVNuYXBzaG90KFN0cmluZyBkaXIsIFN0cmluZyBwcm9jZXNzTmFtZSwgUGFja2FnZUluZm8gcGFja2FnZUluZm8pIHsKICAgICAgICAgYnl0ZVtdIHNuYXBzaG90ID0gU2FtcGxpbmdQcm9maWxlci5nZXRJbnN0YW5jZSgpLnNuYXBzaG90KCk7CiAgICAgICAgIGlmIChzbmFwc2hvdCA9PSBudWxsKSB7CiAgICAgICAgICAgICByZXR1cm47CkBAIC0xMjgsMzkgKzE0MSw1NCBAQAogICAgICAgICAgKiB3ZSBjYXB0dXJlIHR3byBzbmFwc2hvdHMgaW4gcmFwaWQgc3VjY2Vzc2lvbi4KICAgICAgICAgICovCiAgICAgICAgIGxvbmcgc3RhcnQgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKLSAgICAgICAgU3RyaW5nIHBhdGggPSBkaXIgKyAiLyIgKyBuYW1lLnJlcGxhY2UoJzonLCAnLicpICsgIi0iICsKLSAgICAgICAgICAgICAgICArIFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpICsgIi5zbmFwc2hvdCI7CisgICAgICAgIFN0cmluZyBuYW1lID0gcHJvY2Vzc05hbWUucmVwbGFjZUFsbCgiOiIsICIuIik7CisgICAgICAgIFN0cmluZyBwYXRoID0gZGlyICsgIi8iICsgbmFtZSArICItIiArU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkgKyAiLnNuYXBzaG90IjsKKyAgICAgICAgRmlsZU91dHB1dFN0cmVhbSBvdXQgPSBudWxsOwogICAgICAgICB0cnkgewotICAgICAgICAgICAgLy8gVHJ5IHRvIG9wZW4gdGhlIGZpbGUgYSBmZXcgdGltZXMuIFRoZSBTRCBjYXJkIG1heSBub3QgYmUgbW91bnRlZC4KLSAgICAgICAgICAgIEZpbGVPdXRwdXRTdHJlYW0gb3V0OwotICAgICAgICAgICAgaW50IGNvdW50ID0gMDsKLSAgICAgICAgICAgIHdoaWxlICh0cnVlKSB7Ci0gICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgb3V0ID0gbmV3IEZpbGVPdXRwdXRTdHJlYW0ocGF0aCk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEZpbGVOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICgrK2NvdW50ID4gMykgewotICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiQ291bGQgbm90IG9wZW4gIiArIHBhdGggKyAiLiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgLy8gU2xlZXAgZm9yIGEgYml0IGFuZCB0aGVuIHRyeSBhZ2Fpbi4KLSAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIFRocmVhZC5zbGVlcCgyNTAwKTsKLSAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoSW50ZXJydXB0ZWRFeGNlcHRpb24gZTEpIHsgLyogaWdub3JlICovIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgb3V0LndyaXRlKHNuYXBzaG90KTsKLSAgICAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICAgICAgb3V0LmNsb3NlKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBsb25nIGVsYXBzZWQgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSAtIHN0YXJ0OwotICAgICAgICAgICAgTG9nLmkoVEFHLCAiV3JvdGUgc25hcHNob3QgZm9yICIgKyBuYW1lCi0gICAgICAgICAgICAgICAgICAgICsgIiBpbiAiICsgZWxhcHNlZCArICJtcy4iKTsKKyAgICAgICAgICAgIG91dCA9IG5ldyBGaWxlT3V0cHV0U3RyZWFtKHBhdGgpOworICAgICAgICAgICAgZ2VuZXJhdGVTbmFwc2hvdEhlYWRlcihuYW1lLCBwYWNrYWdlSW5mbywgb3V0KTsKKyAgICAgICAgICAgIG91dC53cml0ZShzbmFwc2hvdCk7CiAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgIExvZy5lKFRBRywgIkVycm9yIHdyaXRpbmcgc25hcHNob3QuIiwgZSk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGlmKG91dCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG91dC5jbG9zZSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGV4KSB7CisgICAgICAgICAgICAgICAgLy8gbGV0IGl0IGdvLgorICAgICAgICAgICAgfQogICAgICAgICB9CisgICAgICAgIC8vIHNldCBmaWxlIHJlYWRhYmxlIHRvIHRoZSB3b3JsZCBzbyB0aGF0IFNhbXBsaW5nUHJvZmlsZXJTZXJ2aWNlCisgICAgICAgIC8vIGNhbiBwdXQgaXQgdG8gZHJvcGJveAorICAgICAgICBuZXcgRmlsZShwYXRoKS5zZXRSZWFkYWJsZSh0cnVlLCBmYWxzZSk7CisKKyAgICAgICAgbG9uZyBlbGFwc2VkID0gU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkgLSBzdGFydDsKKyAgICAgICAgTG9nLmkoVEFHLCAiV3JvdGUgc25hcHNob3QgZm9yICIgKyBuYW1lICsgIiBpbiAiICsgZWxhcHNlZCArICJtcy4iKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBnZW5lcmF0ZSBoZWFkZXIgZm9yIHNuYXBzaG90cywgd2l0aCB0aGUgZm9sbG93aW5nIGZvcm1hdCAobGlrZSBodHRwIGhlYWRlcik6CisgICAgICoKKyAgICAgKiBWZXJzaW9uOiA8dmVyc2lvbiBudW1iZXIgb2YgcHJvZ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b3Igc3RhcnRTeXN0ZW1TZXJ2ZXI+IjsKIApAQCAtMjg3LDcgKzI4Myw2IEBACiAKICAgICAgICAgICAgICAgICBpbnQgY291bnQgPSAwOwogICAgICAgICAgICAgICAgIFN0cmluZyBsaW5lOwotICAgICAgICAgICAgICAgIFN0cmluZyBtaXNzaW5nQ2xhc3NlcyA9IG51bGw7CiAgICAgICAgICAgICAgICAgd2hpbGUgKChsaW5lID0gYnIucmVhZExpbmUoKSkgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAvLyBTa2lwIGNvbW1lbnRzIGFuZCBibGFuayBsaW5lcy4KICAgICAgICAgICAgICAgICAgICAgbGluZSA9IGxpbmUudHJpbSgpOwpAQCAtMzExLDEyICszMDYsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgY291bnQrKzsKICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoQ2xhc3NOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJDbGFzcyBub3QgZm91bmQgZm9yIHByZWxvYWRpbmc6ICIgKyBsaW5lKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtaXNzaW5nQ2xhc3NlcyA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWlzc2luZ0NsYXNzZXMgPSBsaW5lOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaXNzaW5nQ2xhc3NlcyArPSAiICIgKyBsaW5lOwotICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiQ2xhc3Mgbm90IGZvdW5kIGZvciBwcmVsb2FkaW5nOiAiICsgbGluZSk7CiAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFRocm93YWJsZSB0KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJFcnJvciBwcmVsb2FkaW5nICIgKyBsaW5lICsgIi4iLCB0KTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0IGluc3RhbmNlb2YgRXJyb3IpIHsKQEAgLTMyOSwxMyArMzE5LDYgQEAKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgIGlmIChUSFJPV19PTl9NSVNTSU5HX1BSRUxPQUQgJiYKLSAgICAgICAgICAgICAgICAgICAgbWlzc2luZ0NsYXNzZXMgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJNaXNzaW5nIGNsYXNzKGVzKSBmb3IgcHJlbG9hZGluZywgdXBkYXRlIHByZWxvYWRlZC1jbGFzc2VzIFsiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBtaXNzaW5nQ2xhc3NlcyArICJdIik7Ci0gICAgICAgICAgICAgICAgfQotCiAgICAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiLi4ucHJlbG9hZGVkICIgKyBjb3VudCArICIgY2xhc3NlcyBpbiAiCiAgICAgICAgICAgICAgICAgICAgICAgICArIChTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKS1zdGFydFRpbWUpICsgIm1zLiIpOwogICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgewpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL3V0aWwvSGllcmFyY2hpY2FsU3RhdGVNYWNoaW5lLmphdmEgYi9jb3JlL2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdXRpbC9IaWVyYXJjaGljYWxTdGF0ZU1hY2hpbmUuamF2YQppbmRleCBjNTk5ZDY4Li43MTM4YjVjIDEwM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A7CitpbXBvcnQgamF2YS51dGlsLkhhc2hTZXQ7CiBpbXBvcnQgamF2YS51dGlsLkl0ZXJhdG9yOwogaW1wb3J0IGphdmEudXRpbC5MaXN0OwogaW1wb3J0IGphdmEudXRpbC5NYXA7CkBAIC0yODQsNiArMjg1LDI2IEBACiAKICAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAibGlzdCIpOwogICAgIH0KKyAgICAKKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIHZvaWQgd3JpdGVTZXRYbWwoU2V0IHZhbCwgU3RyaW5nIG5hbWUsIFhtbFNlcmlhbGl6ZXIgb3V0KQorICAgICAgICAgICAgdGhyb3dzIFhtbFB1bGxQYXJzZXJFeGNlcHRpb24sIGphdmEuaW8uSU9FeGNlcHRpb24geworICAgICAgICBpZiAodmFsID09IG51bGwpIHsKKyAgICAgICAgICAgIG91dC5zdGFydFRhZyhudWxsLCAibnVsbCIpOworICAgICAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAibnVsbCIpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBvdXQuc3RhcnRUYWcobnVsbCwgInNldCIpOworICAgICAgICBpZiAobmFtZSAhPSBudWxsKSB7CisgICAgICAgICAgICBvdXQuYXR0cmlidXRlKG51bGwsICJuYW1lIiwgbmFtZSk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGZvciAoT2JqZWN0IHYgOiB2YWwpIHsKKyAgICAgICAgICAgIHdyaXRlVmFsdWVYbWwodiwgbnVsbCwgb3V0KTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAic2V0Iik7CisgICAgfQogCiAgICAgLyoqCiAgICAgICogRmxhdHRlbiBhIGJ5dGVbXSBpbnRvIGFuIFhtbFNlcmlhbGl6ZXIuICBUaGUgbGlzdCBjYW4gbGF0ZXIgYmUgcmVhZCBiYWNrCkBAIC00MjYsNiArNDQ3LDkgQEAKICAgICAgICAgfSBlbHNlIGlmICh2IGluc3RhbmNlb2YgTGlzdCkgewogICAgICAgICAgICAgd3JpdGVMaXN0WG1sKChMaXN0KXYsIG5hbWUsIG91dCk7CiAgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0gZWxzZSBpZiAodiBpbnN0YW5jZW9mIFNldCkgeworICAgICAgICAgICAgd3JpdGVTZXRYbWwoKFNldCl2LCBuYW1lLCBvdXQpOworICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9IGVsc2UgaWYgKHYgaW5zdGFuY2VvZiBDaGFyU2VxdWVuY2UpIHsKICAgICAgICAgICAgIC8vIFhYWCBUaGlzIGlzIHRvIGFsbG93IHVzIHRvIGF0IGxlYXN0IHdyaXRlIHNvbWV0aGluZyBpZgogICAgICAgICAgICAgLy8gd2UgZW5jb3VudGVyIHN0eWxlZCB0ZXh0Li4uICBidXQgaXQgbWVhbnMgd2Ugd2lsbCBkcm9wIGFsbApAQCAtNDc2LDcgKzUwMCw3IEBACiAgICAgICoKICAgICAgKiBAcGFyYW0gaW4gVGhlIElucHV0U3RyZWFtIGZyb20gd2hpY2ggdG8gcmVhZC4KICAgICAgKgotICAgICAqIEByZXR1cm4gSGFzaE1hcCBUaGUgcmVzdWx0aW5nIGxpc3QuCisgICAgICogQHJldHVybiBBcnJheUxpc3QgVGhlIHJlc3VsdGluZyBsaXN0LgogICAgICAqCiAgICAgICogQHNlZSAjcmVhZE1hcFhtbAogICAgICAqIEBzZWUgI3JlYWRWYWx1ZVhtbApAQCAtNDkwLDYgKzUxNCwyOSBAQAogICAgICAgICBwYXJzZXIuc2V0SW5wdXQoaW4sIG51bGwpOwogICAgICAgICByZXR1cm4gKEFycmF5TGlzdClyZWFkVmFsdWVYbWwocGFyc2VyLCBuZXcgU3RyaW5nWzFdKTsKICAgICB9CisgICAgCisgICAgCisgICAgLyoqCisgICAgICogUmVhZCBhIEhhc2hTZXQgZnJvbSBhbiBJbnB1dFN0cmVhbSBjb250YWluaW5nIF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yAgICAgICAgICAgIHRocm93cyBYbWxQdWxsUGFyc2VyRXhjZXB0aW9uLCBqYXZhLmlvLklPRXhjZXB0aW9uIHsKKyAgICAgICAgSGFzaFNldCBzZXQgPSBuZXcgSGFzaFNldCgpOworICAgICAgICAKKyAgICAgICAgaW50IGV2ZW50VHlwZSA9IHBhcnNlci5nZXRFdmVudFR5cGUoKTsKKyAgICAgICAgZG8geworICAgICAgICAgICAgaWYgKGV2ZW50VHlwZSA9PSBwYXJzZXIuU1RBUlRfVEFHKSB7CisgICAgICAgICAgICAgICAgT2JqZWN0IHZhbCA9IHJlYWRUaGlzVmFsdWVYbWwocGFyc2VyLCBuYW1lKTsKKyAgICAgICAgICAgICAgICBzZXQuYWRkKHZhbCk7CisgICAgICAgICAgICAgICAgLy9TeXN0ZW0ub3V0LnByaW50bG4oIkFkZGluZyB0byBzZXQ6ICIgKyB2YWwpOworICAgICAgICAgICAgfSBlbHNlIGlmIChldmVudFR5cGUgPT0gcGFyc2VyLkVORF9UQUcpIHsKKyAgICAgICAgICAgICAgICBpZiAocGFyc2VyLmdldE5hbWUoKS5lcXVhbHMoZW5kVGFnKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2V0OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgWG1sUHVsbFBhcnNlckV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICJFeHBlY3RlZCAiICsgZW5kVGFnICsgIiBlbmQgdGFnIGF0OiAiICsgcGFyc2VyLmdldE5hbWUoKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBldmVudFR5cGUgPSBwYXJzZXIubmV4dCgpOworICAgICAgICB9IHdoaWxlIChldmVudFR5cGUgIT0gcGFyc2VyLkVORF9ET0NVTUVOVCk7CisgICAgICAgIAorICAgICAgICB0aHJvdyBuZXcgWG1sUHVsbFBhcnNlckV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAiRG9jdW1lbnQgZ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YWRkKGludCB0aXRsZVJlcykgeworICAgICAgICByZXR1cm4gYWRkKDAsIDAsIDAsIHRpdGxlUmVzKTsKKyAgICB9CisKKyAgICBwdWJsaWMgTWVudUl0ZW0gYWRkKGludCBncm91cElkLCBpbnQgaXRlbUlkLCBpbnQgb3JkZXIsIGludCB0aXRsZVJlcykgeworICAgICAgICByZXR1cm4gYWRkKGdyb3VwSWQsIGl0ZW1JZCwgb3JkZXIsIG1Db250ZXh0LmdldFJlc291cmNlcygpLmdldFN0cmluZyh0aXRsZVJlcykpOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgTWVudUl0ZW0gYWRkKGludCBncm91cElkLCBpbnQgaXRlbUlkLCBpbnQgb3JkZXIsIENoYXJTZXF1ZW5jZSB0aXRsZSkgeworICAgICAgICBBY3Rpb25NZW51SXRlbSBpdGVtID0gbmV3IEFjdGlvbk1lbnVJdGVtKGdldENvbnRleHQoKSwKKyAgICAgICAgICAgICAgICBncm91cElkLCBpdGVtSWQsIDAsIG9yZGVyLCB0aXRsZSk7CisgICAgICAgIG1JdGVtcy5hZGQob3JkZXIsIGl0ZW0pOworICAgICAgICByZXR1cm4gaXRlbTsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGFkZEludGVudE9wdGlvbnMoaW50IGdyb3VwSWQsIGludCBpdGVtSWQsIGludCBvcmRlciwKKyAgICAgICAgICAgIENvbXBvbmVudE5hbWUgY2FsbGVyLCBJbnRlbnRbXSBzcGVjaWZpY3MsIEludGVudCBpbnRlbnQsIGludCBmbGFncywKKyAgICAgICAgICAgIE1lbnVJdGVtW10gb3V0U3BlY2lmaWNJdGVtcykgeworICAgICAgICBQYWNrYWdlTWFuYWdlciBwbSA9IG1Db250ZXh0LmdldFBhY2thZ2VNYW5hZ2VyKCk7CisgICAgICAgIGZpbmFsIExpc3Q8UmVzb2x2ZUluZm8+IGxyaSA9CisgICAgICAgICAgICAgICAgcG0ucXVlcnlJbnRlbnRBY3Rpdml0eU9wdGlvbnMoY2FsbGVyLCBzcGVjaWZpY3MsIGludGVudCwgMCk7CisgICAgICAgIGZpbmFsIGludCBOID0gbHJpICE9IG51bGwgPyBscmkuc2l6ZSgpIDogMDsKKworICAgICAgICBpZiAoKGZsYWdzICYgRkxBR19BUFBFTkRfVE9fR1JPVVApID09IDApIHsKKyAgICAgICAgICAgIHJlbW92ZUdyb3VwKGdyb3VwSWQpOworICAgICAgICB9CisKKyAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgZmluYWwgUmVzb2x2ZUluZm8gcmkgPSBscmkuZ2V0KGkpOworICAgICAgICAgICAgSW50ZW50IHJpbnRlbnQgPSBuZXcgSW50ZW50KAorICAgICAgICAgICAgICAgIHJpLnNwZWNpZmljSW5kZXggPCAwID8gaW50ZW50IDogc3BlY2lmaWNzW3JpLnNwZWNpZmljSW5kZXhdKTsKKyAgICAgICAgICAgIHJpbnRlbnQuc2V0Q29tcG9uZW50KG5ldyBDb21wb25lbnROYW1lKAorICAgICAgICAgICAgICAgICAgICByaS5hY3Rpdml0eUluZm8uYXBwbGljYXRpb25JbmZvLnBhY2thZ2VOYW1lLAorICAgICAgICAgICAgICAgICAgICByaS5hY3Rpdml0eUluZm8ubmFtZSkpOworICAgICAgICAgICAgZmluYWwgTWVudUl0ZW0gaXRlbSA9IGFkZChncm91cElkLCBpdGVtSWQsIG9yZGVyLCByaS5sb2FkTGFiZWwocG0pKQorICAgICAgICAgICAgICAgICAgICAuc2V0SWNvbihyaS5sb2FkSWNvbihwbSkpCisgICAgICAgICAgICAgICAgICAgIC5zZXRJbnRlbnQocmludGVudCk7CisgICAgICAgICAgICBpZiAob3V0U3BlY2lmaWNJdGVtcyAhPSBudWxsICYmIHJpLnNwZWNpZmljSW5kZXggPj0gMCkgeworICAgICAgICAgICAgICAgIG91dFNwZWNpZmljSXRlbXNbcmkuc3BlY2lmaWNJbmRleF0gPSBpdGVtOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIE47CisgICAgfQorCisgICAgcHVibGljIFN1Yk1lbnUgYWRkU3ViTWVudShDaGFyU2VxdWVuY2UgdGl0bGUpIHsKKyAgICAgICAgLy8gVE9ETyBJbXBsZW1lbnQgc3VibWVudXMKKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgcHVibGljIFN1Yk1lbnUgYWRkU3ViTWVudShpbnQgdGl0bGVSZXMpIHsKKyAgICAgICAgLy8gVE9ETyBJbXBsZW1lbnQgc3VibWVudXMKKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgcHVibGljIFN1Yk1lbnUgYWRkU3ViTWVudShpbnQgZ3JvdXBJZCwgaW50IGl0ZW1JZCwgaW50IG9yZGVyLAorICAgICAgICAgICAgQ2hhclNlcXVlbmNlIHRpdGxlKSB7CisgICAgICAgIC8vIFRPRE8gSW1wbGVtZW50IHN1Ym1lbnVzCisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIHB1YmxpYyBTdWJNZW51IGFkZFN1Yk1lbnUoaW50IGdyb3VwSWQsIGludCBpdGVtSWQsIGludCBvcmRlciwgaW50IHRpdGxlUmVzKSB7CisgICAgICAgIC8vIFRPRE8gSW1wbGVtZW50IHN1Ym1lbnVzCisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGNsZWFyKCkgeworICAgICAgICBtSXRlbXMuY2xlYXIoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBjbG9zZSgpIHsKKyAgICB9CisgICAgCisgICAgcHJpdmF0ZSBpbnQgZmluZEl0ZW1JbmRleChpbnQgaWQpIHsKKyAgICAgICAgZmluYWwgQXJyYXlMaXN0PEFjdGlvbk1lbnVJdGVtPiBpdGVtcyA9IG1JdGVtczsKKyAgICAgICAgZmluYWwgaW50IGl0ZW1Db3VudCA9IGl0ZW1zLnNpemUoKTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBpdGVtQ291bnQ7IGkrKykgeworICAgICAgICAgICAgaWYgKGl0ZW1zLmdldChpKS5nZXRJdGVtSWQoKSA9PSBpZCkgeworICAgICAgICAgICAgICAgIHJldHVybiBpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgICAgcHVibGljIE1lbnVJdGVtIGZpbmRJdGVtKGludCBpZCkgeworICAgICAgICByZXR1cm4gbUl0ZW1zLmdldChmaW5kSXRlbUluZGV4KGlkKSk7CisgICAgfQorCisgICAgcHVibGljIE1lbnVJdGVtIGdldEl0ZW0oaW50IGluZGV4KSB7CisgICAgICAgIHJldHVybiBtSXRlbXMuZ2V0KGluZGV4KTsKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBoYXNWaXNpYmxlSXRlbXMoKSB7CisgICAgICAgIGZpbmFsIEFycmF5TGlzdDxBY3Rpb25NZW51SXRlbT4gaXRlbXMgPSBtSXRlbXM7CisgICAgICAgIGZpbmFsIGludCBpdGVtQ291bnQgPSBpdGVtcy5zaXplKCk7CisgICAgICAgIAorICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGl0ZW1Db3VudDsgaSsrKSB7CisgICAgICAgICAgICBpZiAoaXRlbXMuZ2V0KGkpLmlzVmlzaWJsZSgpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisgICAgCisgICAgcHJpdmF0ZSBBY3Rpb25NZW51SXRlbSBmaW5kSXRlbVdpdGhTaG9ydGN1dChpbnQga2V5Q29kZSwgS2V5RXZlbnQgZXZlbnQpIHsKKyAgICAgICAgLy8gVE9ETyBNYWtlIHRoaXMgc21hcnRlci4KKyAgICAgICAgZmluYWwgYm9vbGVhbiBxd2VydHkgPSBtSXNRd2VydHk7CisgICAgICAgIGZpbmFsIEFycmF5TGlzdDxBY3Rpb25NZW51SXRlbT4gaXRlbXMgPSBtSXRlbXM7CisgICAgICAgIGZpbmFsIGludCBpdGVtQ291bnQgPSBpdGVtcy5zaXplKCk7CisgICAgICAgIAorICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGl0ZW1Db3VudDsgaSsrKSB7CisgICAgICAgICAgICBBY3Rpb25NZW51SXRlbSBpdGVtID0gaXRlbXMuZ2V0KGkpOworICAgICAgICAgICAgZmluYWwgY2hhciBzaG9ydGN1dCA9IHF3ZXJ0eSA/IGl0ZW0uZ2V0QWxwaGFiZXRpY1Nob3J0Y3V0KCkgOgorICAgICAgICAgICAgICAgICAgICBpdGVtLmdldE51bWVyaWNTaG9ydGN1dCgpOworICAgICAgICAgICAgaWYgKGtleUNvZGUgPT0gc2hvcnRjdXQpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gaXRlbTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBpc1Nob3J0Y3V0S2V5KGludCBrZXlDb2RlLCBLZXlFdmVudCBldmVudCkgeworICAgICAgICByZXR1cm4gZmluZEl0ZW1XaXRoU2hvcnRjdXQoa2V5Q29kZSwgZXZlbnQpICE9IG51bGw7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gcGVyZm9ybUlkZW50aWZpZXJBY3Rpb24oaW50IGlkLCBpbnQgZmxhZ3MpIHsKKyAgICAgICAgZmluYWwgaW50IGluZGV4ID0gZmluZEl0ZW1JbmRleChpZCk7CisgICAgICAgIGlmIChpbmRleCA8IDApIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBtSXRlbXMuZ2V0KGluZGV4KS5pbnZva2UoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBwZXJmb3JtU2hvcnRjdXQoaW50IGtleUNvZGUsIEtleUV2ZW50IGV2ZW50LCBpbnQgZmxhZ3MpIHsKKyAgICAgICAgQWN0aW9uTWVudUl0ZW0gaXRlbSA9IGZpbmRJdGVtV2l0aFNob3J0Y3V0KGtleUNvZGUsIGV2ZW50KTsKKyAgICAgICAgaWYgKGl0ZW0gPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICByZXR1cm4gaXRlbS5pbnZva2UoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCByZW1vdmVHcm91cChpbnQgZ3JvdXBJZCkgeworICAgICAgICBmaW5hbCBBcnJheUxpc3Q8QWN0aW9uTWVudUl0ZW0+IGl0ZW1zID0gbUl0ZW1zOworICAgICAgICBpbnQgaXRlbUNvdW50ID0gaXRlbXMuc2l6ZSgpOworICAgICAgICBpbnQgaSA9IDA7CisgICAgICAgIHdoaWxlIChpIDwgaXRlbUNvdW50KSB7CisgICAgICAgICAgICBpZiAoaXRlbXMuZ2V0KGkpLmdldEdyb3VwSWQoKSA9PSBncm91cElkKSB7CisgICAgICAgICAgICAgICAgaXRlbXMucmVtb3ZlKGkpOworICAgICAgICAgICAgICAgIGl0ZW1Db3VudC0tOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBpKys7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCByZW1vdmVJdGVtKGludCBpZCkgeworICAgICAgICBtSXRlbXMucmVtb3ZlKGZpbmRJdGVtSW5kZXgoaWQpKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRHcm91cENoZWNrYWJsZShpbnQgZ3JvdXAsIGJvb2xlYW4gY2hlY2thYmxlLAorICAgICAgICAgICAgYm9vbGVhbiBleGNsdXNpdmUpIHsKKyAgICAgICAgZmluYWwgQXJyYXlMaXN0PEFjdGlvbk1lbnVJdGVtPiBpdGVtcyA9IG1JdGVtczsKKyAgICAgICAgZmluYWwgaW50IGl0ZW1Db3VudCA9IGl0ZW1zLnNpemUoKTsKKyAgICAgICAgCisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgaXRlbUNvdW50OyBpKyspIHsKKyAgICAgICAgICAgIEFjdGlvbk1lbnVJdGVtIGl0ZW0gPSBpdGVtcy5nZXQoaSk7CisgICAgICAgICAgICBpZiAoaXRlbS5nZXRHcm91cElkKCkgPT0gZ3JvdXApIHsKKyAgICAgICAgICAgICAgICBpdGVtLnNldENoZWNrYWJsZShjaGVja2FibGUpOworICAgICAgICAgICAgICAgIGl0ZW0uc2V0RXhjbHVzaXZlQ2hlY2thYmxlKGV4Y2x1c2l2ZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRHcm91cEVuYWJsZWQoaW50IGdyb3VwLCBib29sZWFuIGVuYWJsZWQpIHsKKyAgICAgICAgZmluYWwgQXJyYXlMaXN0PEFjdGlvbk1lbnVJdGVtPiBpdGVtcyA9IG1JdGVtczsKKyAgICAgICAgZmluYWwgaW50IGl0ZW1Db3VudCA9IGl0ZW1zLnNpemUoKTsKKyAgICAgICAgCisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgaXRlbUNvdW50OyBpKyspIHsKKyAgICAgICAgICAgIEFjdGlvbk1lbnVJdGVtIGl0ZW0gPSBpdGVtcy5nZXQoaSk7CisgICAgICAgICAgICBpZiAoaXRlbS5nZXRHcm91cElkKCkgPT0gZ3JvdXApIHsKKyAgICAgICAgICAgICAgICBpdGVtLnNldEVuYWJsZWQoZW5hYmxlZCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRHcm91cFZpc2libGUoaW50IGdyb3VwLCBib29sZWFuIHZpc2libGUpIHsKKyAgICAgICAgZmluYWwgQXJyYXlMaXN0PEFjdGlvbk1lbnVJdGVtPiBpdGVtcyA9IG1JdGVtczsKKyAg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mluYWwgaW50IEhJRERFTiAgICAgICAgID0gMHgwMDAwMDAwODsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgRU5BQkxFRCAgICAgICAgPSAweDAwMDAwMDEwOworICAgIAorICAgIHB1YmxpYyBBY3Rpb25NZW51SXRlbShDb250ZXh0IGNvbnRleHQsIGludCBncm91cCwgaW50IGlkLCBpbnQgY2F0ZWdvcnlPcmRlciwgaW50IG9yZGVyaW5nLAorICAgICAgICAgICAgQ2hhclNlcXVlbmNlIHRpdGxlKSB7CisgICAgICAgIG1Db250ZXh0ID0gY29udGV4dDsKKyAgICAgICAgbUlkID0gaWQ7CisgICAgICAgIG1Hcm91cCA9IGdyb3VwOworICAgICAgICBtQ2F0ZWdvcnlPcmRlciA9IGNhdGVnb3J5T3JkZXI7CisgICAgICAgIG1PcmRlcmluZyA9IG9yZGVyaW5nOworICAgICAgICBtVGl0bGUgPSB0aXRsZTsKKyAgICB9CisgICAgCisgICAgcHVibGljIGNoYXIgZ2V0QWxwaGFiZXRpY1Nob3J0Y3V0KCkgeworICAgICAgICByZXR1cm4gbVNob3J0Y3V0QWxwaGFiZXRpY0NoYXI7CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRHcm91cElkKCkgeworICAgICAgICByZXR1cm4gbUdyb3VwOworICAgIH0KKworICAgIHB1YmxpYyBEcmF3YWJsZSBnZXRJY29uKCkgeworICAgICAgICByZXR1cm4gbUljb25EcmF3YWJsZTsKKyAgICB9CisKKyAgICBwdWJsaWMgSW50ZW50IGdldEludGVudCgpIHsKKyAgICAgICAgcmV0dXJuIG1JbnRlbnQ7CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRJdGVtSWQoKSB7CisgICAgICAgIHJldHVybiBtSWQ7CisgICAgfQorCisgICAgcHVibGljIENvbnRleHRNZW51SW5mbyBnZXRNZW51SW5mbygpIHsKKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgcHVibGljIGNoYXIgZ2V0TnVtZXJpY1Nob3J0Y3V0KCkgeworICAgICAgICByZXR1cm4gbVNob3J0Y3V0TnVtZXJpY0NoYXI7CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRPcmRlcigpIHsKKyAgICAgICAgcmV0dXJuIG1PcmRlcmluZzsKKyAgICB9CisKKyAgICBwdWJsaWMgU3ViTWVudSBnZXRTdWJNZW51KCkgeworICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICBwdWJsaWMgQ2hhclNlcXVlbmNlIGdldFRpdGxlKCkgeworICAgICAgICByZXR1cm4gbVRpdGxlOworICAgIH0KKworICAgIHB1YmxpYyBDaGFyU2VxdWVuY2UgZ2V0VGl0bGVDb25kZW5zZWQoKSB7CisgICAgICAgIHJldHVybiBtVGl0bGVDb25kZW5zZWQ7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaGFzU3ViTWVudSgpIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGlzQ2hlY2thYmxlKCkgeworICAgICAgICByZXR1cm4gKG1GbGFncyAmIENIRUNLQUJMRSkgIT0gMDsgCisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaXNDaGVja2VkKCkgeworICAgICAgICByZXR1cm4gKG1GbGFncyAmIENIRUNLRUQpICE9IDA7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaXNFbmFibGVkKCkgeworICAgICAgICByZXR1cm4gKG1GbGFncyAmIEVOQUJMRUQpICE9IDA7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaXNWaXNpYmxlKCkgeworICAgICAgICByZXR1cm4gKG1GbGFncyAmIEhJRERFTikgPT0gMDsKKyAgICB9CisKKyAgICBwdWJsaWMgTWVudUl0ZW0gc2V0QWxwaGFiZXRpY1Nob3J0Y3V0KGNoYXIgYWxwaGFDaGFyKSB7CisgICAgICAgIG1TaG9ydGN1dEFscGhhYmV0aWNDaGFyID0gYWxwaGFDaGFyOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwdWJsaWMgTWVudUl0ZW0gc2V0Q2hlY2thYmxlKGJvb2xlYW4gY2hlY2thYmxlKSB7CisgICAgICAgIG1GbGFncyA9IChtRmxhZ3MgJiB+Q0hFQ0tBQkxFKSB8IChjaGVja2FibGUgPyBDSEVDS0FCTEUgOiAwKTsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBBY3Rpb25NZW51SXRlbSBzZXRFeGNsdXNpdmVDaGVja2FibGUoYm9vbGVhbiBleGNsdXNpdmUpIHsKKyAgICAgICAgbUZsYWdzID0gKG1GbGFncyAmIH5FWENMVVNJVkUpIHwgKGV4Y2x1c2l2ZSA/IEVYQ0xVU0lWRSA6IDApOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwdWJsaWMgTWVudUl0ZW0gc2V0Q2hlY2tlZChib29sZWFuIGNoZWNrZWQpIHsKKyAgICAgICAgbUZsYWdzID0gKG1GbGFncyAmIH5DSEVDS0VEKSB8IChjaGVja2VkID8gQ0hFQ0tFRCA6IDApOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwdWJsaWMgTWVudUl0ZW0gc2V0RW5hYmxlZChib29sZWFuIGVuYWJsZWQpIHsKKyAgICAgICAgbUZsYWdzID0gKG1GbGFncyAmIH5FTkFCTEVEKSB8IChlbmFibGVkID8gRU5BQkxFRCA6IDApOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwdWJsaWMgTWVudUl0ZW0gc2V0SWNvbihEcmF3YWJsZSBpY29uKSB7CisgICAgICAgIG1JY29uRHJhd2FibGUgPSBpY29uOworICAgICAgICBtSWNvblJlc0lkID0gTk9fSUNPTjsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIE1lbnVJdGVtIHNldEljb24oaW50IGljb25SZXMpIHsKKyAgICAgICAgbUljb25SZXNJZCA9IGljb25SZXM7CisgICAgICAgIG1JY29uRHJhd2FibGUgPSBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXREcmF3YWJsZShpY29uUmVzKTsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIE1lbnVJdGVtIHNldEludGVudChJbnRlbnQgaW50ZW50KSB7CisgICAgICAgIG1JbnRlbnQgPSBpbnRlbnQ7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIHB1YmxpYyBNZW51SXRlbSBzZXROdW1lcmljU2hvcnRjdXQoY2hhciBudW1lcmljQ2hhcikgeworICAgICAgICBtU2hvcnRjdXROdW1lcmljQ2hhciA9IG51bWVyaWNDaGFyOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwdWJsaWMgTWVudUl0ZW0gc2V0T25NZW51SXRlbUNsaWNrTGlzdGVuZXIoT25NZW51SXRlbUNsaWNrTGlzdGVuZXIgbWVudUl0ZW1DbGlja0xpc3RlbmVyKSB7CisgICAgICAgIG1DbGlja0xpc3RlbmVyID0gbWVudUl0ZW1DbGlja0xpc3RlbmVyOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwdWJsaWMgTWVudUl0ZW0gc2V0U2hvcnRjdXQoY2hhciBudW1lcmljQ2hhciwgY2hhciBhbHBoYUNoYXIpIHsKKyAgICAgICAgbVNob3J0Y3V0TnVtZXJpY0NoYXIgPSBudW1lcmljQ2hhcjsKKyAgICAgICAgbVNob3J0Y3V0QWxwaGFiZXRpY0NoYXIgPSBhbHBoYUNoYXI7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIHB1YmxpYyBNZW51SXRlbSBzZXRUaXRsZShDaGFyU2VxdWVuY2UgdGl0bGUpIHsKKyAgICAgICAgbVRpdGxlID0gdGl0bGU7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIHB1YmxpYyBNZW51SXRlbSBzZXRUaXRsZShpbnQgdGl0bGUpIHsKKyAgICAgICAgbVRpdGxlID0gbUNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0U3RyaW5nKHRpdGxlKTsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIE1lbnVJdGVtIHNldFRpdGxlQ29uZGVuc2VkKENoYXJTZXF1ZW5jZSB0aXRsZSkgeworICAgICAgICBtVGl0bGVDb25kZW5zZWQgPSB0aXRsZTsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIE1lbnVJdGVtIHNldFZpc2libGUoYm9vbGVhbiB2aXNpYmxlKSB7CisgICAgICAgIG1GbGFncyA9IChtRmxhZ3MgJiBISURERU4pIHwgKHZpc2libGUgPyAwIDogSElEREVOKTsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaW52b2tlKCkgeworICAgICAgICBpZiAobUNsaWNrTGlzdGVuZXIgIT0gbnVsbCAmJiBtQ2xpY2tMaXN0ZW5lci5vbk1lbnVJdGVtQ2xpY2sodGhpcykpIHsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAobUludGVudCAhPSBudWxsKSB7CisgICAgICAgICAgICBtQ29udGV4dC5zdGFydEFjdGl2aXR5KG1JbnRlbnQpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9Cit9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdmlldy9tZW51L0FjdGlvbk1lbnVJdGVtVmlldy5qYXZhIGIvY29yZS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL3ZpZXcvbWVudS9BY3Rpb25NZW51SXRlbVZpZXcuamF2YQpuZXcgZmlsZSBtb2R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mlidXRlU2V0IGF0dHJzLCBpbnQgZGVmU3R5bGUpIHsKKyAgICAgICAgc3VwZXIoY29udGV4dCwgYXR0cnMsIGRlZlN0eWxlKTsKKyAgICB9CisKKyAgICBwdWJsaWMgTWVudUl0ZW1JbXBsIGdldEl0ZW1EYXRhKCkgeworICAgICAgICByZXR1cm4gbUl0ZW1EYXRhOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGluaXRpYWxpemUoTWVudUl0ZW1JbXBsIGl0ZW1EYXRhLCBpbnQgbWVudVR5cGUpIHsKKyAgICAgICAgbUl0ZW1EYXRhID0gaXRlbURhdGE7CisgICAgICAgIAorICAgICAgICBzZXRDbGlja2FibGUodHJ1ZSk7CisgICAgICAgIHNldEZvY3VzYWJsZSh0cnVlKTsKKyAgICAgICAgc2V0VGl0bGUoaXRlbURhdGEuZ2V0VGl0bGUoKSk7CisgICAgICAgIHNldEljb24oaXRlbURhdGEuZ2V0SWNvbigpKTsKKyAgICAgICAgc2V0SWQoaXRlbURhdGEuZ2V0SXRlbUlkKCkpOworICAgICAgICAKKyAgICAgICAgc2V0VmlzaWJpbGl0eShpdGVtRGF0YS5pc1Zpc2libGUoKSA/IFZpZXcuVklTSUJMRSA6IFZpZXcuR09ORSk7CisgICAgICAgIHNldEVuYWJsZWQoaXRlbURhdGEuaXNFbmFibGVkKCkpOworICAgIH0KKyAgICAKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgYm9vbGVhbiBwZXJmb3JtQ2xpY2soKSB7CisgICAgICAgIC8vIExldCB0aGUgdmlldydzIGxpc3RlbmVyIGhhdmUgdG9wIHByaW9yaXR5CisgICAgICAgIGlmIChzdXBlci5wZXJmb3JtQ2xpY2soKSkgeworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmIChtSXRlbUludm9rZXIgIT0gbnVsbCAmJiBtSXRlbUludm9rZXIuaW52b2tlSXRlbShtSXRlbURhdGEpKSB7CisgICAgICAgICAgICBwbGF5U291bmRFZmZlY3QoU291bmRFZmZlY3RDb25zdGFudHMuQ0xJQ0spOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgc2V0SXRlbUludm9rZXIoTWVudUJ1aWxkZXIuSXRlbUludm9rZXIgaW52b2tlcikgeworICAgICAgICBtSXRlbUludm9rZXIgPSBpbnZva2VyOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIHByZWZlcnNDb25kZW5zZWRUaXRsZSgpIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldENoZWNrYWJsZShib29sZWFuIGNoZWNrYWJsZSkgeworICAgICAgICAvLyBUT0RPIFN1cHBvcnQgY2hlY2thYmxlIGFjdGlvbiBpdGVtcworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldENoZWNrZWQoYm9vbGVhbiBjaGVja2VkKSB7CisgICAgICAgIC8vIFRPRE8gU3VwcG9ydCBjaGVja2FibGUgYWN0aW9uIGl0ZW1zCisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0SWNvbihEcmF3YWJsZSBpY29uKSB7CisgICAgICAgIHNldEltYWdlRHJhd2FibGUoaWNvbik7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0U2hvcnRjdXQoYm9vbGVhbiBzaG93U2hvcnRjdXQsIGNoYXIgc2hvcnRjdXRLZXkpIHsKKyAgICAgICAgLy8gQWN0aW9uIGJ1dHRvbnMgZG9uJ3Qgc2hvdyB0ZXh0IGZvciBzaG9ydGN1dCBrZXlzLgorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFRpdGxlKENoYXJTZXF1ZW5jZSB0aXRsZSkgeworICAgICAgICBtVGl0bGUgPSB0aXRsZTsKKyAgICB9CisKKyAgICB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GV4dCwgbnVsbCk7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBBY3Rpb25NZW51VmlldyhDb250ZXh0IGNvbnRleHQsIEF0dHJpYnV0ZVNldCBhdHRycykgeworICAgICAgICBzdXBlcihjb250ZXh0LCBhdHRycyk7CisgICAgICAgIAorICAgICAgICBUeXBlZEFycmF5IGEgPSBjb250ZXh0Lm9idGFpblN0eWxlZEF0dHJpYnV0ZXMoYXR0cnMsCisgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuVGhlbWUpOworICAgICAgICBtSXRlbVBhZGRpbmcgPSBhLmdldERpbWVuc2lvblBpeGVsT2Zmc2V0KAorICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLlRoZW1lX2FjdGlvbkJ1dHRvblBhZGRpbmcsIDApOworICAgICAgICBtSXRlbU1hcmdpbiA9IG1JdGVtUGFkZGluZyAvIDI7CisgICAgICAgIGEucmVjeWNsZSgpOworICAgICAgICAKKyAgICAgICAgZmluYWwgUmVzb3VyY2VzIHJlcyA9IGdldFJlc291cmNlcygpOworICAgICAgICBmaW5hbCBpbnQgc2l6ZSA9IHJlcy5nZXREaW1lbnNpb25QaXhlbFNpemUoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5kaW1lbi5hY3Rpb25faWNvbl9zaXplKTsKKyAgICAgICAgZmluYWwgaW50IHNwYWNlQXZhaWxhYmxlID0gcmVzLmdldERpc3BsYXlNZXRyaWNzKCkud2lkdGhQaXhlbHMgLyAyOworICAgICAgICBmaW5hbCBpbnQgaXRlbVNwYWNlID0gc2l6ZSArIG1JdGVtUGFkZGluZzsgCisgICAgICAgIAorICAgICAgICBtTWF4SXRlbXMgPSBzcGFjZUF2YWlsYWJsZSAvIChpdGVtU3BhY2UgPiAwID8gaXRlbVNwYWNlIDogMSk7CisgICAgfQorICAgIAorICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZC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isgICAgCisgICAgcHVibGljIGludCBnZXRJdGVtTWFyZ2luKCkgeworICAgICAgICByZXR1cm4gbUl0ZW1NYXJnaW47CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaW52b2tlSXRlbShNZW51SXRlbUltcGwgaXRlbSkgeworICAgICAgICByZXR1cm4gbU1lbnUucGVyZm9ybUl0ZW1BY3Rpb24oaXRlbSwgMCk7CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRXaW5kb3dBbmltYXRpb25zKCkgeworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBpbml0aWFsaXplKE1lbnVCdWlsZGVyIG1lbnUsIGludCBtZW51VHlwZSkgeworICAgICAgICBtZW51LnNldE1heEFjdGlvbkl0ZW1zKG1NYXhJdGVtcyk7CisgICAgICAgIG1NZW51ID0gbWVudTsKKyAgICAgICAgdXBkYXRlQ2hpbGRyZW4odHJ1ZSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdXBkYXRlQ2hpbGRyZW4oYm9vbGVhbiBjbGVhcmVkKSB7CisgICAgICAgIHJlbW92ZUFsbFZpZXdzKCk7CisgICAgICAgIAorICAgICAgICBmaW5hbCBBcnJheUxpc3Q8TWVudUl0ZW1JbXBsPiBpdGVtc1RvU2hvdyA9IG1NZW51LmdldEFjdGlvbkl0ZW1zKCk7CisgICAgICAgIGZpbmFsIGludCBpdGVtQ291bnQgPSBpdGVtc1RvU2hvdy5zaXplKCk7CisgICAgICAgIAorICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGl0ZW1Db3VudDsgaSsrKSB7CisgICAgICAgICAgICBmaW5hbCBNZW51SXRlbUltcGwgaXRlbURhdGEgPSBpdGVtc1RvU2hvdy5nZXQoaSk7CisgICAgICAgICAgICBhZGRJdGVtVmlldygoQWN0aW9uTWVudUl0ZW1WaWV3KSBpdGVtRGF0YS5nZXRJdGVtVmlldyhNZW51QnVpbGRlci5UWVBFX0FDVElPTl9CVVRUT04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ICAgICAKKyAgICAgICAgZmluYWwgQXJyYXlMaXN0PE1lbnVJdGVtSW1wbD4gdmlzaWJsZUl0ZW1zID0gZ2V0VmlzaWJsZUl0ZW1zKCk7CisgICAgICAgIGZpbmFsIGludCBpdGVtc1NpemUgPSB2aXNpYmxlSXRlbXMuc2l6ZSgpOworICAgICAgICBpbnQgbWF4QWN0aW9ucyA9IG1NYXhBY3Rpb25JdGVtczsKKyAgICAgICAgCisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgaXRlbXNTaXplOyBpKyspIHsKKyAgICAgICAgICAgIE1lbnVJdGVtSW1wbCBpdGVtID0gdmlzaWJsZUl0ZW1zLmdldChpKTsKKyAgICAgICAgICAgIGlmIChpdGVtLnJlcXVpcmVzQWN0aW9uQnV0dG9uKCkpIHsKKyAgICAgICAgICAgICAgICBtYXhBY3Rpb25zLS07CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIC8vIEZsYWcgYXMgbWFueSBtb3JlIHJlcXVlc3RlZCBpdGVtcyBhcyB3aWxsIGZpdC4KKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBpdGVtc1NpemU7IGkrKykgeworICAgICAgICAgICAgTWVudUl0ZW1JbXBsIGl0ZW0gPSB2aXNpYmxlSXRlbXMuZ2V0KGkpOworICAgICAgICAgICAgaWYgKGl0ZW0ucmVxdWVzdHNBY3Rpb25CdXR0b24oKSkgeworICAgICAgICAgICAgICAgIGl0ZW0uc2V0SXNBY3Rpb25CdXR0b24obWF4QWN0aW9ucyA+IDApOworICAgICAgICAgICAgICAgIG1heEFjdGlvbnMtLTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgbUFjdGlvbkl0ZW1zLmNsZWFyKCk7CisgICAgICAgIG1Ob25BY3Rpb25JdGVtcy5jbGVhcigpOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGl0ZW1zU2l6ZTsgaSsrKSB7CisgIC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ZSBhbiBpY29uICovCiAgICAgc3RhdGljIGZpbmFsIGludCBOT19JQ09OID0gMDsKQEAgLTYzMCw0ICs2MzksMzUgQEAKICAgICBwdWJsaWMgYm9vbGVhbiBzaG91bGRTaG93SWNvbihpbnQgbWVudVR5cGUpIHsKICAgICAgICAgcmV0dXJuIG1lbnVUeXBlID09IE1lbnVCdWlsZGVyLlRZUEVfSUNPTiB8fCBtTWVudS5nZXRPcHRpb25hbEljb25zVmlzaWJsZSgpOwogICAgIH0KKyAgICAKKyAgICBwdWJsaWMgYm9vbGVhbiBpc0FjdGlvbkJ1dHRvbigpIHsKKyAgICAgICAgcmV0dXJuIChtRmxhZ3MgJiBJU19BQ1RJT04pID09IElTX0FDVElPTiB8fCByZXF1aXJlc0FjdGlvbkJ1dHRvbigpOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgYm9vbGVhbiByZXF1ZXN0c0FjdGlvbkJ1dHRvbigpIHsKKyAgICAgICAgcmV0dXJuIG1TaG93QXNBY3Rpb24gPT0gU0hPV19BU19BQ1RJT05fSUZfUk9PTTsKKyAgICB9CisgICAgCisgICAgcHVibGljIGJvb2xlYW4gcmVxdWlyZXNBY3Rpb25CdXR0b24oKSB7CisgICAgICAgIHJldHVybiBtU2hvd0FzQWN0aW9uID09IFNIT1dfQVNfQUNUSU9OX0FMV0FZUzsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRJc0FjdGlvbkJ1dHRvbihib29sZWFuIGlzQWN0aW9uQnV0dG9uKSB7CisgICAgICAgIGlmIChpc0FjdGlvbkJ1dHRvbikgeworICAgICAgICAgICAgbUZsYWdzIHw9IElTX0FDVElPTjsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG1GbGFncyAmPSB+SVNfQUNUSU9OOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIFVzZWQgYnkgTWVudUluZmxhdGVyIHRvIHNldCBob3cgdGhpcyBpdGVtIHNob3VsZCBkaXNw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VzZWQgZm9yIHRoZSBzdW1tYXJ5IGluZm8gaW4gdGhlIGhlYWRlci4KLSAgICAgICAgU3RyaW5nW10gQ09MVU1OUyA9IG5ldyBTdHJpbmdbXSB7Ci0gICAgICAgICAgICBDb250YWN0cy5fSUQsCi0gICAgICAgICAgICBDb250YWN0cy5MT09LVVBfS0VZLAotICAgICAgICAgICAgQ29udGFjdHMuUEhPVE9fSUQsCi0gICAgICAgICAgICBDb250YWN0cy5ESVNQTEFZX05BTUUsCi0gICAgICAgICAgICBDb250YWN0cy5QSE9ORVRJQ19OQU1FLAotICAgICAgICAgICAgQ29udGFjdHMuU1RBUlJFRCwKLSAgICAgICAgICAgIENvbnRhY3RzLkNPTlRBQ1RfUFJFU0VOQ0UsCi0gICAgICAgICAgICBDb250YWN0cy5DT05UQUNUX1NUQVRVUywKLSAgICAgICAgICAgIENvbnRhY3RzLkNPTlRBQ1RfU1RBVFVTX1RJTUVTVEFNUCwKLSAgICAgICAgICAgIENvbnRhY3RzLkNPTlRBQ1RfU1RBVFVTX1JFU19QQUNLQUdFLAotICAgICAgICAgICAgQ29udGFjdHMuQ09OVEFDVF9TVEFUVVNfTEFCRUwsCi0gICAgICAgIH07Ci0gICAgICAgIGludCBfSUQgPSAwOwotICAgICAgICBpbnQgTE9PS1VQX0tFWSA9IDE7Ci0gICAgICAgIGludCBQSE9UT19JRCA9IDI7Ci0gICAgICAgIGludCBESVNQTEFZX05BTUUgPSAzOwotICAgICAgICBpbnQgUEhPTkVUSUNfTkFNRSA9IDQ7Ci0gICAgICAgIC8vVE9ETzogV2UgbmVlZCB0byBmaWd1cmUgb3V0IGhvdyB3ZSdyZSBnb2luZyB0byBnZXQgdGhlIHBob25ldGljIG5hbWUuCi0gICAgICAgIC8vc3RhdGljIGZpbmFsIGludCBIRUFERVJfUEhPTkVUSUNfTkFNRV9DT0xVTU5fSU5ERVgKLSAgICAgICAgaW50IFNUQVJSRUQgPSA1OwotICAgICAgICBpbnQgQ09OVEFDVF9QUkVT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9iamVjdCBjb29raWUsIEN1cnNvciBjdXJzb3IpIHsKLSAgICAgICAgICAgIHRyeXsKLSAgICAgICAgICAgICAgICBpZiAodGhpcyAhPSBtUXVlcnlIYW5kbGVyKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIm9uUXVlcnlDb21wbGV0ZTogZGlzY2FyZCByZXN1bHQsIHRoZSBxdWVyeSBoYW5kbGVyIGlzIHJlc2V0ISIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgc3dpdGNoICh0b2tlbikgewotICAgICAgICAgICAgICAgICAgICBjYXNlIFRPS0VOX1BIT1RPX1FVRVJZOiB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvL1NldCB0aGUgcGhvdG8KLSAgICAgICAgICAgICAgICAgICAgICAgIEJpdG1hcCBwaG90b0JpdG1hcCA9IG51bGw7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3Vyc29yICE9IG51bGwgJiYgY3Vyc29yLm1vdmVUb0ZpcnN0KCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWN1cnNvci5pc051bGwoUGhvdG9RdWVyeS5QSE9UTykpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlW10gcGhvdG9EYXRhID0gY3Vyc29yLmdldEJsb2IoUGhvdG9RdWVyeS5QSE9UTyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGhvdG9CaXRtYXAgPSBCaXRtYXBGYWN0b3J5LmRlY29kZUJ5dGVBcnJheShwaG90b0RhdGEsIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaG90b0RhdGEubGVuZ3RoLCBudWxsKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBob3RvQml0bWFwID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaG90b0JpdG1hcCA9IGxvYWRQbGFjZWhvbGRlclBob3RvKG51bGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgbVBob3RvVmlldy5zZXRJbWFnZUJpdG1hcChwaG90b0JpdG1hcCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29va2llICE9IG51bGwgJiYgY29va2llIGluc3RhbmNlb2YgVXJpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVBob3RvVmlldy5hc3NpZ25Db250YWN0VXJpKChVcmkpIGNvb2tpZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBjYXNlIFRPS0VOX0NPTlRBQ1RfSU5GTzogewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnNvciAhPSBudWxsICYmIGN1cnNvci5tb3ZlVG9GaXJzdCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYmluZENvbnRhY3RJbmZvKGN1cnNvcik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgVXJpIGxvb2t1cFVyaSA9IENvbnRhY3RzLmdldExvb2t1cFVyaShjdXJzb3IuZ2V0TG9uZyhDb250YWN0UXVlcnkuX0lEKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvci5nZXRTdHJpbmcoQ29udGFjdFF1ZXJ5LkxPT0tVUF9LRVkpKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGxvbmcgcGhvdG9JZCA9IGN1cnNvci5nZXRMb25nKENvbnRhY3RRdWVyeS5QSE9UT19JRCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocGhvdG9JZCA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1QaG90b1ZpZXcuc2V0SW1hZ2VCaXRtYXAobG9hZFBsYWNlaG9sZGVyUGhvdG8obnVsbCkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29va2llICE9IG51bGwgJiYgY29va2llIGluc3RhbmNlb2YgVXJpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUGhvdG9WaWV3LmFzc2lnbkNvbnRhY3RVcmkoKFVyaSkgY29va2llKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRQaG90b1F1ZXJ5KHBob3RvSWQsIGxvb2t1cFVyaSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSAvKiBkb24ndCByZXNldCBxdWVyeSBoYW5kbGVyICovKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNob3VsZG4ndCByZWFsbHkgaGFwcGVuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0RGlzcGxheU5hbWUobnVsbCwgbnVsbCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0U29jaWFsU25pcHBldChudWxsKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRQaG90byhsb2FkUGxhY2Vob2xkZXJQaG90byhudWxsKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBjYXNlIFRPS0VOX1BIT05FX0xPT0tVUDogewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnNvciAhPSBudWxsICYmIGN1cnNvci5tb3ZlVG9GaXJzdCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9uZyBjb250YWN0SWQgPSBjdXJzb3IuZ2V0TG9uZyhQSE9ORV9MT09LVVBfQ09OVEFDVF9JRF9DT0xVTU5fSU5ERVgpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBsb29rdXBLZXkgPSBjdXJzb3IuZ2V0U3RyaW5nKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUEhPTkVfTE9PS1VQX0NPTlRBQ1RfTE9PS1VQX0tFWV9DT0xVTU5fSU5ERVgpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJpbmRGcm9tQ29udGFjdFVyaUludGVybmFsKENvbnRhY3RzLmdldExvb2t1cFVyaShjb250YWN0SWQsIGxvb2t1cEtleSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSAvKiBkb24ndCByZXNldCBxdWVyeSBoYW5kbGVyICovKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHBob25lTnVtYmVyID0gKFN0cmluZykgY29va2llOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldERpc3BsYXlOYW1lKHBob25lTnVtYmVyLCBudWxsKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRTb2NpYWxTbmlwcGV0KG51bGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFBob3RvKGxvYWRQbGFjZWhvbGRlclBob3RvKG51bGwpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUGhvdG9WaWV3LmFzc2lnbkNvbnRhY3RGcm9tUGhvbmUocGhvbmVOdW1iZXIsIHRydWUpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgY2FzZSBUT0tFTl9FTUFJTF9MT09LVVA6IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXJzb3IgIT0gbnVsbCAmJiBjdXJzb3IubW92ZVRvRmlyc3QoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvbmcgY29udGFjdElkID0gY3Vyc29yLmdldExvbmcoRU1BSUxfTE9PS1VQX0NPTlRBQ1RfSURfQ09MVU1OX0lOREVYKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgbG9va3VwS2V5ID0gY3Vyc29yLmdldFN0cmluZygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVNQUlMX0xPT0tVUF9DT05UQUNUX0xPT0tVUF9LRVlfQ09MVU1OX0lOREVYKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaW5kRnJvbUNvbnRhY3RVcmlJbnRlcm5hbChDb250YWN0cy5nZXRMb29rdXBVcmkoY29udGFjdElkLCBsb29rdXBLZXkpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UgLyogZG9uJ3QgcmVzZXQgcXVlcnkgaGFuZGxlciAqLyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBlbWFpbEFkZHJlc3MgPSAoU3RyaW5nKSBjb29raWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0RGlzcGxheU5hbWUoZW1haWxBZGRyZXNzLCBudWxsKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRTb2NpYWxTbmlwcGV0KG51bGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFBob3RvKGxvYWRQbGFjZWhvbGRlclBob3RvKG51bGwpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUGhvdG9WaWV3LmFzc2lnbkNvbnRhY3RGcm9tRW1haWwoZW1haWxBZGRyZXNzLCB0cnVlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgICAgICBpZiAoY3Vyc29yICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgY3Vyc29yLmNsb3NlKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogVHVybiBvbi9vZmYgc2hvd2luZyBvZiB0aGUgYWdncmVnYXRlIGJhZGdlIGVsZW1lbnQuCi0gICAgICovCi0gICAgcHVibGljIHZvaWQgc2hvd0FnZ3JlZ2F0ZUJhZGdlKGJvb2xlYW4gc2hvd0JhZ2RlKSB7Ci0gICAgICAgIG1BZ2dyZWdhdGVCYWRnZS5zZXRWaXNpYmlsaXR5KHNob3dCYWdkZSA/IFZpZXcuVklTSUJMRSA6IFZpZXcuR09ORSk7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogVHVybiBvbi9vZmYgc2hvd2luZyBvZiB0aGUgc3RhciBlbGVtZW50LgotICAgICAqLwotICAgIHB1YmxpYyB2b2lkIHNob3dTdGFyKGJvb2xlYW4gc2hvd1N0YXIpIHsKLSAgICAgICAgbVN0YXJyZWRWaWV3LnNldFZpc2liaWxpdHkoc2hvd1N0YXIgPyBWaWV3LlZJU0lCTEUgOiBWaWV3LkdPTkUpOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIE1hbnVhbGx5IHNldCB0aGUgc3RhcnJlZCBzdGF0ZSBv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gICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShzdGF0dXMpKSB7Ci0gICAgICAgICAgICBtU3RhdHVzVmlldy5zZXRUZXh0KHN0YXR1cyk7Ci0gICAgICAgICAgICBtU3RhdHVzVmlldy5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7Ci0KLSAgICAgICAgICAgIENoYXJTZXF1ZW5jZSB0aW1lc3RhbXAgPSBudWxsOwotCi0gICAgICAgICAgICBpZiAoIWMuaXNOdWxsKENvbnRhY3RRdWVyeS5DT05UQUNUX1NUQVRVU19USU1FU1RBTVApKSB7Ci0gICAgICAgICAgICAgICAgbG9uZyBkYXRlID0gYy5nZXRMb25nKENvbnRhY3RRdWVyeS5DT05UQUNUX1NUQVRVU19USU1FU1RBTVApOwotCi0gICAgICAgICAgICAgICAgLy8gU2V0IHRoZSBkYXRlL3RpbWUgZmllbGQgYnkgbWl4aW5nIHJlbGF0aXZlIGFuZCBhYnNvbHV0ZQotICAgICAgICAgICAgICAgIC8vIHRpbWVzLgotICAgICAgICAgICAgICAgIGludCBmbGFncyA9IERhdGVVdGlscy5GT1JNQVRfQUJCUkVWX1JFTEFUSVZFOwotCi0gICAgICAgICAgICAgICAgdGltZXN0YW1wID0gRGF0ZVV0aWxzLmdldFJlbGF0aXZlVGltZVNwYW5TdHJpbmcoZGF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpLCBEYXRlVXRpbHMuTUlOVVRFX0lOX01JTExJUywgZmxhZ3MpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBTdHJpbmcgbGFiZWwgPSBudWxsOwotCi0gICAgICAgICAgICBpZiAoIWMuaXNOdWxsKENvbnRhY3RRdWVyeS5DT05UQUNUX1NUQVRVU19MQUJFTCkpIHsKLSAgICAgICAgICAgICAgICBTdHJpbmcgcmVzUGFja2FnZSA9IGMuZ2V0U3RyaW5nKENvbnRhY3RRdWVyeS5DT05UQUNUX1NUQVRVU19SRVNfUEFDS0FHRSk7Ci0gICAgICAgICAgICAgICAgaW50IGxhYmVsUmVzb3VyY2UgPSBjLmdldEludChDb250YWN0UXVlcnkuQ09OVEFDVF9TVEFUVVNfTEFCRUwpOwotICAgICAgICAgICAgICAgIFJlc291cmNlcyByZXNvdXJjZXM7Ci0gICAgICAgICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KHJlc1BhY2thZ2UpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJlc291cmNlcyA9IGdldFJlc291cmNlcygpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIFBhY2thZ2VNYW5hZ2VyIHBtID0gZ2V0Q29udGV4dCgpLmdldFBhY2thZ2VNYW5hZ2VyKCk7Ci0gICAgICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXNvdXJjZXMgPSBwbS5nZXRSZXNvdXJjZXNGb3JBcHBsaWNhdGlvbihyZXNQYWNrYWdlKTsKLSAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoTmFtZU5vdEZvdW5kRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkNvbnRhY3Qgc3RhdHVzIHVwZGF0ZSByZXNvdXJjZSBwYWNrYWdlIG5vdCBmb3VuZDogIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHJlc1BhY2thZ2UpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmVzb3VyY2VzID0gbnVsbDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChyZXNvdXJjZXMgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICAgICAgbGFiZWwgPSByZXNvdXJjZXMuZ2V0U3RyaW5nKGxhYmVsUmVzb3VyY2UpOwotICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJDb250YWN0IHN0YXR1cyB1cGRhdGUgcmVzb3VyY2Ugbm90IGZvdW5kOiAiICsgcmVzUGFja2FnZSArICJAIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGxhYmVsUmVzb3VyY2UpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBDaGFyU2VxdWVuY2UgYXR0cmlidXRpb247Ci0gICAgICAgICAgICBpZiAodGltZXN0YW1wICE9IG51bGwgJiYgbGFiZWwgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGF0dHJpYnV0aW9uID0gZ2V0Q29udGV4dCgpLmdldFN0cmluZygKLSAgICAgICAgICAgICAgICAgICAgICAgIFIuc3RyaW5nLmNvbnRhY3Rfc3RhdHVzX3VwZGF0ZV9hdHRyaWJ1dGlvbl93aXRoX2RhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICB0aW1lc3RhbXAsIGxhYmVsKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAodGltZXN0YW1wID09IG51bGwgJiYgbGFiZWwgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGF0dHJpYnV0aW9uID0gZ2V0Q29udGV4dCgpLmdldFN0cmluZygKLSAgICAgICAgICAgICAgICAgICAgICAgIFIuc3RyaW5nLmNvbnRhY3Rfc3RhdHVzX3VwZGF0ZV9hdHRyaWJ1dGlvbiwKLSAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAodGltZXN0YW1wICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBhdHRyaWJ1dGlvbiA9IHRpbWVzdGFtcDsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgYXR0cmlidXRpb24gPSBudWxsOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKGF0dHJpYnV0aW9uICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBtU3RhdHVzQXR0cmlidXRpb25WaWV3LnNldFRleHQoYXR0cmlidXRpb24pOwotICAgICAgICAgICAgICAgIG1TdGF0dXNBdHRyaWJ1dGlvblZpZXcuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBtU3RhdHVzQXR0cmlidXRpb25WaWV3LnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIG1TdGF0dXNWaWV3LnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKLSAgICAgICAgICAgIG1TdGF0dXNBdHRyaWJ1dGlvblZpZXcuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgb25DbGljayhWaWV3IHZpZXcpIHsKLSAgICAgICAgc3dpdGNoICh2aWV3LmdldElkKCkpIHsKLSAgICAgICAgICAgIGNhc2UgUi5pZC5zdGFyOiB7Ci0gICAgICAgICAgICAgICAgLy8gVG9nZ2xlICJzdGFycmVkIiBzdGF0ZQotICAgICAgICAgICAgICAgIC8vIE1ha2Ugc3VyZSB0aGVyZSBpcyBhIGNvbnRhY3QKLSAgICAgICAgICAgICAgICBpZiAobUNvbnRhY3RVcmkgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBmaW5hbCBDb250ZW50VmFsdWVzIHZhbHVlcyA9IG5ldyBDb250ZW50VmFsdWVzKDEpOwotICAgICAgICAgICAgICAgICAgICB2YWx1ZXMucHV0KENvbnRhY3RzLlNUQVJSRUQsIG1TdGFycmVkVmlldy5pc0NoZWNrZWQoKSk7Ci0gICAgICAgICAgICAgICAgICAgIG1Db250ZW50UmVzb2x2ZXIudXBkYXRlKG1Db250YWN0VXJpLCB2YWx1ZXMsIG51bGwsIG51bGwpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgUi5pZC5waG90bzogewotICAgICAgICAgICAgICAgIHBlcmZvcm1QaG90b0NsaWNrKCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIFIuaWQubmFtZTogewotICAgICAgICAgICAgICAgIHBlcmZvcm1EaXNwbGF5TmFtZUNsaWNrKCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBwcml2YXRlIEJpdG1hcCBsb2FkUGxhY2Vob2xkZXJQaG90byhCaXRtYXBGYWN0b3J5Lk9wdGlvbnMgb3B0aW9ucykgewotICAgICAgICBpZiAobU5vUGhvdG9SZXNvdXJjZSA9PSAwKSB7Ci0gICAgICAgICAgICByZXR1cm4gbnVsbDsKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gQml0bWFwRmFjdG9yeS5kZWNvZGVSZXNvdXJjZShtQ29udGV4dC5nZXRSZXNvdXJjZXMoKSwKLSAgICAgICAgICAgICAgICBtTm9QaG90b1Jlc291cmNlLCBvcHRpb25zKTsKLSAgICB9Ci19CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvd2lkZ2V0L0RpZ2l0YWxDbG9jay5qYXZhIGIvY29yZS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL3dpZGdldC9EaWdpdGFsQ2xvY2suamF2YQppbmRleCBmYTQ3ZmY2Li4yM2UyMjc3IDEwMDY0NAotLS0gYS9jb3JlL2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvd2lkZ2V0L0R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JVFlfQUxQSEFOVU1FUklDOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRGV2aWNlUG9saWN5TWFuYWdlci5QQVNTV09SRF9RVUFMSVRZX0NPTVBMRVg6CisgICAgICAgICAgICAgICAgaWYgKGlzTG9ja1Bhc3N3b3JkRW5hYmxlZCgpKSB7CisgICAgICAgICAgICAgICAgICAgIGFjdGl2ZVBhc3N3b3JkUXVhbGl0eSA9IERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9DT01QTEVYOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgfQogICAgICAgICByZXR1cm4gYWN0aXZlUGFzc3dvcmRRdWFsaXR5OwogICAgIH0KQEAgLTI4Miw4ICszNDQsNiBAQAogICAgICAqIENsZWFyIGFueSBsb2NrIHBhdHRlcm4gb3IgcGFzc3dvcmQuCiAgICAgICovCiAgICAgcHVibGljIHZvaWQgY2xlYXJMb2NrKCkgewotICAgICAgICBnZXREZXZpY2VQb2xpY3lNYW5hZ2VyKCkuc2V0QWN0aXZlUGFzc3dvcmRTdGF0ZSgKLSAgICAgICAgICAgICAgICBEZXZpY2VQb2xpY3lNYW5hZ2VyLlBBU1NXT1JEX1FVQUxJVFlfVU5TUEVDSUZJRUQsIDApOwogICAgICAgICBzYXZlTG9ja1Bhc3N3b3JkKG51bGwsIERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9TT01FVEhJTkcpOwogICAgICAgICBzZXRMb2NrUGF0dGVybkVuYWJsZWQoZmFsc2UpOwogICAgICAgICBzYXZlTG9ja1BhdHRlcm4obnVsbCk7CkBAIC0yOTYsNyArMzU2LDcgQEAKICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBzYXZlTG9ja1BhdHRlcm4oTGlzdDxMb2NrUGF0dGVyblZpZXcuQ2VsbD4gcGF0dGVybikgewogICAg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vcmRRdWFsaXR5KHBhc3N3b3JkKTsKLSAgICAgICAgICAgICAgICBzZXRMb25nKFBBU1NXT1JEX1RZUEVfS0VZLCBjb21wdXRlZFF1YWxpdHkpOworICAgICAgICAgICAgICAgIHNldExvbmcoUEFTU1dPUkRfVFlQRV9LRVksIE1hdGgubWF4KHF1YWxpdHksIGNvbXB1dGVkUXVhbGl0eSkpOwogICAgICAgICAgICAgICAgIGlmIChjb21wdXRlZFF1YWxpdHkgIT0gRGV2aWNlUG9saWN5TWFuYWdlci5QQVNTV09SRF9RVUFMSVRZX1VOU1BFQ0lGSUVEKSB7Ci0gICAgICAgICAgICAgICAgICAgIGRwbS5zZXRBY3RpdmVQYXNzd29yZFN0YXRlKGNvbXB1dGVkUXVhbGl0eSwgcGFzc3dvcmQubGVuZ3RoKCkpOworICAgICAgICAgICAgICAgICAgICBpbnQgbGV0dGVycyA9IDA7CisgICAgICAgICAgICAgICAgICAgIGludCB1cHBlcmNhc2UgPSAwOworICAgICAgICAgICAgICAgICAgICBpbnQgbG93ZXJjYXNlID0gMDsKKyAgICAgICAgICAgICAgICAgICAgaW50IG51bWJlcnMgPSAwOworICAgICAgICAgICAgICAgICAgICBpbnQgc3ltYm9scyA9IDA7CisgICAgICAgICAgICAgICAgICAgIGludCBub25sZXR0ZXIgPSAwOworICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHBhc3N3b3JkLmxlbmd0aCgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgYyA9IHBhc3N3b3JkLmNoYXJBdChpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjID49ICdBJyAmJiBjIDw9ICdaJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldHRlcnMrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cHBlcmNhc2UrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoYyA+PSAnYScgJiYgYyA8PSAneicpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXR0ZXJzKys7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG93ZXJjYXNlKys7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGMgPj0gJzAnICYmIGMgPD0gJzknKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtYmVycysrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vbmxldHRlcisrOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzeW1ib2xzKys7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9ubGV0dGVyKys7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZHBtLnNldEFjdGl2ZVBhc3N3b3JkU3RhdGUoTWF0aC5tYXgocXVhbGl0eSwgY29tcHV0ZWRRdWFsaXR5KSwgcGFzc3dvcmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAubGVuZ3RoKCksIGxldHRlcnMsIHVwcGVyY2FzZSwgbG93ZXJjYXNlLCBudW1iZXJzLCBzeW1ib2xzLCBub25sZXR0ZXIpOwogICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgIC8vIFRoZSBwYXNzd29yZCBpcyBub3QgYW55dGhpbmcuCiAgICAgICAgICAgICAgICAgICAgIGRwbS5zZXRBY3RpdmVQYXNzd29yZFN0YXRlKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9VTlNQRUNJRklFRCwgMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRGV2aWNlUG9saWN5TWFuYWdlci5QQVNTV09SRF9RVUFMSVRZX1VOU1BFQ0lGSUVELCAwLCAwLCAwLCAwLCAwLCAwLCAwKTsKICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLy8gQWRkIHRoZSBwYXNzd29yZCB0byB0aGUgcGFzc3dvcmQgaGlzdG9yeS4gV2UgYXNzdW1lIGFsbAorICAgICAgICAgICAgICAgIC8vIHBhc3N3b3JkCisgICAgICAgICAgICAgICAgLy8gaGFzaGVzIGhhdmUgdGhlIHNhbWUgbGVuZ3RoIGZvciBzaW1wbGljaXR5IG9mIGltcGxlbWVudGF0aW9uLgorICAgICAgICAgICAgICAgIFN0cmluZyBwYXNzd29yZEhpc3RvcnkgPSBnZXRTdHJpbmcoUEFTU1dPUkRfSElTVE9SWV9LRVkpOworICAgICAgICAgICAgICAgIGlmIChwYXNzd29yZEhpc3RvcnkgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBwYXNzd29yZEhpc3RvcnkgPSBuZXcgU3RyaW5nKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGludCBwYXNzd29yZEhpc3RvcnlMZW5ndGggPSBnZXRSZXF1ZXN0ZWRQYXNzd29yZEhpc3RvcnlMZW5ndGgoKTsKKyAgICAgICAgICAgICAgICBpZiAocGFzc3dvcmRIaXN0b3J5TGVuZ3RoID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgcGFzc3dvcmRIaXN0b3J5ID0gIiI7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgcGFzc3dvcmRIaXN0b3J5ID0gbmV3IFN0cmluZyhoYXNoKSArICIsIiArIHBhc3N3b3JkSGlzdG9yeTsKKyAgICAgICAgICAgICAgICAgICAgLy8gQ3V0IGl0IHRvIGNvbnRhaW4gcGFzc3dvcmRIaXN0b3J5TGVuZ3RoIGhhc2hlcworICAgICAgICAgICAgICAgICAgICAvLyBhbmQgcGFzc3dvcmRIaXN0b3J5TGVuZ3RoIC0xIGNvbW1hcy4KKyAgICAgICAgICAgICAgICAgICAgcGFzc3dvcmRIaXN0b3J5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Rpb25FdmVudC5BQ1RJT05fVVA6CiAgICAgICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fQ0FOQ0VMOgotICAgICAgICAgICAgICAgICAgICBtVHJhY2tpbmcgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgbVRyaWdnZXJlZCA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICBtT3RoZXJTbGlkZXIuc2hvdyh0cnVlKTsKLSAgICAgICAgICAgICAgICAgICAgbUN1cnJlbnRTbGlkZXIucmVzZXQoZmFsc2UpOwotICAgICAgICAgICAgICAgICAgICBtQ3VycmVudFNsaWRlci5oaWRlVGFyZ2V0KCk7Ci0gICAgICAgICAgICAgICAgICAgIG1DdXJyZW50U2xpZGVyID0gbnVsbDsKLSAgICAgICAgICAgICAgICAgICAgbU90aGVyU2xpZGVyID0gbnVsbDsKLSAgICAgICAgICAgICAgICAgICAgc2V0R3JhYmJlZFN0YXRlKE9uVHJpZ2dlckxpc3RlbmVyLk5PX0hBTkRMRSk7CisgICAgICAgICAgICAgICAgICAgIGNhbmNlbEdyYWIoKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KQEAgLTYyMyw2ICs2MTUsMTcgQEAKICAgICAgICAgcmV0dXJuIG1UcmFja2luZyB8fCBzdXBlci5vblRvdWNoRXZlbnQoZXZlbnQpOwogICAgIH0KIAorICAgIHByaXZhdGUgdm9pZCBjYW5jZWxHcmFiKCkgeworICAgICAgICBtVHJhY2tpbmcgPSBmYWxzZTsKKyAgICAgICAgbVRyaWdnZXJlZCA9IGZhbHNlOworICAgICAgICBtT3RoZXJTbGlkZXIuc2hvdyh0cnVlKTsKKyAgICAgICAgbUN1cnJlbnRTbGlkZXIucmVzZXQoZmFsc2UpOworICAgICAgICBtQ3VycmVudFNsaWRlci5oaWRlVGFyZ2V0KCk7CisgICAgICAgIG1DdXJyZW50U2xpZGVyID0gbnVsbDsKKyAg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0ZXhzLCBjb2xvcnMsIE5VTEwsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGljZXMsIGluZGV4Q291bnQsICpwYWludCk7CiAgICAgfQotICAgIAotICAgIHN0YXRpYyB2b2lkIGRyYXdUZXh0X19fQ0lJRkZQYWludChKTklFbnYqIGVudiwgam9iamVjdCwgU2tDYW52YXMqIGNhbnZhcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamNoYXJBcnJheSB0ZXh0LCBpbnQgaW5kZXgsIGludCBjb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamZsb2F0IHgsIGpmbG9hdCB5LCBTa1BhaW50KiBwYWludCkgewotICAgICAgICBqY2hhciogdGV4dEFycmF5ID0gZW52LT5HZXRDaGFyQXJyYXlFbGVtZW50cyh0ZXh0LCBOVUxMKTsKLSAgICAgICAganNpemUgdGV4dENvdW50ID0gZW52LT5HZXRBcnJheUxlbmd0aCh0ZXh0KTsKLSAgICAgICAgU2tTY2FsYXIgeF8gPSBTa0Zsb2F0VG9TY2FsYXIoeCk7Ci0gICAgICAgIFNrU2NhbGFyIHlfID0gU2tGbG9hdFRvU2NhbGFyKHkpOwotICAgICAgICBjYW52YXMtPmRyYXdUZXh0KHRleHRBcnJheSArIGluZGV4LCBjb3VudCA8PCAxLCB4XywgeV8sICpwYWludCk7Ci0gICAgICAgIGVudi0+UmVsZWFzZUNoYXJBcnJheUVsZW1lbnRzKHRleHQsIHRleHRBcnJheSwgMCk7Ci0gICAgfQotIAotICAgIHN0YXRpYyB2b2lkIGRyYXdUZXh0X19TdHJpbmdJSUZGUGFpbnQoSk5JRW52KiBlbnYsIGpvYmplY3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgU2tDYW52YXMqIGNhbnZhcywganN0cmluZyB0ZXh0LCBpbnQgc3RhcnQsIGludCBlbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmx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UEUgfAorICAgICAgICAgICAgICAgICAgICAgICBVX1NIQVBFX1hfTEFNQUxFRl9TVUJfQUxURVJOQVRFLCAmc3RhdHVzKTsKKworICAgICAgICBpZiAoIVVfU1VDQ0VTUyhzdGF0dXMpKSB7CisgICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICAgfQotICAgICAgICBjb25zdCBqY2hhciogdGV4dF8gPSBlbnYtPkdldFN0cmluZ0NoYXJzKHRleHQsIE5VTEwpOwotICAgICAgICBTa0NhbnZhcyogYyA9IEdyYXBoaWNzSk5JOjpnZXROYXRpdmVDYW52YXMoZW52LCBjYW52YXMpOwotICAgICAgICBjLT5kcmF3VGV4dCh0ZXh0XywgY291bnQgPDwgMSwgU2tGbG9hdFRvU2NhbGFyKHgpLCBTa0Zsb2F0VG9TY2FsYXIoeSksCi0gICAgICAgICAgICAgICAgICAgICpHcmFwaGljc0pOSTo6Z2V0TmF0aXZlUGFpbnQoZW52LCBwYWludCkpOwotICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdDaGFycyh0ZXh0LCB0ZXh0Xyk7CisKKyAgICAgICAgLy8gdHJpbSBvdXQgMHhmZmZmIGZvbGxvd2luZyBsaWdhdHVyZXMsIGlmIGFueQorICAgICAgICBpbnQgZW5kID0gMDsKKyAgICAgICAgZm9yIChpbnQgaSA9IHN0YXJ0LCBlID0gc3RhcnQgKyBjb3VudDsgaSA8IGU7ICsraSkgeworICAgICAgICAgICAgaWYgKGJ1ZmZlcltpXSA9PSAweGZmZmYpIHsKKyAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBidWZmZXJbZW5kKytdID0gYnVmZmVyW2ldOworICAgICAgICB9CisgICAgICAgIGNvdW50ID0gZW5kOworICAgICAgICAvLyBMT0coTE9HX0lORk8sICJDU1JUTCIsICJzdGFydCAlZCBjb3VudCAlZCBjY291bnQgJWRcbiIsIHN0YXJ0LCBjb3VudCwgY29udGV4dENvdW50KTsKKyAgICAgICAgdWJpZGlfd3JpdGVSZXZlcnNlKGJ1ZmZlciwgY291bnQsIHNoYXBlZCwgY291bnQsIFVCSURJX0RPX01JUlJPUklORyB8IFVCSURJX09VVFBVVF9SRVZFUlNFCisgICAgICAgICAgICAgICAgICAgICAgICAgICB8IFVCSURJX0tFRVBfQkFTRV9DT01CSU5JTkcsICZzdGF0dXMpOworICAgICAgICByZXR1cm4gY291bnQ7CiAgICAgfQotICAgIAorCisgICAgc3RhdGljIHZvaWQgZHJhd1RleHRfXyhKTklFbnYqIGVudiwgU2tDYW52YXMqIGNhbnZhcywgY29uc3QgamNoYXIqIHRleHQsIGpzaXplIGxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB4LCBqZmxvYXQgeSwgaW50IGZsYWdzLCBTa1BhaW50KiBwYWludCkgeworICAgICAgICBTa1NjYWxhciB4XyA9IFNrRmxvYXRUb1NjYWxhcih4KTsKKyAgICAgICAgU2tTY2FsYXIgeV8gPSBTa0Zsb2F0VG9TY2FsYXIoeSk7CisKKyAgICAgICAgU2tQYWludDo6QWxpZ24gaG9yaXogPSBwYWludC0+Z2V0VGV4dEFsaWduKCk7CisKKyAgICAgICAgYm9vbCBuZWVkQmlkaSA9IChmbGFncyA9PSBrQmlkaV9SVEwpIHx8IChmbGFncyA9PSBrQmlkaV9EZWZhdWx0X1JUTCk7CisgICAgICAgIGlmICghbmVlZEJpZGkgJiYgZmxhZ3MgPCBrQmlkaV9Gb3JjZV9MVFIpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuOyArK2kpIHsKKyAgICAgICAgICAgICAgICBpZiAodGV4dFtpXSA+PSAweDA1OTApIHsKKyAgICAgICAgICAgICAgICAgICAgbmVlZEJpZGkgPSBUUlVFOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpbnQgZGlyID0gKGZsYWdzID09IGtCaWRpX0ZvcmNlX1JUTCkgPyBrRGlyZWN0aW9uX1JUTCA6IGtEaXJlY3Rpb25fTFRSOyAvLyB3aWxsIGJlIHJlc2V0IGlmIHdlIHJ1biBiaWRpCisgICAgICAgIFVFcnJvckNvZGUgc3RhdHVzID0gVV9aRVJPX0VSUk9SOworICAgICAgICBqY2hhciAqc2hhcGVkID0gTlVMTDsKKyAgICAgICAgaW50MzJfdCBzbGVuID0gMDsKKyAgICAgICAgaWYgKG5lZWRCaWRpIHx8IChmbGFncyA9PSBrQmlkaV9Gb3JjZV9SVEwpKSB7CisgICAgICAgICAgICBzaGFwZWQgPSAoamNoYXIgKiltYWxsb2MobGVuICogc2l6ZW9mKGpjaGFyKSk7CisgICAgICAgICAgICBpZiAoIXNoYXBlZCkgeworICAgICAgICAgICAgICAgIHN0YXR1cyA9IFVfTUVNT1JZX0FMTE9DQVRJT05fRVJST1I7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGlmIChuZWVkQmlkaSkgeworICAgICAgICAgICAgICAgICAgICBzdGF0aWMgaW50IFJUTF9PUFRTID0gVUJJRElfRE9fTUlSUk9SSU5HIHwgVUJJRElfS0VFUF9CQVNFX0NPTUJJTklORyB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVUJJRElfUkVNT1ZFX0JJRElfQ09OVFJPTFMgfCBVQklESV9PVVRQVVRfUkVWRVJTRTsKKyAgICAgICAgICAgICAgICAgICAgamludCBsaW5lRGlyID0gMDsKKyAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChmbGFncykgeworICAgICAgICAgICAgICAgICAgICBjYXNlIGtCaWRpX0xUUjogbGluZURpciA9IDA7IGJyZWFrOyAvLyBubyBJQ1UgY29uc3RhbnQsIGNhbm9uaWNhbCBMVFIgbGV2ZWwKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBrQmlkaV9SVEw6IGxpbmVEaXIgPSAxOyBicmVhazsgLy8gbm8gSUNVIGNvbnN0YW50LCBjYW5vbmljYWwgUlRMIGxldmVsCisgICAgICAgICAgICAgICAgICAgIGNhc2Uga0JpZGlfRGVmYXVsdF9MVFI6IGxpbmVEaXIgPSBVQklESV9ERUZBVUxUX0xUUjsgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2Uga0JpZGlfRGVmYXVsdF9SVEw6IGxpbmVEaXIgPSBVQklESV9ERUZBVUxUX1JUTDsgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBVQmlEaSogYmlkaSA9IHViaWRpX29wZW4oKTsKKyAgICAgICAgICAgICAgICAgICAgdWJpZGlfc2V0UGFyYShiaWRpLCB0ZXh0LCBsZW4sIGxpbmVEaXIsIE5VTEwsICZzdGF0dXMpOworICAgICAgICAgICAgICAgICAgICBpZiAoVV9TVUNDRVNTKHN0YXR1cykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRpciA9IHViaWRpX2dldFBhcmFMZXZlbChiaWRpKSAmIDB4MTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaW50IHJjID0gdWJpZGlfY291bnRSdW5zKGJpZGksICZzdGF0dXMpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFVfU1VDQ0VTUyhzdGF0dXMpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MzJfdCBzdGFydDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQzMl90IGxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBVQmlEaURpcmVjdGlvbiBkaXI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgamNoYXIgKmJ1ZmZlciA9IE5VTEw7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCByYzsgKytpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpciA9IHViaWRpX2dldFZpc3VhbFJ1bihiaWRpLCBpLCAmc3RhcnQsICZsZW5ndGgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYWtlIHNoYXBpbmcsIGV4Y2VwdCBpdCBkb2Vzbid0IHNoYXBlLCBqdXN0IG1pcnJvcnMgYW5kIHJldmVyc2VzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHVzZSBoYXJmYnV6eiB3aGVuIGF2YWlsYWJsZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGlyID09IFVCSURJX1JUTCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2xlbiArPSB1YmlkaV93cml0ZVJldmVyc2UodGV4dCArIHN0YXJ0LCBsZW5ndGgsIHNoYXBlZCArIHNsZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZW5ndGgsIFJUTF9PUFRTLCAmc3RhdHVzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyArK2kpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGFwZWRbc2xlbiArIGldID0gdGV4dFtzdGFydCArIGldOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2xlbiArPSBsZW5ndGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB1YmlkaV9jbG9zZShiaWRpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICBsZW4gPSBzaGFwZVJ0bFRleHRfXyh0ZXh0LCAwLCBsZW4sIGxlbiwgc2hhcGVkLCBzdGF0dXMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmICghVV9TVUNDRVNTKHN0YXR1cykpIHsKKyAgICAgICAgICAgIGNoYXIgYnVmZmVyWzM1XTsKKyAgICAgICAgICAgIHNwcmludGYoYnVmZmVyLCAiRHJhd1RleHQgYmlkaSBlcnJvciAlZCIsIHN0YXR1cyk7CisgICAgICAgICAgICBkb1Rocm93SUFFKGVudiwgYnVmZmVyKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGJvb2wgdHJpbUxlZnQgPSBmYWxzZTsKKyAgICAgICAgICAgIGJvb2wgdHJpbVJpZ2h0ID0gZmFsc2U7CisKKyAgICAgICAgICAgIHN3aXRjaCAoaG9yaXopIHsKKyAgICAgICAgICAgIGNhc2UgU2tQYWludDo6a0xlZnRfQWxpZ246IHRyaW1MZWZ0ID0gZGlyICYga0RpcmVjdGlvbl9NYXNrOyBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU2tQYWludDo6a0NlbnRlcl9BbGlnbjogdHJpbUxlZnQgPSB0cmltUmlnaHQgPSB0cnVlOyBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU2tQYWludDo6a1JpZ2h0X0FsaWduOiB0cmltUmlnaHQgPSAhKGRpciAmIGtEaXJlY3Rpb25fTWFzayk7CisgICAgICAgICAgICBkZWZhdWx0OiBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGNvbnN0IGpjaGFyKiB3b3JrVGV4dCA9IHNoYXBlZCA/IHNoYXBlZCA6IHRleHQ7CisgICAgICAgICAgICBjb25zdCBqY2hhciogd29ya0xpbWl0ID0gd29ya1RleHQgKyBsZW47CisKKyAgICAgICAgICAgIGlmICh0cmltTGVmdCkgeworICAgICAgICAgICAgICAgIHdoaWxlICh3b3JrVGV4dCA8IHdvcmtMaW1pdCAmJiAqd29ya1RleHQgPT0gJyAnKSB7CisgICAgICAgICAgICAgICAgICAgICsrd29ya1RleHQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHRyaW1SaWdodCkgeworICAgICAgICAgICAgICAgIHdoaWxlICh3b3JrTGltaXQgPiB3b3JrVGV4dCAmJiAqKHdvcmtMaW1pdCAtIDEpID09ICcgJykgeworICAgICAgICAgICAgICAgICAgICAtLXdvcmtMaW1pdDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpbnQzMl90IHdvcmtCeXRlcyA9ICh3b3JrTGltaXQgLSB3b3JrVGV4dCkgPDwgMTsKKworICAgICAgICAgICAgY2FudmFzLT5kcmF3VGV4dCh3b3JrVGV4dCwgd29ya0J5dGVzLCB4XywgeV8sICpwYWludCk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoc2hhcGVkKSB7CisgICAgICAgICAgICBmcmVlKHNoYXBlZCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBzdGF0aWMgdm9pZCBkcmF3VGV4dF9fX0NJSUZGSVBhaW50KEpOSUVudiogZW52LCBqb2JqZWN0LCBTa0NhbnZhcyogY2FudmFzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqY2hhckFycmF5IHRleHQsIGludCBpbmRleCwgaW50IGNvdW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgeCwgamZsb2F0IHksIGludCBmbGFncywgU2tQYWludCogcGFpbnQpIHsKKyAgICAgICAgamNoYXIqIHRleHRBcnJheSA9IGVudi0+R2V0Q2hhckFycmF5RWxlbWVudHModGV4dCwgTlVMTCk7CisgICAgICAgIGRyYXdUZXh0X18oZW52LCBjYW52YXMsIHRleHRBcnJheSArIGluZGV4LCBjb3VudCwgeCwgeSwgZmxhZ3MsIHBhaW50KTsKKyAgICAgICAgZW52LT5SZWxlYXNlQ2hhckFycmF5RWxlbWVudHModGV4dCwgdGV4dEFycmF5LCBKTklfQUJPUlQpOworICAgIH0KKworICAgIHN0YXRpYyB2b2lkIGRyYXdUZXh0X19TdHJpbmdJSUZGSVBhaW50KEpOSUVudiogZW52LCBqb2JqZWN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2tDYW52YXMqIGNhbnZhcywganN0cmluZyB0ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0LCBpbnQgZW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamZsb2F0IHgsIGpmbG9hdCB5LCBpbnQgZmxhZ3MsIFNrUGFpbnQqIHBhaW50KSB7CisgICAgICAgIGNvbnN0IGpjaGFyKiB0ZXh0QXJyYXkgPSBlbnYtPkdldFN0cmluZ0NoYXJzKHRleHQsIE5VTEwpOworICAgICAgICBkcmF3VGV4dF9fKGVudiwgY2FudmFzLCB0ZXh0QXJyYXkgKyBzdGFydCwgZW5kIC0gc3RhcnQsIHgsIHksIGZsYWdzLCBwYWludCk7CisgICAgICAgIGVudi0+UmVsZWFzZVN0cmluZ0NoYXJzKHRleHQsIHRleHRBcnJheSk7CisgICAgfQorCisgICAgLy8gRHJhd3MgYSB1bmlkaXJlY3Rpb25hbCBydW4gb2YgdGV4dC4KKyAgICBzdGF0aWMgdm9pZCBkcmF3VGV4dFJ1bl9fKEpOSUVudiogZW52LCBTa0NhbnZhcyogY2FudmFzLCBjb25zdCBqY2hhciogY2hhcnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IHN0YXJ0LCBqaW50IGNvdW50LCBqaW50IGNvbnRleHRDb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB4LCBqZmxvYXQgeSwgaW50IGZsYWdzLCBTa1BhaW50KiBwYWludCkgeworCisgICAgICAgIFNrU2NhbGFyIHhfID0gU2tGbG9hdFRvU2NhbGFyKHgpOworICAgICAgICBTa1NjYWxhciB5XyA9IFNrRmxvYXRUb1NjYWxhcih5KTsKKworICAgICAgICB1aW50OF90IHJ0bCA9IGZsYWdzICYgMHgxOworICAgICAgICBpZiAocnRsKSB7CisgICAgICAgICAgICBqY2hhciBjb250ZXh0W2NvbnRleHRDb3VudF07CisgICAgICAgICAgICBVRXJyb3JDb2RlIHN0YXR1cyA9IFVfWkVST19FUlJPUjsKKyAgICAgICAgICAgIGNvdW50ID0gc2hhcGVSdGxUZXh0X18oY2hhcnMsIHN0YXJ0LCBjb3VudCwgY29udGV4dENvdW50LCBjb250ZXh0LCBzdGF0dXMpOworICAgICAgICAgICAgaWYgKFVfU1VDQ0VTUyhzdGF0dXMpKSB7CisgICAgICAgICAgICAgICAgY2FudmFzLT5kcmF3VGV4dChjb250ZXh0LCBjb3VudCA8PCAxLCB4XywgeV8sICpwYWludCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGRvVGhyb3dJQUUoZW52LCAic2hhcGluZyBlcnJvciIpOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgY2FudmFzLT5kcmF3VGV4dChjaGFycyArIHN0YXJ0LCBjb3VudCA8PCAxLCB4XywgeV8sICpwYWludCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBzdGF0aWMgdm9pZCBkcmF3VGV4dFJ1bl9fX0NJSUlJRkZJUGFpbnQoCisgICAgICAgIEpOSUVudiogZW52LCBqb2JqZWN0LCBTa0NhbnZhcyogY2FudmFzLCBqY2hhckFycmF5IHRleHQsIGludCBpbmRleCwKKyAgICAgICAgaW50IGNvdW50LCBpbnQgY29udGV4dEluZGV4LCBpbnQgY29udGV4dENvdW50LAorICAgICAgICBqZmxvYXQgeCwgamZsb2F0IHksIGludCBmbGFncywgU2tQYWludCogcGFpbnQpIHsKKworICAgICAgICBqY2hhciogY2hhcnMgPSBlbnYtPkdldENoYXJBcnJheUVsZW1lbnRzKHRleHQsIE5VTEwpOworICAgICAgICBkcmF3VGV4dFJ1bl9fKGVudiwgY2FudmFzLCBjaGFycyArIGNvbnRleHRJbmRleCwgaW5kZXggLSBjb250ZXh0SW5kZXgsCisgICAgICAgICAgICAgICAgICAgICAgY291bnQsIGNvbnRleHRDb3VudCwgeCwgeSwgZmxhZ3MsIHBhaW50KTsKKyAgICAgICAgZW52LT5SZWxlYXNlQ2hhckFycmF5RWxlbWVudHModGV4dCwgY2hhcnMsIEpOSV9BQk9SVCk7CisgICAgfQorCisgICAgc3RhdGljIHZvaWQgZHJhd1RleHRSdW5fX1N0cmluZ0lJSUlGRklQYWludCgKKyAgICAgICAgSk5JRW52KiBlbnYsIGpvYmplY3Qgb2JqLCBTa0NhbnZhcyogY2FudmFzLCBqc3RyaW5nIHRleHQsIGppbnQgc3RhcnQsCisgICAgICAgIGppbnQgZW5kLCBqaW50IGNvbnRleHRTdGFydCwgamludCBjb250ZXh0RW5kLAorICAgICAgICBqZmxvYXQgeCwgamZsb2F0IHksIGppbnQgZmxhZ3MsIFNrUGFpbnQqIHBhaW50KSB7CisKKyAgICAgICAgamludCBjb3VudCA9IGVuZCAtIHN0YXJ0OworICAgICAgICBqaW50IGNvbnRleHRDb3VudCA9IGNvbnRleHRFbmQgLSBjb250ZXh0U3RhcnQ7CisgICAgICAgIGNvbnN0IGpjaGFyKiBjaGFycyA9IGVudi0+R2V0U3RyaW5nQ2hhcnModGV4dCwgTlVMTCk7CisgICAgICAgIGRyYXdUZXh0UnVuX18oZW52LCBjYW52YXMsIGNoYXJzICsgY29udGV4dFN0YXJ0LCBzdGFydCAtIGNvbnRleHRTdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICBjb3VudCwgY29udGV4dENvdW50LCB4LCB5LCBmbGFncywgcGFpbnQpOworICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdDaGFycyh0ZXh0LCBjaGFycyk7CisgICAgfQorCiAgICAgc3RhdGljIHZvaWQgZHJhd1Bvc1RleHRfX19DSUlfRlBhaW50KEpOSUVudiogZW52LCBqb2JqZWN0LCBTa0NhbnZhcyogY2FudmFzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqY2hhckFycmF5IHRleHQsIGludCBpbmRleCwgaW50IGNvdW50LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXRBcnJheSBwb3MsIFNrUGFpbnQqIHBhaW50KSB7CkBAIC04MDQsNyArMTAwMSw3IEBACiAgICAgICAgIH0KICAgICAgICAgZGVsZXRlW10gcG9zUHRyOwogICAgIH0KLSAKKwogICAgIHN0YXRpYyB2b2lkIGRyYXdQb3NUZXh0X19TdHJpbmdfRlBhaW50KEpOSUVudiogZW52LCBqb2JqZWN0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNrQ2FudmFzKiBjYW52YXMsIGpzdHJpbmcgdGV4dCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXRBcnJheSBwb3MsIFNrUGFpbnQqIHBhaW50KSB7CkBAIC04MjcsNyArMTAyNCw3IEBACiAgICAgICAgIH0KICAgICAgICAgZGVsZXRlW10gcG9zUHRyOwogICAgIH0KLSAKKwogICAgIHN0YXRpYyB2b2lkIGRyYXdUZXh0T25QYXRoX19fQ0lJUGF0aEZGUGFpbnQoSk5JRW52KiBlbnYsIGpvYmplY3QsCiAgICAgICAgICAgICAgICAgICAgICAgICBTa0NhbnZhcyogY2FudmFzLCBqY2hhckFycmF5IHRleHQsIGludCBpbmRleCwgaW50IGNvdW50LAogICAgICAgICAgICAgICAgIFNrUGF0aCogcGF0aCwgamZsb2F0IGhPZmZzZXQsIGpmbG9hdCB2T2Zmc2V0LCBTa1BhaW50KiBwYWludCkgewpAQCAtODM3LDcgKzEwMzQsNyBAQAogICAgICAgICAgICAgICAgICAgICBTa0Zsb2F0VG9TY2FsYXIoaE9mZnNldCksIFNrRmxvYXRUb1NjYWxhcih2T2Zmc2V0KSwgKnBhaW50KTsKICAgICAgICAgZW52LT5SZWxlYXNlQ2hhckFycmF5RWxlbWVudHModGV4dCwgdGV4dEFycmF5LCAwKTsKICAgICB9Ci0gCisKICAgICBzdGF0aWMgdm9pZCBkcmF3VGV4dE9uUGF0aF9fU3RyaW5nUGF0aEZGUGFpbnQoSk5JRW52KiBlbnYsIGpvYmplY3QsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2tDYW52YXMqIGNhbnZhcywganN0cmluZyB0ZXh0LCBTa1BhdGgqIHBhdGgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamZsb2F0IGhPZmZzZXQsIGpmbG9hdCB2T2Zmc2V0LCBTa1BhaW50KiBwYWludCkgewpAQCAtODQ3LDcgKzEwNDQsNyBAQAogICAgICAgICAgICAgICAgICAgICBTa0Zsb2F0VG9TY2FsYXIoaE9mZnNldCksIFNrRmxvYXRUb1NjYWxhcih2T2Zmc2V0KSwgKnBhaW50KTsKICAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nQ2hhcnModGV4dCwgdGV4dF8pOwogICAgIH0KLSAKKwogICAgIHN0YXRpYyBib29sIGdldENsaXBCb3VuZHMoSk5JRW52KiBlbnYsIGpvYmplY3QsIFNrQ2FudmFzKiBjYW52YXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IGJvdW5kcykgewogICAgICAgICBTa1JlY3QgICByOwpAQCAtOTQwLDE5ICsxMTM3LDIwIEBACiAgICAgICAgICh2b2lkKikgU2tDYW52YXNHbHVlOjpkcmF3Qml0bWFwUlJ9LAogICAgIHsibmF0aXZlX2RyYXdCaXRtYXAiLCAiKElbSUlJRkZJSVpJKVYiLAogICAgICh2b2lkKilTa0NhbnZhc0dsdWU6OmRyYXdCaXRtYXBBcnJheX0sCi0gICAgCiAgICAgeyJuYXRpdmVEcmF3Qml0bWFwTWF0cml4IiwgIihJSUlJKVYiLAogICAgICAgICAodm9pZCop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RFUiwgQVRfT1JfQUZURVIsIEJFRk9SRSwgQVRfT1JfQkVGT1JFLCBBVAorICAgIH07CiAKICAgICBzdGF0aWMgdm9pZCBmaW5hbGl6ZXIoSk5JRW52KiBlbnYsIGpvYmplY3QgY2xhenosIFNrUGFpbnQqIG9iaikgewogICAgICAgICBkZWxldGUgb2JqOwpAQCAtMzk1LDcgKzQwMiwxODQgQEAKICAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nQ2hhcnModGV4dCwgdGV4dEFycmF5KTsKICAgICAgICAgcmV0dXJuIGNvdW50OwogICAgIH0KLSAgICAKKworICAgIHN0YXRpYyBqZmxvYXQgZG9UZXh0UnVuQWR2YW5jZXMoSk5JRW52ICplbnYsIFNrUGFpbnQgKnBhaW50LCBjb25zdCBqY2hhciAqdGV4dCwgamludCBzdGFydCwgamludCBjb3VudCwgamludCBjb250ZXh0Q291bnQsIGppbnQgZmxhZ3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXRBcnJheSBhZHZhbmNlcywgamludCBhZHZhbmNlc0luZGV4KSB7CisgICAgICAgIGpmbG9hdCBhZHZhbmNlc0FycmF5W2NvdW50XTsKKyAgICAgICAgamNoYXIgYnVmZmVyW2NvbnRleHRDb3VudF07CisKKyAgICAgICAgU2tTY2FsYXIqIHNjYWxhckFycmF5ID0gKFNrU2NhbGFyICopYWR2YW5jZXNBcnJheTsKKyAgICAgICAgamZsb2F0IHRvdGFsQWR2YW5jZSA9IDA7CisKKyAgICAgICAgLy8gdGhpcyBpcyB3aGVyZSB3ZSdkIGNhbGwgaGFyZmJ1enoKKyAgICAgICAgLy8gZm9yIG5vdyB3ZSBqdXN0IHVzZSB1c2hhcGUuYworCisgICAgICAgIGludCB3aWR0aHM7CisgICAgICAgIGlmIChmbGFncyAmIDB4MSkgeyAvLyBydGwsIGNhbGwgYXJhYmljIHNoYXBpbmcgaW4gY2FzZQorICAgICAgICAgICAgVUVycm9yQ29kZSBzdGF0dXMgPSBVX1pFUk9fRVJST1I7CisgICAgICAgICAgICAvLyBVc2UgZml4ZWQgbGVuZ3RoIHNpbmNlIHdlIG5lZWQgdG8ga2VlcCBzdGFydCBhbmQgY291bnQgdmFsaWQKKyAgICAgICAgICAgIHVfc2hhcGVBcmFiaWModGV4dCwgY29udGV4dENvdW50LCBidWZmZXIsIGNvbnRleHRDb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgVV9TSEFQRV9MRU5HVEhfRklYRURfU1BBQ0VTX05FQVIgfAorICAgICAgICAgICAgICAgICAgICAgICAgICBVX1NIQVBFX1RFWFRfRElSRUNUSU9OX0xPR0lDQUwgfCBVX1NIQVBFX0xFVFRFUlNfU0hBUEUgfAorICAgICAgICAgICAgICAgICAgICAgICAgICBVX1NIQVBFX1hfTEFNQUxFRl9TVUJfQUxURVJOQVRFLCAmc3RhdHVzKTsKKyAgICAgICAgICAgIC8vIHdlIHNob3VsZG4ndCBmYWlsIHVubGVzcyB0aGVyZSdzIGFuIG91dCBvZiBtZW1vcnkgY29uZGl0aW9uLAorICAgICAgICAgICAgLy8gaW4gd2hpY2ggY2FzZSB3ZSdyZSBob3NlZCBhbnl3YXkKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSBzdGFydCwgZSA9IGkgKyBjb3VudDsgaSA8IGU7ICsraSkgeworICAgICAgICAgICAgICBpZiAoYnVmZmVyW2ldID09IDB4ZmZmZikgeworICAgICAgICAgICAgICAgIGJ1ZmZlcltpXSA9IDB4MjAwYjsgLy8gemVyby13aWR0aC1zcGFjZSBmb3Igc2tpYQorICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICB3aWR0aHMgPSBwYWludC0+Z2V0VGV4dFdpZHRocyhidWZmZXIgKyBzdGFydCwgY291bnQgPDwgMSwgc2NhbGFyQXJyYXkpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgd2lkdGhzID0gcGFpbnQtPmdldFRleHRXaWR0aHModGV4dCArIHN0YXJ0LCBjb3VudCA8PCAxLCBzY2FsYXJBcnJheSk7CisgICAgICAgIH0KKworICAgICAgICBpZiAod2lkdGhzIDwgY291bnQpIHsKKyAgICAgICAgICAgIC8vIFNraWEgb3BlcmF0ZXMgb24gY29kZSBwb2ludHMsIG5vdCBjb2RlIHVuaXRzLCBzbyBzdXJyb2dhdGUgcGFpcnMgcmV0dXJuIG9ubHkKKyAgICAgICAgICAgIC8vIG9uZSB2YWx1ZS4gRXhwYW5kIHRoZSByZXN1bHQgc28gd2UgaGF2ZSBvbmUgdmFsdWUgcGVyIFVURi0xNiBjb2RlIHVuaXQuCisKKyAgICAgICAgICAgIC8vIE5vdGUsIHNraWEncyBnZXRUZXh0V2lkdGggZ2V0cyBjb25mdXNlZCBpZiBpdCBlbmNvdW50ZXJzIGEgc3Vycm9nYXRlIHBhaXIsCisgICAgICAgICAgICAvLyBsZWF2aW5nIHRoZSByZW1haW5pbmcgd2lkdGhzIHplcm8uICBOb3QgbmljZS4KKyAgICAgICAgICAgIGNvbnN0IGpjaGFyICpjaGFycyA9IHRleHQgKyBzdGFydDsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwLCBwID0gMDsgaSA8IHdpZHRoczsgKytpKSB7CisgICAgICAgICAgICAgICAgdG90YWxBZHZhbmNlICs9IGFkdmFuY2VzQXJyYXlbcCsrXSA9IFNrU2NhbGFyVG9GbG9hdChzY2FsYXJBcnJheVtpXSk7CisgICAgICAgICAgICAgICAgaWYgKHAgPCBjb3VudCAmJiBjaGFyc1twXSA+PSAweGRjMDAgJiYgY2hhcnNbcF0gPCAweGUwMDAgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJzW3AtMV0gPj0gMHhkODAwICYmIGNoYXJzW3AtMV0gPCAweGRjMDApIHsKKyAgICAgICAgICAgICAgICAgICAgYWR2YW5jZXNBcnJheVtwKytdID0gMDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgICAgICAgICB0b3RhbEFkdmFuY2UgKz0gYWR2YW5jZXNBcnJheVtpXSA9IFNrU2NhbGFyVG9GbG9hdChzY2FsYXJBcnJheVtpXSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoYWR2YW5jZXMgIT0gTlVMTCkgeworICAgICAgICAgICAgZW52LT5TZXRGbG9hdEFycmF5UmVnaW9uKGFkdmFuY2VzLCBhZHZhbmNlc0luZGV4LCBjb3VudCwgYWR2YW5jZXNBcnJheSk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHRvdGFsQWR2YW5jZTsKKyAgICB9CisKKyAgICBzdGF0aWMgZmxvYXQgZ2V0VGV4dFJ1bkFkdmFuY2VzX19fQ0lJSUlJX0ZJKEpOSUVudiogZW52LCBqb2JqZWN0IGNsYXp6LCBTa1BhaW50KiBwYWludCwKKyAgICAgICAgICAgIGpjaGFyQXJyYXkgdGV4dCwgamludCBpbmRleCwgamludCBjb3VudCwgamludCBjb250ZXh0SW5kZXgsIGppbnQgY29udGV4dENvdW50LAorICAgICAgICAgICAgamludCBmbGFncywgamZsb2F0QXJyYXkgYWR2YW5jZXMsIGppbnQgYWR2YW5jZXNJbmRleCkgeworICAgICAgICBqY2hhciogdGV4dEFycmF5ID0gZW52LT5HZXRDaGFyQXJyYXlFbGVtZW50cyh0ZXh0LCBOVUxMKTsKKyAgICAgICAgamZsb2F0IHJlc3VsdCA9IGRvVGV4dFJ1bkFkdmFuY2VzKGVudiwgcGFpbnQsIHRleHRBcnJheSArIGNvbnRleHRJbmRleCwKKyAgICAgICAgICAgIGluZGV4IC0gY29udGV4dEluZGV4LCBjb3VudCwgY29udGV4dENvdW50LCBmbGFncywgYWR2YW5jZXMsIGFkdmFuY2VzSW5kZXgpOworICAgICAgICBlbnYtPlJlbGVhc2VDaGFyQXJyYXlFbGVtZW50cyh0ZXh0LCB0ZXh0QXJyYXksIEpOSV9BQk9SVCk7CisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorCisgICAgc3RhdGljIGZsb2F0IGdldFRleHRSdW5BZHZhbmNlc19fU3RyaW5nSUlJSUlfRkkoSk5JRW52KiBlbnYsIGpvYmplY3QgY2xhenosIFNrUGFpbnQqIHBhaW50LAorICAgICAgICAgICAganN0cmluZyB0ZXh0LCBqaW50IHN0YXJ0LCBqaW50IGVuZCwgamludCBjb250ZXh0U3RhcnQsIGppbnQgY29udGV4dEVuZCwgamludCBmbGFncywKKyAgICAgICAgICAgIGpmbG9hdEFycmF5IGFkdmFuY2VzLCBqaW50IGFkdmFuY2VzSW5kZXgpIHsKKyAgICAgICAgY29uc3QgamNoYXIqIHRleHRBcnJheSA9IGVudi0+R2V0U3RyaW5nQ2hhcnModGV4dCwgTlVMTCk7CisgICAgICAgIGpmbG9hdCByZXN1bHQgPSBkb1RleHRSdW5BZHZhbmNlcyhlbnYsIHBhaW50LCB0ZXh0QXJyYXkgKyBjb250ZXh0U3RhcnQsCisgICAgICAgICAgICBzdGFydCAtIGNvbnRleHRTdGFydCwgZW5kIC0gc3RhcnQsIGNvbnRleHRFbmQgLSBjb250ZXh0U3RhcnQsIGZsYWdzLCBhZHZhbmNlcywKKyAgICAgICAgICAgIGFkdmFuY2VzSW5kZXgpOworICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdDaGFycyh0ZXh0LCB0ZXh0QXJyYXkpOworICAgICAgICByZXR1cm4gcmVzdWx0OworICAgIH0KKworICAgIHN0YXRpYyBqaW50IGRvVGV4dFJ1bkN1cnNvcihKTklFbnYgKmVudiwgU2tQYWludCogcGFpbnQsIGNvbnN0IGpjaGFyICp0ZXh0LCBqaW50IHN0YXJ0LAorICAgICAgICAgICAgamludCBjb3VudCwgamludCBmbGFncywgamludCBvZmZzZXQsIGppbnQgb3B0KSB7CisgICAgICAgIFNrU2NhbGFyIHNjYWxhckFycmF5W2NvdW50XTsKKyAgIC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MHgyMDBiOyAvLyB6ZXJvLXdpZHRoLXNwYWNlIGZvciBza2lhCisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHdpZHRocyA9IHBhaW50LT5nZXRUZXh0V2lkdGhzKGJ1ZmZlciwgY291bnQgPDwgMSwgc2NhbGFyQXJyYXkpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgd2lkdGhzID0gcGFpbnQtPmdldFRleHRXaWR0aHModGV4dCArIHN0YXJ0LCBjb3VudCA8PCAxLCBzY2FsYXJBcnJheSk7CisgICAgICAgIH0KKworICAgICAgICBpZiAod2lkdGhzIDwgY291bnQpIHsKKyAgICAgICAgICAgIC8vIFNraWEgb3BlcmF0ZXMgb24gY29kZSBwb2ludHMsIG5vdCBjb2RlIHVuaXRzLCBzbyBzdXJyb2dhdGUgcGFpcnMgcmV0dXJuIG9ubHkgb25lCisgICAgICAgICAgICAvLyB2YWx1ZS4gRXhwYW5kIHRoZSByZXN1bHQgc28gd2UgaGF2ZSBvbmUgdmFsdWUgcGVyIFVURi0xNiBjb2RlIHVuaXQuCisKKyAgICAgICAgICAgIC8vIE5vdGUsIHNraWEncyBnZXRUZXh0V2lkdGggZ2V0cyBjb25mdXNlZCBpZiBpdCBlbmNvdW50ZXJzIGEgc3Vycm9nYXRlIHBhaXIsCisgICAgICAgICAgICAvLyBsZWF2aW5nIHRoZSByZW1haW5pbmcgd2lkdGhzIHplcm8uICBOb3QgbmljZS4KKyAgICAgICAgICAgIGNvbnN0IGpjaGFyICpjaGFycyA9IHRleHQgKyBzdGFydDsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSBjb3VudCwgcCA9IHdpZHRocyAtIDE7IC0taSA+IHA7KSB7CisgICAgICAgICAgICAgICAgaWYgKGNoYXJzW2ldID49IDB4ZGMwMCAmJiBjaGFyc1tpXSA8IDB4ZTAwMCAmJgorICAgICAgICAgICAgICAgICAgICAgICAgY2hhcnNbaS0xXSA+PSAweGQ4MDAgJiYgY2hhcnNbaS0xXSA8IDB4ZGMwMCkgeworICAgICAgICAgICAgICAgICAgICBzY2FsYXJBcnJheVtpXSA9IDA7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgIHNjYWxhckFycmF5W2ldID0gc2NhbGFyQXJyYXlbLS1wXTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBqaW50IHBvcyA9IG9mZnNldCAtIHN0YXJ0OworICAgICAgICBzd2l0Y2ggKG9wdCkgeworICAgICAgICBjYXNlIEFGVEVSOgorICAgICAgICAgIGlmIChwb3MgPCBjb3VudCkgeworICAgICAgICAgICAgcG9zICs9IDE7CisgICAgICAgICAgfQorICAgICAgICAgIC8vIGZhbGwgdGhyb3VnaAorICAgICAgICBjYXNlIEFUX09SX0FGVEVSOgorICAgICAgICAgIHdoaWxlIChwb3MgPCBjb3VudCAmJiBzY2FsYXJBcnJheVtwb3NdID09IDApIHsKKyAgICAgICAgICAgICsrcG9zOworICAgICAgICAgIH0KKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBCRUZPUkU6CisgICAgICAgICAgaWYgKHBvcyA+IDApIHsKKyAgICAgICAgICAgIC0tcG9zOworICAgICAgICAgIH0KKyAgICAgICAgICAvLyBmYWxsIHRocm91Z2gKKyAgICAgICAgY2FzZSBBVF9PUl9CRUZPUkU6CisgICAgICAgICAgd2hpbGUgKHBvcyA+IDAgJiYgc2NhbGFyQXJyYXlbcG9zXSA9PSAwKSB7CisgICAgICAgICAgICAtLXBvczsKKyAgICAgICAgICB9CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgQVQ6CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgaWYgKHNjYWxhckFycmF5W3Bvc10gPT0gMCkgeworICAgICAgICAgICAgcG9zID0gLTE7CisgICAgICAgICAgfQorICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgaWYgKHBvcyAhPSAtMSkgeworICAgICAgICAgIHBvcyArPSBzdGFydDsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBwb3M7CisgICAgfQorCisgICAgc3RhdGljIGppbnQgZ2V0VGV4dFJ1bkN1cnNvcl9fX0MoSk5JRW52KiBlbnYsIGpvYmplY3QgY2xhenosIFNrUGFpbnQqIHBhaW50LCBqY2hhckFycmF5IHRleHQsCisgICAgICAgICAgICBqaW50IGNvbnRleHRTdGFydCwgamludCBjb250ZXh0Q291bnQsIGppbnQgZmxhZ3MsIGppbnQgb2Zmc2V0LCBqaW50IGN1cnNvck9wdCkgeworICAgICAgICBqY2hhciogdGV4dEFycmF5ID0gZW52LT5HZXRDaGFyQXJyYXlFbGVtZW50cyh0ZXh0LCBOVUxMKTsKKyAgICAgICAgamludCByZXN1bHQgPSBkb1RleHRSdW5DdXJzb3IoZW52LCBwYWludCwgdGV4dEFycmF5LCBjb250ZXh0U3RhcnQsIGNvbnRleHRDb3VudCwgZmxhZ3MsCisgICAgICAgICAgICAgICAgb2Zmc2V0LCBjdXJzb3JPcHQpOworICAgICAgICBlbnYtPlJlbGVhc2VDaGFyQXJyYXlFbGVtZW50cyh0ZXh0LCB0ZXh0QXJyYXksIEpOSV9BQk9SVCk7CisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorCisgICAgc3RhdGljIGppbnQgZ2V0VGV4dFJ1bkN1cnNvcl9fU3RyaW5nKEpOSUVudiogZW52LCBqb2JqZWN0IGNsYXp6LCBTa1BhaW50KiBwYWludCwganN0cmluZyB0ZXh0LAorICAgICAgICAgICAgamludCBjb250ZXh0U3RhcnQsIGppbnQgY29udGV4dEVuZCwgamludCBmbGFncywgamludCBvZmZzZXQsIGppbnQgY3Vyc29yT3B0KSB7CisgICAgICAgIGNvbnN0IGpjaGFyKiB0ZXh0QXJyYXkgPSBlbnYtPkdldFN0cmluZ0NoYXJzKHRleHQsIE5VTEwpOworICAgICAgICBqaW50IHJlc3VsdCA9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nYsIG9iamVjdCk7Ci1MT0dfV0lORE9XKCJDaGVja2luZyBmb3IgTlVMTCBhdCAlZCwlZCBmcm9tICVwIiwgcm93LCBjb2x1bW4sIHdpbmRvdyk7CisgICAgTE9HX1dJTkRPVygiQ2hlY2tpbmcgZm9yIE5VTEwgYXQgJWQsJWQgZnJvbSAlcCIsIHJvdywgY29sdW1uLCB3aW5kb3cpOwogCiAgICAgYm9vbCBpc051bGw7CiAgICAgaWYgKHdpbmRvdy0+Z2V0TnVsbChyb3csIGNvbHVtbiwgJmlzTnVsbCkpIHsKQEAgLTY1Miw2ICs1ODcsMjYgQEAKICAgICB3aW5kb3ctPmZyZWVMYXN0Um93KCk7CiB9CiAKK3N0YXRpYyBqaW50IGdldFR5cGVfbmF0aXZlKEpOSUVudiogZW52LCBqb2JqZWN0IG9iamVjdCwgamludCByb3csIGppbnQgY29sdW1uKQoreworICAgIGludDMyX3QgZXJyOworICAgIEN1cnNvcldpbmRvdyAqIHdpbmRvdyA9IEdFVF9XSU5ET1coZW52LCBvYmplY3QpOworICAgIExPR19XSU5ET1coInJldHVybmluZyBjb2x1bW4gdHlwZSBhZmZpbml0eSBmb3IgJWQsJWQgZnJvbSAlcCIsIHJvdywgY29sdW1uLCB3aW5kb3cpOworCisgICAgaWYgKGlzTnVsbF9uYXRpdmUod2luZG93LCByb3csIGNvbHVtbikpIHsKKyAgICAgIHJldHVybiBGSUVMRF9UWVBFX05VTEw7CisgICAgfQorCisgICAgZmllbGRfc2xvdF90IGZpZWxkOworICAgIGVyciA9IHdpbmRvdy0+cmVhZF9maWVsZF9zbG90KHJvdywgY29sdW1uLCAmZmllbGQpOworICAgIGlmIChlcnIgIT0gMCkgeworICAgICAgICB0aHJvd0V4Y2VwdGlvbldpdGhSb3dDb2woZW52LCByb3csIGNvbHVtbik7CisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICAgIHJldHVybiBmaWVsZC50eXBlOworfQorCiBzdGF0aWMgSk5JTmF0aXZlTWV0aG9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mRldmljZSk7CisgICAgdmlydHVhbCB2b2lkICAgIGRldmljZVJlbW92ZWQoTXRwRGV2aWNlICpkZXZpY2UpOworCisgICAgYm9vbCAgICAgICAgICAgIHJlcG9ydERldmljZUFkZGVkKEpOSUVudiAqZW52LCBNdHBEZXZpY2UgKmRldmljZSk7CisgICAgYm9vbCAgICAgICAgICAgIHJlcG9ydERldmljZVJlbW92ZWQoSk5JRW52ICplbnYsIE10cERldmljZSAqZGV2aWNlKTsKKworICAgIEpOSUVudiogICAgICAgICBtRW52OworICAgIGpvYmplY3QgICAgICAgICBtQ2xpZW50OworICAgIE11dGV4ICAgICAgICAgICBtRXZlbnRMb2NrOworICAgIENvbmRpdGlvbiAgICAgICBtRXZlbnRDb25kaXRpb247CisgICAgTXV0ZXggICAgICAgICAgIG1BY2tMb2NrOworICAgIENvbmRpdGlvbiAgICAgICBtQWNrQ29uZGl0aW9uOworICAgIGludCAgICAgICAgICAgICBtRXZlbnQ7CisgICAgTXRwRGV2aWNlKiAgICAgIG1FdmVudERldmljZTsKKworcHVibGljOgorICAgICAgICAgICAgICAgICAgICBNeUNsaWVudChKTklFbnYgKmVudiwgam9iamVjdCBjbGllbnQpOworICAgIHZpcnR1YWwgICAgICAgICB+TXlDbGllbnQoKTsKKyAgICB2b2lkICAgICAgICAgICAgd2FpdEZvckV2ZW50KEpOSUVudiAqZW52KTsKKworfTsKKworTXRwQ2xpZW50KiBnZXRfY2xpZW50X2Zyb21fb2JqZWN0KEpOSUVudiogZW52LCBqb2JqZWN0IGphdmFDbGllbnQpCit7CisgICAgcmV0dXJuIChNdHBDbGllbnQqKWVudi0+R2V0SW50RmllbGQoamF2YUNsaWVudCwgZmllbGRfY29udGV4dCk7Cit9CisKKworTXlDbGllbnQ6Ok15Q2xpZW50KEpOSUVudiAqZW52LCBqb2JqZWN0IGNsaWVudCkKKyAgICA6ICAgbUVudihlbnYpLAorICAgICAgICBtQ2xpZW50KGVudi0+TmV3R2xvYmFsUmVmKGNsaWVudCkpLAorICAgICAgICBtRXZlbnQoMCksCisgICAgICAgIG1FdmVudERldmljZShOVUxMKQoreworfQorCitNeUNsaWVudDo6fk15Q2xpZW50KCkgeworICAgIG1FbnYtPkRlbGV0ZUdsb2JhbFJlZihtQ2xpZW50KTsKK30KKworCit2b2lkIE15Q2xpZW50OjpkZXZpY2VBZGRlZChNdHBEZXZpY2UgKmRldmljZSkgeworICAgIExPR0QoIk15Q2xpZW50OjpkZXZpY2VBZGRlZFxuIik7CisgICAgbUFja0xvY2subG9jaygpOworICAgIG1FdmVudExvY2subG9jaygpOworICAgIG1FdmVudCA9IGtEZXZpY2VBZGRlZDsKKyAgICBtRXZlbnREZXZpY2UgPSBkZXZpY2U7CisgICAgbUV2ZW50Q29uZGl0aW9uLnNpZ25hbCgpOworICAgIG1FdmVudExvY2sudW5sb2NrKCk7CisgICAgbUFja0NvbmRpdGlvbi53YWl0KG1BY2tMb2NrKTsKKyAgICBtQWNrTG9jay51bmxvY2soKTsKK30KKwordm9pZCBNeUNsaWVudDo6ZGV2aWNlUmVtb3ZlZChNdHBEZXZpY2UgKmRldmljZSkgeworICAgIExPR0QoIk15Q2xpZW50OjpkZXZpY2VSZW1vdmVkXG4iKTsKKyAgICBtQWNrTG9jay5sb2NrKCk7CisgICAgbUV2ZW50TG9jay5sb2NrKCk7CisgICAgbUV2ZW50ID0ga0RldmljZVJlbW92ZWQ7CisgICAgbUV2ZW50RGV2aWNlID0gZGV2aWNlOworICAgIG1FdmVudENvbmRpdGlvbi5zaWduYWwoKTsKKyAgICBtRXZlbnRMb2NrLnVubG9jaygpOworICAgIG1BY2tDb25kaXRpb24ud2FpdChtQWNrTG9jayk7CisgICAgbUFja0xvY2sudW5sb2NrKCk7Cit9CisKK2Jvb2wgTXlDbGllbnQ6OnJlcG9ydERldmljZUFkZGVkKEpOSUVudiAqZW52LCBNdHBEZXZpY2UgKmRldmljZSkgeworICAgIGNvbnN0IGNoYXIqIG5hbWUgPSBkZXZpY2UtPmdldERldmljZU5hbWUoKTsKKyAgICBMT0dEKCJNeUNsaWVudDo6cmVwb3J0RGV2aWNlQWRkZWQgJXNcbiIsIG5hbWUpOworCisgICAgZW52LT5DYWxsVm9pZE1ldGhvZChtQ2xpZW50LCBtZXRob2RfZGV2aWNlQWRkZWQsIGRldmljZS0+Z2V0SUQoKSk7CisKKyAgICByZXR1cm4gKCFlbnYtPkV4Y2VwdGlvbkNoZWNrKCkpOworfQorCitib29sIE15Q2xpZW50OjpyZXBvcnREZXZpY2VSZW1vdmVkKEpOSUVudiAqZW52LCBNdHBEZXZpY2UgKmRldmljZSkgeworICAgY29uc3QgY2hhciogbmFtZSA9IGRldmljZS0+Z2V0RGV2aWNlTmFtZSgpOworICAgIExPR0QoIk15Q2xpZW50OjpyZXBvcnREZXZpY2VSZW1vdmVkICVzXG4iLCBuYW1lKTsKKworICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobUNsaWVudCwgbWV0aG9kX2RldmljZVJlbW92ZWQsIGRldmljZS0+Z2V0SUQoKSk7CisKKyAgICByZXR1cm4gKCFlbnYtPkV4Y2VwdGlvbkNoZWNrKCkpOworfQorCit2b2lkIE15Q2xpZW50Ojp3YWl0Rm9yRXZlbnQoSk5JRW52ICplbnYpIHsKKyAgICBtRXZlbnRMb2NrLmxvY2soKTsKKyAgICBtRXZlbnRDb25kaXRpb24ud2FpdChtRXZlbnRMb2NrKTsKKyAgICBtRXZlbnRMb2NrLnVubG9jaygpOworCisgICAgc3dpdGNoIChtRXZlbnQpIHsKKyAgICAgICAgY2FzZSBrRGV2aWNlQWRkZWQ6CisgICAgICAgICAgICByZXBvcnREZXZpY2VBZGRlZChlbnYsIG1FdmVudERldmljZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBrRGV2aWNlUmVtb3ZlZDoKKyAgICAgICAgICAgIHJlcG9ydERldmljZVJlbW92ZWQoZW52LCBtRXZlbnREZXZpY2UpOworICAgICAgICAgICAgYnJlYWs7CisgICAgfQorCisgICAgbUFja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llbGQodGhpeiwgZmllbGRfY29udGV4dCk7CisgICAgY2xpZW50LT53YWl0Rm9yRXZlbnQoZW52KTsKK30KKworc3RhdGljIGpib29sZWFuCithbmRyb2lkX21lZGlhX010cENsaWVudF9kZWxldGVfb2JqZWN0KEpOSUVudiAqZW52LCBqb2JqZWN0IHRoaXosCisgICAgICAgIGppbnQgZGV2aWNlX2lkLCBqaW50IG9iamVjdF9pZCkKK3sKKyAgICBNeUNsaWVudCAqY2xpZW50ID0gKE15Q2xpZW50ICopZW52LT5HZXRJbnRGaWVsZCh0aGl6LCBmaWVsZF9jb250ZXh0KTsKKyAgICBNdHBEZXZpY2UqIGRldmljZSA9IGNsaWVudC0+Z2V0RGV2aWNlKGRldmljZV9pZCk7CisgICAgaWYgKGRldmljZSkKKyAgICAgICAgcmV0dXJuIGRldmljZS0+ZGVsZXRlT2JqZWN0KG9iamVjdF9pZCk7CisgICAgZWxzZQorICAgICAgICByZXR1cm4gTlVMTDsKK30KKworc3RhdGljIGppbnQKK2FuZHJvaWRfbWVkaWFfTXRwQ2xpZW50X2dldF9wYXJlbnQoSk5JRW52ICplbnYsIGpvYmplY3QgdGhpeiwKKyAgICAgICAgamludCBkZXZpY2VfaWQsIGppbnQgb2JqZWN0X2lkKQoreworICAgIE15Q2xpZW50ICpjbGllbnQgPSAoTXlDbGllbnQgKillbnYtPkdldEludEZpZWxkKHRoaXosIGZpZWxkX2NvbnRleHQpOworICAgIE10cERldmljZSogZGV2aWNlID0gY2xpZW50LT5nZXREZXZpY2UoZGV2aWNlX2lkKTsKKyAgICBpZiAoZGV2aWNlKQorICAgICAgICByZXR1cm4gZGV2aWNlLT5nZXRQYXJlbnQob2JqZWN0X2lkKTsKKyAgICBlbHNlCisgICAgICAgIHJldHVybiAtMTsKK30KKworc3RhdGljIGppbnQKK2FuZHJvaWRfbWVkaWFfTXRwQ2xpZW50X2dldF9zdG9yYWdlX2lkKEpOSUVudiAqZW52LCBqb2JqZWN0IHRoaXosCisgICAgICAgIG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vcmFnZV9pZCIsICAiKElJKUkiLCAodm9pZCAqKWFuZHJvaWRfbWVkaWFfTXRwQ2xpZW50X2dldF9zdG9yYWdlX2lkfSwKK307CisKK3N0YXRpYyBjb25zdCBjaGFyKiBjb25zdCBrQ2xhc3NQYXRoTmFtZSA9ICJhbmRyb2lkL21lZGlhL010cENsaWVudCI7CisKK2ludCByZWdpc3Rlcl9hbmRyb2lkX21lZGlhX010cENsaWVudChKTklFbnYgKmVudikKK3sKKyAgICBqY2xhc3MgY2xheno7CisKKyAgICBMT0dEKCJyZWdpc3Rlcl9hbmRyb2lkX21lZGlhX010cENsaWVudFxuIik7CisKKyAgICBjbGF6eiA9IGVudi0+RmluZENsYXNzKCJhbmRyb2lkL21lZGlhL010cENsaWVudCIpOworICAgIGlmIChjbGF6eiA9PSBOVUxMKSB7CisgICAgICAgIExPR0UoIkNhbid0IGZpbmQgYW5kcm9pZC9tZWRpYS9NdHBDbGllbnQiKTsKKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KKyAgICBtZXRob2RfZGV2aWNlQWRkZWQgPSBlbnYtPkdldE1ldGhvZElEKGNsYXp6LCAiZGV2aWNlQWRkZWQiLCAiKEkpViIpOworICAgIGlmIChtZXRob2RfZGV2aWNlQWRkZWQgPT0gTlVMTCkgeworICAgICAgICBMT0dFKCJDYW4ndCBmaW5kIGRldmljZUFkZGVkIik7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisgICAgbWV0aG9kX2RldmljZVJlbW92ZWQgPSBlbnYtPkdldE1ldGhvZElEKGNsYXp6LCAiZGV2aWNlUmVtb3ZlZCIsICIoSSlWIik7CisgICAgaWYgKG1ldGhvZF9kZXZpY2VSZW1vdmVkID09IE5VTEwpIHsKKyAgICAgICAgTE9HRSgiQ2FuJ3QgZmluZCBkZXZpY2VSZW1vdmVkIik7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisgICAgZmllbGRfY29udGV4dCA9IGVudi0+R2V0RmllbGRJRChjbGF6eiwgI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IGVudiwgam9iamVjdCBqYXZhV2luZG93KTsKKworLy8gRnJvbSBhbmRyb2lkX21lZGlhX010cENsaWVudC5jcHAKK010cENsaWVudCAqIGdldF9jbGllbnRfZnJvbV9vYmplY3QoSk5JRW52ICogZW52LCBqb2JqZWN0IGphdmFDbGllbnQpOworCisvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKK3N0YXRpYyBib29sIEV4Y2VwdGlvbkNoZWNrKHZvaWQqIGVudikKK3sKKyAgICByZXR1cm4gKChKTklFbnYgKillbnYpLT5FeGNlcHRpb25DaGVjaygpOworfQorCitzdGF0aWMgdm9pZAorYW5kcm9pZF9tZWRpYV9NdHBDdXJzb3Jfc2V0dXAoSk5JRW52ICplbnYsIGpvYmplY3QgdGhpeiwgam9iamVjdCBqYXZhQ2xpZW50LAorICAgICAgICBqaW50IHF1ZXJ5VHlwZSwgamludCBkZXZpY2VJRCwgamludCBzdG9yYWdlSUQsIGppbnQgb2JqZWN0SUQsIGppbnRBcnJheSBqYXZhQ29sdW1ucykKK3sKKyAgICBMT0dEKCJhbmRyb2lkX21lZGlhX010cEN1cnNvcl9zZXR1cCBxdWVyeVR5cGU6ICVkIGRldmljZUlEOiAlZCBzdG9yYWdlSUQ6ICVkIG9iamVjdElEOiAlZFxuIiwKKyAgICAgICAgICAgICAgICBxdWVyeVR5cGUsIGRldmljZUlELCBzdG9yYWdlSUQsIG9iamVjdElEKTsKKworICAgIGludCogY29sdW1ucyA9IE5VTEw7CisgICAgaW50IGNvbHVtbkNvdW50ID0gMDsKKyAgICBpZiAoamF2YUNvbHVtbnMpIHsKKyAgICAgICAgY29sdW1ucyA9IGVudi0+R2V0SW50QXJyYXlFbGVtZW50cyhqYXZhQ29sdW1ucywgMCk7CisgICAgICAgIGNvbHVtbkNvdW50ID0gZW52LT5HZXRBcnJheUxlbmd0aChqY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hL2xhbmcvSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIkJhZCBDdXJzb3JXaW5kb3ciKTsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorICAgIE10cEN1cnNvciAqY3Vyc29yID0gKE10cEN1cnNvciAqKWVudi0+R2V0SW50RmllbGQodGhpeiwgZmllbGRfY29udGV4dCk7CisKKyAgICByZXR1cm4gY3Vyc29yLT5maWxsV2luZG93KHdpbmRvdywgc3RhcnRQb3MpOworfQorCisvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKK3N0YXRpYyBKTklOYXRpdmVNZXRob2QgZ01ldGhvZHNbXSA9IHsKKyAgICB7Im5hdGl2ZV9zZXR1cCIsICAgICAgICAgICAgIihMYW5kcm9pZC9tZWRpYS9NdHBDbGllbnQ7SUlJSVtJKVYiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopYW5kcm9pZF9tZWRpYV9NdHBDdXJzb3Jfc2V0dXB9LAorICAgIHsibmF0aXZlX2ZpbmFsaXplIiwgICAgICAgICAiKClWIiwgICh2b2lkICopYW5kcm9pZF9tZWRpYV9NdHBDdXJzb3JfZmluYWxpemV9LAorICAgIHsibmF0aXZlX2ZpbGxfd2luZG93IiwgICAgICAiKExhbmRyb2lkL2RhdGFiYXNlL0N1cnNvcldpbmRvdztJKUkiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopYW5kcm9pZF9tZWRpYV9NdHBDdXJzb3JfZmlsbF93aW5kb3d9LAorCit9OworCitzdGF0aWMgY29uc3QgY2hhciogY29uc3Qga0NsYXNzUGF0aE5hbWUgPSAiYW5kcm9pZC9tZWRpYS9NdHBDdXJzb3IiOworCitpbnQgcmVnaXN0ZX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ldG9vdGhFdmVudExvb3AuY3BwIGIvY29yZS9qbmkvYW5kcm9pZF9zZXJ2ZXJfQmx1ZXRvb3RoRXZlbnRMb29wLmNwcAppbmRleCAwMWI2NzExLi4zYzg4MTU4IDEwMDY0NAotLS0gYS9jb3JlL2puaS9hbmRyb2lkX3NlcnZlcl9CbHVldG9vdGhFdmVudExvb3AuY3BwCisrKyBiL2NvcmUvam5pL2FuZHJvaWRfc2VydmVyX0JsdWV0b290aEV2ZW50TG9vcC5jcHAKQEAgLTY0LDYgKzY0LDggQEAKIHN0YXRpYyBqbWV0aG9kSUQgbWV0aG9kX29uQWdlbnRBdXRob3JpemU7CiBzdGF0aWMgam1ldGhvZElEIG1ldGhvZF9vbkFnZW50Q2FuY2VsOwogCitzdGF0aWMgam1ldGhvZElEIG1ldGhvZF9vbklucHV0RGV2aWNlUHJvcGVydHlDaGFuZ2VkOworCiB0eXBlZGVmIGV2ZW50X2xvb3BfbmF0aXZlX2RhdGFfdCBuYXRpdmVfZGF0YV90OwogCiAjZGVmaW5lIEVWRU5UX0xPT1BfUkVGUyAxMApAQCAtMTE2LDYgKzExOCw5IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIoTGphdmEvbGFuZy9TdHJpbmc7SSlWIik7CiAgICAgbWV0aG9kX29uRGlzcGxheVBhc3NrZXkgPSBlbnYtPkdldE1ldGhvZElEKGNsYXp6LCAib25EaXNwbGF5UGFzc2tleSIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIoTGphdmEvbGFuZy9TdHJpbmc7SUkpViIpOworICAgIG1ldGhvZF9vbklucHV0RGV2aWNlUHJvcGVydHlDaGFuZ2VkID0gZW52LT5HZXRNZXRob2RJRChjbGF6eiwgIm9uSW5wdXREZXZpY2VQcm9wZXJ0eUNoYW5nZWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIihMamF2YS9sYW5nL1N0cmluZztbTGphdmEvbGFuZy9TdHJpbmc7KVYiKTsKKwogCiAgICAgZmllbGRfbU5hdGl2ZURhdGEgPSBlbnYtPkdldEZpZWxkSUQoY2xhenosICJtTmF0aXZlRGF0YSIsICJJIik7CiAjZW5kaWYKQEAgLTg1Myw2ICs4NTgsMjIgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Rfb25EZXZpY2VEaXNjb25uZWN0UmVxdWVzdGVkLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudi0+TmV3U3RyaW5nVVRGKHJlbW90ZV9kZXZpY2VfcGF0aCkpOwogICAgICAgICBnb3RvIHN1Y2Nlc3M7CisgICAgfSBlbHNlIGlmIChkYnVzX21lc3NhZ2VfaXNfc2lnbmFsKG1zZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm9yZy5ibHVlei5JbnB1dCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJQcm9wZXJ0eUNoYW5nZWQiKSkgeworCisgICAgICAgIGpvYmplY3RBcnJheSBzdHJfYXJyYXkgPQorICAgICAgICAgICAgICAgICAgICBwYXJzZV9pbnB1dF9wcm9wZXJ0eV9jaGFuZ2UoZW52LCBtc2cpOworICAgICAgICBpZiAoc3RyX2FycmF5ICE9IE5VTEwpIHsKKyAgICAgICAgICAgIGNvbnN0IGNoYXIgKmNfcGF0aCA9IGRidXNfbWVzc2FnZV9nZXRfcGF0aChtc2cpOworICAgICAgICAgICAgZW52LT5DYWxsVm9pZE1ldGhvZChuYXQtPm1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Rfb25JbnB1dERldmljZVByb3BlcnR5Q2hhbmdlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW52LT5OZXdTdHJpbmdVVEYoY19wYXRoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyX2FycmF5KTsKKy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5DVElPTl9fKTsKKyNpZmRlZiBIQVZFX0JMVUVUT09USAorICAgIG5hdGl2ZV9kYXRhX3QgKm5hdCA9IGdldF9uYXRpdmVfZGF0YShlbnYsIG9iamVjdCk7CisgICAgaWYgKG5hdCkgeworICAgICAgICBjb25zdCBjaGFyICpjX3BhdGggPSBlbnYtPkdldFN0cmluZ1VURkNoYXJzKHBhdGgsIE5VTEwpOworCisgICAgICAgIGJvb2wgcmV0ID0gZGJ1c19mdW5jX2FyZ3NfYXN5bmMoZW52LCBuYXQtPmNvbm4sIC0xLCBOVUxMLCBOVUxMLCBuYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjX3BhdGgsIERCVVNfSU5QVVRfSUZBQ0UsICJDb25uZWN0IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9JTlZBTElEKTsKKworICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdVVEZDaGFycyhwYXRoLCBjX3BhdGgpOworICAgICAgICByZXR1cm4gcmV0ID8gSk5JX1RSVUUgOiBKTklfRkFMU0U7CisgICAgfQorI2VuZGlmCisgICAgcmV0dXJuIEpOSV9GQUxTRTsKK30KKworc3RhdGljIGpib29sZWFuIGRpc2Nvbm5lY3RJbnB1dERldmljZU5hdGl2ZShKTklFbnYgKmVudiwgam9iamVjdCBvYmplY3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganN0cmluZyBwYXRoKSB7CisgICAgTE9HVihfX0ZVTkNUSU9OX18pOworI2lmZGVmIEhBVkVfQkxVRVRPT1RICisgICAgbmF0aXZlX2RhdGFfdCAqbmF0ID0gZ2V0X25hdGl2ZV9kYXRhKGVudiwgb2JqZWN0KTsKKyAgICBpZiAobmF0KSB7CisgICAgICAgIGNvbnN0IGNoYXIgKmNfcGF0aCA9IGVudi0+R2V0U3RyaW5nVVRGQ2hhcnMocGF0aCwgTlVMTCk7CisKKyAgICAgICAgYm9vbCByZXQ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ICAgIihJKVYiLCAgICAgICAodm9pZCopIGFuZHJvaWRfdmlld19HTEVTMjBSZW5kZXJlcl9yZXN0b3JlIH0sCisgICAgeyAgICJuUmVzdG9yZVRvQ291bnQiLCAgICAiKElJKVYiLCAgICAgICh2b2lkKikgYW5kcm9pZF92aWV3X0dMRVMyMFJlbmRlcmVyX3Jlc3RvcmVUb0NvdW50IH0sCisgICAgeyAgICJuR2V0U2F2ZUNvdW50IiwgICAgICAiKEkpSSIsICAgICAgICh2b2lkKikgYW5kcm9pZF92aWV3X0dMRVMyMFJlbmRlcmVyX2dldFNhdmVDb3VudCB9LAorCisgICAgeyAgICJuU2F2ZUxheWVyIiwgICAgICAgICAiKElGRkZGSUkpSSIsICh2b2lkKikgYW5kcm9pZF92aWV3X0dMRVMyMFJlbmRlcmVyX3NhdmVMYXllciB9LAorICAgIHsgICAiblNhdmVMYXllckFscGhhIiwgICAgIihJRkZGRklJKUkiLCAodm9pZCopIGFuZHJvaWRfdmlld19HTEVTMjBSZW5kZXJlcl9zYXZlTGF5ZXJBbHBoYSB9LAorCisgICAgeyAgICJuUXVpY2tSZWplY3QiLCAgICAgICAiKElGRkZGSSlaIiwgICh2b2lkKikgYW5kcm9pZF92aWV3X0dMRVMyMFJlbmRlcmVyX3F1aWNrUmVqZWN0IH0sCisgICAgeyAgICJuQ2xpcFJlY3QiLCAgICAgICAgICAiKElGRkZGKVoiLCAgICh2b2lkKikgYW5kcm9pZF92aWV3X0dMRVMyMFJlbmRlcmVyX2NsaXBSZWN0RiB9LAorICAgIHsgICAibkNsaXBSZWN0IiwgICAgICAgICAgIihJSUlJSSlaIiwgICAodm9pZCopIGFuZHJvaWRfdmlld19HTEVTMjBSZW5kZXJlcl9jbGlwUmVjdCB9LAorCisgICAgeyAgICJuVHJhbnNsYXRlIiwgICAgICAgICAiKElGRilWIiwgICAgICh2b2lkKikgYW5kcm9pZF92aWV3X0dMRVMyMFJlbmRlcmVyX3RyYW5zbGF0ZSB9LAorICAgIHsgICAiblJvdGF0ZSIsICAgICAgICAgICAgIihJRilWIiwgICAgICAodm9pZCopIGFuZHJvaWRfdmlld19HTEVTMjBSZW5kZXJlcl9yb3RhdGUgfSwKKyAgICB7ICAgIm5TY2FsZSIsICAgICAgICAgICAgICIoSUZGKVYiLCAgICAgKHZvaWQqKSBhbmRyb2lkX3ZpZXdfR0xFUzIwUmVuZGVyZXJfc2NhbGUgfSwKKworICAgIHsgICAiblNldE1hdHJpeCIsICAgICAgICAgIihJSSlWIiwgICAgICAodm9pZCopIGFuZHJvaWRfdmlld19HTEVTMjBSZW5kZXJlcl9zZXRNYXRyaXggfSwKKyAgICB7ICAgIm5HZXRNYXRyaXgiLCAgICAgICAgICIoSUkpViIsICAgICAgKHZvaWQqKSBhbmRyb2lkX3ZpZXdfR0xFUzIwUmVuZGVyZXJfZ2V0TWF0cml4IH0sCisgICAgeyAgICJuQ29uY2F0TWF0cml4IiwgICAgICAiKElJKVYiLCAgICAgICh2b2lkKikgYW5kcm9pZF92aWV3X0dMRVMyMFJlbmRlcmVyX2NvbmNhdE1hdHJpeCB9LAorCisgICAgeyAgICJuRHJhd0NvbG9yIiwgICAgICAgICAiKElJSSlWIiwgICAgICh2b2lkKikgYW5kcm9pZF92aWV3X0dMRVMyMFJlbmRlcmVyX2RyYXdDb2xvciB9LAorICAgIHsgICAibkRyYXdSZWN0IiwgICAgICAgICAgIihJRkZGRkkpViIsICAodm9pZCopIGFuZHJvaWRfdmlld19HTEVTMjBSZW5kZXJlcl9kcmF3UmVjdCB9LAorCisgICAgeyAgICJuR2V0Q2xpcEJvdW5kcyIsICAgICAiKElMYW5kcm9pZC9ncmFwaGljcy9SZWN0OylaIiwKKyAgICAgICAgICAgICh2b2lkKikgYW5kcm9pZF92aWV3X0dMRVMyMFJlbmRlcmVyX2dldENsaXBCb3VuZHMgfSwKK307CisKKyNkZWZpbmUgRklORF9DTEFTUyh2YXIsIGNsYXNzTmFtZSkgXAorICAgICAgICB2YXIgPSBlbnYtPkZpbmRD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MW1hCisuYW41YworLmEybgorLjJhbmc0CisuYW4xaTVtCisuYW4xdDQKKy5hbjN0ZQorLmFudGk1cworLmFudDJpCisuYTRyNXMyCisuMmEycgorLmFyNHQyaWU0CisuYXIxdGkKKy5hcjR0eQorLmFzM2MKKy5hczFwCisuYTJzMXMKKy5hc3RlcjUKKy5hMnRvbTUKKy5hMXRvCisuYXUxZAorLmF2NGkKKy5hd240CisuYmE0ZworLmJhNW5hCisuYmEybgorLmJhczRlCisuYmVyNAorLmJlNXIxYQorLmJlM3MxbQorLjRiZXM0CisuYjRlNXMydG8KKy5icmkyCisuYnV0NHRpCisuYnU0dDN0MgorLmNhbTRwZQorLjFjYQorLmNhNG0xcAorLmNhbjVjCisuY2EybgorLmNhcGE1YgorLmNhMXBhCisuY2FyNW9sCisuYzJhMnIKKy5jYTR0CisuY2U0bGEKKy4yY2g0CisuY2hpbGw1aQorLmNoNGlsMgorLmNoaWwxbAorLjFjaTIKKy5jaXQ1cgorLjJjMWl0CisuY28zZTIKKy4xY28KKy5jbzRyCisuY29yNW4xZXIKKy5jb3JuMmUKKy5kZTRtb2kyCisuZDRlbQorLmRlMW1vCisuZGUzbworLmRlM3IxYQorLmRlM3IxaQorLmRlMXM0YworLmRlczIKKy5kaWMxdDJpbzUKKy4zZGkyYzF0CisuZG80dAorLjFkbworLmR1NGMKKy4xZHUKKy5kdTRtMWI1CisuZWFydGg1CisuZWFyMnQKKy5lMmEycgorLmVhczNpCisuMmUxYjQKKy5lZXI0CisuZWcyCisuZTJsNWQKKy5lbDNlbQorLmVuYW0zCisuZTFuYQorLmVuM2cKKy5lMm4zczIKKy5lcTV1aTV0CisuZTFxCisuZXF1MgorLmVxMnVpMgorLmVyNHJpCisuZXIxcjQKKy5lczMKKy40ZXUzCisuZXllNQorLmZlczMKKy5mb3I1bWVyCisuMWZvCisuZm8ycgorLmZvcjFtCisuZm9yMm1lCisuMWdhMgorLmdlMgorLmdlbjN0NAorLjFnZW4KKy5nZTVvMmcKKy4xZ2VvCisuMWcyaTVhCisuZ2k0YgorLmdvNHIKKy4xZ28KKy5oYW5kNWkKKy5oYTJuCisuaDRhbmQKKy5oYTRuNWsyCisuaGUyCisuaGVybzVpMgorLmgyZXJvCisuaDFlczMKKy5oZTR0MworLmhpM2IKKy5oaTNlcgorLmgyaWU0CisuaG9uNWV5CisuaG8ybgorLmhvbjNvCisuaG92NQorLmlkNGwKKy4yaWQKKy5pZG9sMworLmkxZG8KKy5pbTNtCisuaW01cDFpMm4KKy5pNG0xcAorLmltMnBpCisuaW4xCisuaW4zY2kKKy4yaW5lMgorLjRpNG4yazIKKy4yaTJuM3MyCisuaXI1cjQKKy40aXIKKy5pczRpCisuanUzcgorLmxhNGN5CisubGE0bQorLmxhdDVlcgorLmw0YXRoNQorLmxlMgorLmxlZzVlCisubGVuNAorLmxlcDUKKy5sZXYxCisubDJpNGcKKy5saTFnNWEKKy5saTJuCisubDJpM28KKy5sMWk0dAorLm1hMWc1YTUKKy4xbWEKKy5tYWw1bworLm1hMW41YQorLm1hMm4KKy5tYXI1dGkKKy5tMmEycgorLm1lMgorLm1lcjNjCisubWU1dGVyCisubWUxdGUKKy5tMmlzMQorLm1pczR0NWkKKy5tb24zZQorLjFtbworLm1vMm4KKy5tbzNybworLm1vMnIKKy5tdTV0YQorLjFtdQorLm11MnRhNWIKKy5uaTRjCisub2QyCisub2QxZDUKKy5vZjV0ZQorLm8yZnQKKy5vcjVhMXRvCisubzFyYQorLm9yM2MKKy5vcjFkCisub3IzdAorLm9zMworLm9zNHRsCisuNG90aDMKKy5vdXQzCisub3UyCisucGVkNWFsCisuMnAyZWQKKy5wMmUyZDJhCisucGU1dGUKKy5wZTJ0CisucGU1dGl0CisucDJpNGU0CisucGlvNW40CisuM3AyaTFvCisucGkydAorLnByZTNtCisucHIyCisucmE0YworLnJhbjR0CisucmEybgorLnJhdGlvNW4xYQorLnJhdGlvMm40CisucmExdDJpbworLnJlZTIKKy5yZTVtaXQKKy5yZXMyCisucmU1c3RhdAorLnJlczJ0CisucmVzMXRhCisucjJpNGcKKy5yaTJ0NXUKKy5ybzRxCisucm9zNXQKKy5yb3c1ZAorLnJ1NGQKKy4zczRjMmkzZTQKKy5zMWNpCisuNXNlMmwyZjUKKy5zZWwxbDUKKy5zZTJuCisuc2U1cjJpZTQKKy5zZXIxaQorLnMyaDIKKy5zaTIKKy5zM2luZzQKKy4yczFpbgorLnN0NAorLnN0YTViMmwyCisuczF0YQorLnMydGFiCisuczR5MgorLjF0YTQKKy50ZTQKKy4zdGVuNWEybgorLnRlMW5hCisudGgyCisudGkyCisudGlsNAorLnRpMW01bzUKKy4xdGltCisudGluZzQKKy4ydDFpbgorLnQ0aTRuNWsyCisudG8xbjRhCisuMXRvCisudG8ybgorLnRvNHAKKy50b3A1aQorLnRvMnU1cworLnRvdTIKKy50cmliNXV0CisudHI0aWIKKy51MW4xYQorLnVuM2NlCisudW5kZXI1CisudW4xZGUKKy51Mm4xZQorLnU0bjVrMgorLnVuNW8KKy51bjN1NAorLnVwMworLnVyZTMKKy51czVhMgorLjJ1cworLnZlbjRkZQorLnZlNXIxYQorLndpbDVpCisud2kyCisud2lsMgorLnllNAorNGFiLgorYTViYWwKK2E1YmEybgorYWJlMgorYWI1ZXJkCithYjJpNWEKK2FiNWkydDVhYgorYWJpMnQKK2FiaTF0YQorYWI1bGF0CithYjJsMgorYWI1bzVsMWl6CithYm9sMmkKKzRhYnIKK2FiNXJvZworYWIzdWwKK2E0YzJhMnIKK2ExY2EKK2FjNWFyZAorYWM1YXJvCithNWNlb3UyCithYzFlcgorYTVjaGU0dAorYTJjaAorYWNoZTIKKzRhMmNpCithM2MyaWU0CithMmMxaW4KK2EzYzJpbworYWM1cm9iCithY3Q1aWYyCithMmMxdAorYWMzdWwKK2FjNHVtCithMmQKK2FkNGQxaW4KK2FkMWQ0CithZDVlci4KKzJhZGkKK2EzZDRpM2EKK2FkM2kxY2EKK2FkaTRlcgorYWQyaWU0CithM2QyaW8KK2EzZGl0CithNWRpMXUKK2FkNGxlCithZDNvdworYTFkbworYWQ1cmEybgorYTFkcgorYWQ0c3UKK2EyZDFzMgorNGExZHUKK2EzZHUyYworYWQ1dW0KK2FlNHIKK2FlcjJpNGU0CithZXIxaQorYTJmCithNGYxZjQKK2E0Z2FiCithMWdhCithZ2E0bgorYWc1ZWwxbAorYTFnZTRvCis0YWc0ZXUKK2FnMWkKKzRhZzRsMgorYWcxbgorYTJnbworM2EzZzRvNGcKK2FnM28zbmkKK2FnbzJuMgorYTVndWVyCithMmd1ZQorYWc1dWwKK2E0Z3kKK2EzaGEKK2EzaGUKK2E0aDRsNAorYTNobworYWkyCithNWkxYQorYTNpYy4KK2FpNWx5CithNGk0bgorYWluNWluCithMmluaQorYTJpMW41bworYWl0NWVuCithMml0ZQorYTFqCithazFlbgorYWw1YWIKK2FsM2EyZAorYTRsMmEycgorNGFsZGk0CithMmxkCisyYWxlCithbDNlbmQKK2E0bGVudDJpCithMWxlbjF0CithNWxlNW8KK2FsMWkKK2FsNGlhLgorYWwyaTFhCithbDJpNGU0CithbDVsZXYKK2FsMWwKK2FsMmxlCis0YWxsaWMKK2FsbDJpCis0YTJsbQorYTVsb2cuCithNGx5LgorYTFseQorNGEybHlzNAorNWE1bHlzMXQKKzVhbHl0CiszYWx5egorNGExbWEKK2EybTVhYgorYW0zYWcKK2FtYTVyYQorYW0yYTJyCithbTVhc2MKK2E0bWEzdGlzCithNG01YTF0bworYW01ZXIxYQorYW0zaWMKK2FtNWlmCithbTVpMWx5CithbTFpbgorYW0yaTRubworYTJtbworYTVtbzJuCithbW9yNWkKK2FtbzJyCithbXA1ZW4KK2E0bTFwCithMm4KK2FuM2FnZQorYTFuYQorM2FuYTFseQorYTNuMmEycgorYW4zYXIzYworYW5hcjRpCithM25hdGkKK2FuMmF0Cis0YW5kCithbmRlNHMyCithbjFkZQorYW4zZGlzMQorYW4xZGwKK2FuNGRvdworYW4xZG8KK2E1bmVlCithM25lbgorYW41ZTJzdC4KK2ExbmVzCithMm5lc3QKK2EzbjRldQorMmFuZworYW5nNWllNAorYW4xZ2wyCithNG4xaWMKK2EzbmllcworYW4yaWU0CithbjNpM2YKK2FuNGltZQorYW4xaW0KK2E1bmltMWkKK2E1bjJpbmUKK2FuMWluCithbjNpNG8KK2EzbjJpcAorYW4zaXMyaAorYW4zaXQKK2EzbmkxdQorYW40a2xpCithNG5rMgorYW4xazFsCis1YW5uaXoKK2E0bjFuMgorYW5vNAorYW41b3QKK2FuNG90aDUKK2FuMnNhMgorYTJuMXMyCithbjRzMWNvCithbnM0YworYW40czFuNAorYW4yc3AKK2FuczNwbworYW40c3QKK2FuNHN1MnIKK2FuMXN1CithbnRhMmw0CithbjF0CithbjF0YQorYW40dDJpZTQKK2FudDJpCis0YW4xdG8KK2FuMnRyCithbjR0dzQKK2FuM3UxYQorYW4zdWwKK2E1bnVyCis0YW8KK2FwMmEycjQKK2ExcGEKK2FwNWF0CithcDVlcjNvCithM3BoNGVyCis0YXBoaQorYTRwaWxsYQorYXBpbDFsCithcDVpbGwyYTJyCithcDNpMm4KK2FwM2kxdGEKK2EzcGkydHUKK2EycDJsMgorYXBvNGM1CithcDVvMWxhCithcG9yNWkKK2ExcDRvcgorYXBvczN0CithMXBvcworYXBzNWU0cworYTJwMXMyCithcDJzZQorYTNwdQorYXF1ZTUKK2FxdTIKKzJhMnIKK2FyM2EyYzF0CithNXJhZGUKK2FyYTJkCithcjVhZGlzMQorYXIyYWRpCithcjNhbAorYTVyYW1lMXRlCithcmFtM2V0CithcjJhbjRnCithcmEybgorYXJhM3AKK2FyNGF0CithNXJhMXQyaW8KK2FyNWExdDJpdgorYTVyYXUKK2FyNWF2NAorYXJhdzQKK2FyYmFsNAorYXIxYgorYXI0Y2hhMm4KK2FyMWMKK2FyM2NoYQorYXIyY2gKK2FyNWQyaW5lCithcmQyaQorYXJkMWluNAorYXI0ZHIKK2FyNWVhcworYTNyZWUKK2FyM2VuMXQKK2E1cjJlMnNzCithcjRmaQorYXIxZgorYXI0ZjRsMgorYXIxaQorYXI1aTJhbAorYXIyaTNhCithcjNpMmEybgorYTNyaTVldAorYXIyaWU0CithcjRpbQorYXI1aW4yYXQKK2FyMmkxbmEKK2FyM2kxbworYXIyaXoKK2FyMm1pCithcjFtCithcjVvNWQKK2E1cm9uaQorYXJvMm4KK2Ezcm9vMgorYXIycAorYXIzcQorYXJyZTQKK2FyMXI0CithcjRzYTIKK2E0cnMyCithcjJzMmgKKzRhcy4KK2EyczRhYgorYXNhMgorYXMzYW4xdAorYXNhMm4KK2FzaGk0CithczJoCithNXNpYS4KK2FzMmkxYQorYTNzaTFiCithM3NpYworNWE1c2k0dAorYXNrM2kKK2FzazIKK2FzNGwyCithNHNvYworYTFzbworYXM1cGgKK2FzNHMyaAorYTJzcworYXMzdGVuCithczF0NHIKK2FzdTFyNWEKK2Exc3UKK2FzdTJyCithMnRhCithdDNhYjJsMgorYTJ0YWIKK2F0NWFjCithdDNhbG8KK2F0YTJsCithdDVhcAorYXRlNWMKK2F0NWUyY2gKK2F0M2UxZ28KK2F0ZWc0CithdDNlbi4KK2F0M2VyMWEKK2F0ZXI1bgorYTV0ZXIxbmEKK2F0M2VzdAorYXQ1ZXYKKzRhdGgKK2F0aDVlbQorYXRoMmUKK2E1dGhlMm4KK2F0NGhvCithdGg1b20KKzRhdGkuCithNXQyaTFhCithMnQ1aTViCithdDFpYworYXQzaWYyCithdGlvbjVhMnIKK2ExdDJpbworYXRpbzJuCithdGlvMW4xYQorYXQzaTF0dQorYTR0b2cKK2ExdG8KK2EydG9tCithdDVvbTJpegorYTR0b3AKK2E0dG9zMgorYTF0cgorYXQ1cm9wCithdDRzazIKK2E0dDFzMgorYXQ0dGFnCithNHQzdDIKK2F0MXRhCithdDV0ZQorYXQ0dGgKK2EydHUKK2F0NXUxYQorYTR0NXVlCithdDN1bAorYXQzdTFyYQorYTJ0eQorYXU0YgorYXVnaDMKK2F1M2d1CithdTRsMgorYXVuNWQKK2F1M3IKK2F1NXNpMWIKK2EydXMKK2E0dXQ1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orNGIxbQorNGIzbgorYm5lNWcKKzNib2QKK2JvZDNpCitibzRlCitib2wzaWMKK2JvbDJpCitib200YmkKK2JvNG0xYgorYm8xbjRhCitibzJuCitib241YXQKKzNib28yCis1Ym9yLgorNGIxbzFyYQorYm9yNWQKKzVib3JlCis1Ym9yaQorNWJvczQKK2I1bzF0YQorYjRvdGg1CitibzR0bworYm91bjJkMworYm91MgorNGJwCis0YnJpdAorYnI0b3RoMworMmI1czIKK2Jzb3I0CitiMXNvCisyYnQKK2IydDRsCitiNHRvCitiM3RyCitidWY0ZmVyMQorYnU0ZjFmCitidTRnYQorYnUzbDJpCitidTFtaTQKK2J1NG4KK2J1bnQ0aQorYnVuMXQKK2J1M3JlCitidXM1aWU0CitiMnVzCitidXNzNGUKK2J1MnNzCis1YnVzdAorNGJ1MXRhCiszYnUxdDJpbworYjR1MXQyaQorYjV1MXRvCitiMXYKKzRiNXcKKzVieS4KK2J5czQKKzFjYQorY2FiM2luCitjYTFiMmwyCitjYTJjaDQKK2NhNWRlbgorY2EyZAorNGNhZzQKKzJjNWFoCitjYTNsYXQKK2NhbDRsYQorY2FsMWwKK2NhbDJsNWluNAorY2FsbDJpCis0Y2FsbworYzRhbjVkCitjYTJuCitjYW40ZQorY2E0bjRpYworY2FuNWlzCitjYW4zaXoKK2NhbjR0eQorY2FuMXQKK2Nhbnk0CitjYTVwZXIKK2NhcjVvbQorYzJhMnIKK2Nhc3Q1ZXIKK2NhczV0MmlnCitjYXN0MmkKKzRjYXM0eQorYzRhNHRoCis0Y2ExdDJpdgorY2F2NWFsCitjYTJ2YQorYzNjCitjY2hhNQorYzJjaAorYzNjMmk0YQorYzFjaQorY2NvbTFwYTUKK2MxY28KK2NjbzRtMXAKK2NjbzJuNAorY2NvdTN0CitjY291MgorMmNlLgorNGNlZC4KKzRjZTFkZW4KKzNjZWkyCis1Y2VsLgorM2NlbDFsCisxY2VuCiszY2VuYworMmNlbjRlCis0Y2VuaQorM2NlbjF0CiszY2VwCitjZTVyYW0KK2NlcjFhCis0Y2UxczRhMgorM2NlczFzaQorYzJlMnNzCitjZXM1c2k1YgorY2VzNXQKK2NldDQKK2M1ZTR0YQorY2V3NAorMmNoCis0Y2guCis0Y2gzYWIKKzVjaGE0bjFpYworY2hhMm4KK2NoNWE1bmlzCitjaGUyCitjaGVhcDMKKzRjaDRlZAorY2g1ZTVsbworM2NoZW1pCitjaDVlbmUKK2NoZTJuCitjaDNlci4KK2NoM2U0cjFzMgorNGNoMWluCis1Y2hpMm5lLgorY2gyaW5lCitjaDVpNW4yZTJzcworY2hpMW5lcworNWNoMmluaQorNWNoMmlvCiszY2hpdAorY2hpMnoKKzNjaG8yCitjaDR0aQorMWNpCiszYzJpMWEKK2NpMmE1YgorY2kyYTVyCitjaTVjCis0Y2llcgorYzJpZTQKKzVjNGkyZjNpYy4KK2NpMWZpCis0YzRpNWk0CitjaTRsYQorM2NpbDFpCisyY2ltCisyY2luCitjNGkxbmEKKzNjaW4yYXQKK2NpbjNlbQorYzJpbmUKK2MxaW5nCitjNWluZy4KKzVjMmkxbm8KK2NpbzJuNAorYzJpbworNGNpcGU0CitjMmlwCitjaTNwaAorNGNpcDRpYworY2lwM2kKKzRjaXMxdGEKKzRjaXMxdDJpCisyYzFpdAorY2kxdDNpegorY2kxdGkKKzVjaXoKK2NrMQorY2szaQorMWM0bDQKKzRjbDJhMnIKK2M1bGE1cmExdDJpbworY2xhcjRhdAorNWNsYXJlCitjbGU0bQorNGNsaWMKK2NsaW00CitjMWx5NAorYzVuCisxY28KK2NvNWFnCitjNG9hCitjb2UyCisyY29nCitjbzRncgorY29pNAorY28zaW5jCitjb2w1aQorNWNvbG8KK2NvbDNvNHIKK2NvbTVlcgorY28ybWUKK2NvMW40YQorY28ybgorYzRvbmUKK2NvbjNnCitjb241dAorY28zcGEKK2NvcDNpYworY280cDJsMgorNGNvcjFiCitjb3JvM24KK2NvczRlCitjb3YxCitjb3ZlNAorY293NWEKK2NvMno1ZQorY281ejFpCitjMXEKK2Ny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szaGUyYTJyCitoZTRjYTJuCitoZTFjYQoraDVlY2F0CitoNGVkCitoNGU1ZG81CitoZTNsNGkKK2hlbDRsaXMKK2hlbDFsCitoZWxsMmkKK2hlbDRseQoraDVlbG8KK2hlNG00cAoraGUybgoraGUxbmE0CitoZW41YXQKK2hlMW81cgoraGVwNQoraDRlcjFhCitoZXJhM3AKK2hlcjRiYQoraDJlcjFiCitoZXJlNWEKK2gzZXJuCitoNWVyMW91MgoraDJlcm8KK2gzZXJ5CitoMWVzCitoZTJzNXAKK2hlNHQKK2hlMnQ0ZWQKK2g0ZXU0CitoMWYKK2gxaAoraGk1YTJuCitoMmkxYQoraGk0Y28KK2hpZ2g1CitoMmlnCitoNGlsMgoraGltZXI0CitoNGkxbmEKK2hpb240ZQoraDJpbworaGlvMm4KK2gyaTRwCitoaXI0bAoraDRpcgoraGkzcm8KK2hpcjRwCitoaXI0cjQKK2hpczNlbAoraDRpc2UKK2g0aTJzNHMKK2hpdGg1ZXIKK2gyaXRoCitoaXRoMmUKK2gyaTJ2Cis0aGsKKzRoMWw0CitobGEybjQKK2gybG8KK2hsbzNyaQorNGgxbQoraG1ldDQKKzJoMW4KK2g1b2RpegoraDVvMmQxczIKK2hvNGcKK2hvMWdlNAoraG9sNWEycgoraG8xbGEKKzNob2w0ZQoraG80bWEKK2hvMm1lMworaG8xbjRhCitobzJuCitobzVueQorM2hvb2QKK2hvbzIKK2hvbzJuNAoraG9yNWF0CitobzFyYQoraG81cjJpcworaG9ydDNlCitobzVydQoraG9zNGUKK2hvNXNlbgoraG9zMXAKKzFobzJ1cworaG91MgoraG91c2UzCitob3Y1ZWwKKzRoNXAKKzRocjQKK2hyZWU1Citocm81bml6Citocm8ybgoraHJvM3BvCis0aDFzMgoraDRzMmgKK2g0dDJhMnIKK2gxdGEKK2h0MWVuCitodDVlcworaDR0eQoraHU0ZworaHU0bWluCitodTFtaQoraHVuNWtlCitodTRuazIKK2h1bjR0CitodXMzdDQKK2gydXMKK2h1NHQKK2gxdworaDR3YXI0dAoraHcyYTJyCitoeTNwZQoraHkzcGgKK2h5MnMKKzJpMWEKK2kyYWwKK2lhbTQKK2lhbTVlMXRlCitpMmEybgorNGlhbmMKK2lhbjNpCis0aWFuNHQKK2lhNXBlCitpYTJzczQKK2k0YTF0Mml2CitpYTR0cmljCitpYTF0cgoraTRhMnR1CitpYmU0CitpYjNlcjFhCitpYjVlcnQKK2liNWkxYQoraWIzaW4KK2liNWl0LgoraWJpMnQKK2liNWl0ZQoraTFiMmwyCitpYjNsaQoraTVibworaTFicgoraTJiNXJpCitpNWJ1NG4KKzRpY2FtCitpMWNhCis1aWNhcAorNGljMmEycgoraTRjYXIuCitpNGNhcmEKK2ljYXM1CitpNGNheQoraWNjdTQKK2ljM2MKKzRpY2VvCis0aTJjaAorMmkxY2kKK2k1YzJpZAoraWM1aTFuYQoraTJjaW4KK2kyYzJpcAoraWMzaTFwYQoraTRjMWx5NAoraTFjNGw0CitpMmM1b2MKK2kxY28KKzRpMWNyCis1aWNyYQoraTRjcnkKK2ljNHRlCitpMmMxdAoraWMxdHUyCitpYzR0M3UxYQoraWMzdTFsYQoraWM0dW0KK2ljNXVvCitpM2N1cgorMmlkCitpNGRhaTIKK2kxZDJhCitpZDVhbmMKK2lkYTJuCitpZDVkNAoraWRlM2E0bAoraWRlNHMyCitpMmRpCitpZDVpMmEybgoraTFkNGkzYQoraWRpNGEycgoraTVkMmllNAoraTFkM2lvCitpZGk1b3UyCitpZDFpdAoraWQ1aTF1CitpM2RsZQoraTRkb20KK2kxZG8KK2lkM293CitpNGRyCitpMmR1CitpZDV1bworMmllNAoraWVkNGUKKzVpZTVnYQoraWUybGQzCitpZTFuNWE0CitpZW40ZQoraTVlNG4xbjIKK2kzZW50MmkKK2llbjF0CitpMWVyLgoraTNlczJjCitpMWVzdAoraTNldAorNGlmLgoraWY1ZXJvCitpZmVyMQoraWZmNWVuCitpNGYxZgoraWY0ZnIKKzRpMmYzaWMuCitpMWZpCitpM2YyaWU0CitpM2Y0bDIKKzRpMmZ0CisyaWcKK2lnYTViCitpMWdhCitpZzNlcjFhCitpZ2h0M2kKKzRpZ2kKK2kzZ2liCitpZzNpbDQKK2lnM2luCitpZzNpdAoraTRnNGwyCitpMmdvCitpZzNvcgoraWc1b3QKK2k1Z3JlCitpMWdyCitpZzJ1NWkyCitpZzF1cgoraTNoCis0aTVpNAoraTNqCis0aWsKK2kxbGEKK2lsM2E0YgoraTRsNGFkZQoraWxhMmQKK2kybDVhbQoraWxhNXJhCitpbDJhMnIKK2kzbGVnCitpbDFlcgoraWxldjQKK2kybDVmCitpbDFpCitpbDNpMWEKK2lsMmliCitpbDNpbworaWw0aXN0CisyaWwxaXQKK2lsMml6CitpbGw1YWIKK2lsMWwKKzRpMmwxbjIKK2lsM28xcQoraWw0dHkKK2k0bHQKK2lsNXVyCitpbDN2CitpNG1hZworaTFtYQoraW0zYWdlCitpbWE1cnkKK2ltMmEycgoraW1lbnQyYTVyCitpMW1lbgoraTNtZW4xdAoraW1lbjF0YQorNGltZXQKK2ltMWkKK2ltNWkxZDRhCitpbTJpZAoraW1pNWxlCitpNW0yaW5pCis0aW1pdAoraW00bmkKK2k0bTFuCitpM21vMm4KK2kxbW8KK2kybXUKK2ltM3UxbGEKKzJpbi4KK2k0bjNhdQoraTFuYQorNGluYXYKK2luY2VsNAoraW4zY2VyCis0aW5kCitpbjVkbGluZworMmluZQoraTNuZWUKK2luNGVyNGEycgoraW4xZXIKK2luZXIxYQoraTVuMmUyc3MKK2kxbmVzCis0aW4xZ2EKKzRpbmdlCitpbjVnZW4KKzRpbmdpCitpbjVnbGluZworaW5nbDIKKzRpbjFnbworNGluMWd1CisyaW5pCitpNW5pLgoraTRuNGkxYQoraW4zaTRvCitpbjFpcworaTVuaTR0ZS4KK2luMml0CitpbjJpdGUKKzVpM24yaTF0MmlvCitpbmkxdGkKK2luM2kxdHkKKzRpNG5rMgorNGk0bjFsCisyaTRuMW4yCisyaTFubworaTRubzRjCitpbm80cworaTRub3QKK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oraXN0NHIKK2lzMXRyYQoraTJzdQoraXM1dXMKKzRpM3RhLgoraTF0YQoraXRhNGJpCitpMnRhYgoraTR0YWcKKzRpdGE1bQoraTN0YTJuCitpM3RhdAorMml0ZQoraXQzZXIxYQoraTV0ZXIxaQoraXQ0ZXMKKzJpdGgKK2kxdGkKKzRpMXQyaTFhCis0aTJ0aWMKK2l0M2kxY2EKKzVpNXRpY2sxCitpMnQzaWcKK2l0NWlsMWwKK2kydGltCisyaTF0MmlvCis0aXRpcworaTR0aTJzNG0KK2kydDVvNW0KK2kxdG8KKzRpdG8ybgoraTR0cmFtCitpMXRyYQoraXQ1cnkKKzRpNHQzdDIKK2l0M3UxYXQKK2kxdHUKK2l0dTFhCitpNXR1ZDIKK2l0M3VsCis0aXR6LgoraTR0egoraTF1CisyaXYKK2l2M2VsMWwKK2l2M2VuLgoraTR2M2VyLgoraTR2ZXJzLgoraXZlNHIxczIKK2l2NWlsLgoraTJ2aWwKK2l2NWlvCitpdjFpdAoraTV2b3JlCitpdjNvM3JvCitpNHYzb3QKKzRpNXcKK2l4NG8KKzRpeQorNGl6MmEycjIKK2l6YTEKK2kyejFpNAorNWl6b24xdAoraTF6bworaXpvMm4KKzVqYQoramFjNHEKK2phNHAKKzFqZQoramU0cjVzMgorNGplczR0MmllNAoramVzdDJpCis0amVzMnR5CitqZXczCitqbzRwCis1anVkZworM2thLgorazNhYgorazVhZwora2FpczQKK2thaTIKK2thbDQKK2sxYgorazJlZAorMWtlZQora2U0Zwora2U1bDJpCitrM2VuNGQKK2sxZXIKK2tlczQKK2szZTJzdC4KK2tlNHR5CitrM2YKK2toNAorazFpCis1a2kuCis1azJpYworazRpbDFsCitraWxvNQorazRpbQorazRpbi4KK2tpbjRkZQorazRpbmQKK2s1aTVuMmUyc3MKK2syaW5lCitraTFuZXMKK2tpbjRnCitrMmk0cAora2lzNAorazVpczJoCitrazQKK2sxbAorNGszbGV5Cis0azFseQorazFtCitrNW5lcworMWsybm8KK2tvNXIKK2tvczJoNAorazNvdTIKK2tybzVuCis0azFzMgorazRzYwora3M0bDIKK2s0czR5CitrNXQKK2sxdworbGFiM2ljCitsNGFibworbDRhMmNpNAorbDRhZGUKK2xhMmQKK2xhM2QyeQorbGFnNG4KK2xhMm0zbworM2w0YW5kCitsYTJuCitsYW40ZGwKK2xhbjVldAorbGFuNHRlCitsYW4xdAorbGFyNGcyCitsMmEycgorbGFyM2kKK2xhczRlCitsYTV0YTJuCitsYTJ0YQorNGxhdGVsMmk0Cis0bGExdDJpdgorNGxhdgorbGE0djRhCisybDFiCitsYmluNAorNGwxYzIKK2xjZTQKK2wzY2kKKzJsZAorbDJkZQorbGQ0ZXJlCitsZDRlcjFpCitsZGk0CitsZDVpczEKK2wzZHIKK2w0ZHJpCitsZTJhCitsZTRiaQorbDJlMWIKK2xlMmZ0NQorbGUxZgorNWxlZy4KKzVsZTRnMWcyCitsZTRtYXQKK2xlMW1hCitsZW01YXQxaWMKKzRsZW4uCiszbGVuYworNWxlMm5lLgorMWxlbjF0CitsZTNwaAorbGU0cHIyCitsZTJyYTViCitsZXIxYQorbGVyNGUKKzNsZXJnMgorM2w0ZXIxaQorbDRlcm8KK2xlczIKK2xlNXMxY28KK2xlczJjCis1bGVzcQorM2wyZTJzcworNWxlc3MuCitsM2UxdmEKK2xldjRlci4KK2xldjFlcgorbGV2NGVyMWEKK2xldjRlNHIxczIKKzNsZXkKKzRsZXllCisybGYKK2w1ZnIKKzRsMWc0CitsNWdhCitsZzJhMnIzCitsNGdlcworbDFnbzMKKzJsM2gKK2xpNGFnCitsMmkxYQorbGkyYW00CitsaWFyNWl6CitsaTJhMnIKK2xpYXIxaQorbGk0YXMKK2xpNGExdG8KK2xpNWJpCis1bGljMmlvCitsMmkxY2kKK2xpNGNvcgorbGkxY28KKzRsaTRjM3MyCis0bGljdC4KK2xpMmMxdAorbDRpY3UKK2wzaTFjeQorbDNpMWQyYQorbDJpZAorbGlkNWVyCiszbGkyZGkKK2xpZjNlcjEKK2w0aTRmMWYKK2xpNGY0bDIKKzVsaWdhdGUKK2wyaWcKK2xpMWdhCiszbGlnaAorbGk0Z3JhCitsaTFncgorM2w0aWsKKzRsNGk0bAorbGltNGIybDIKK2xpNG0xYgorbGltM2kKK2xpNG1vCitsNGk0bTRwCitsNGkxbmEKKzFsNGluZQorbGluM2VhCitsMmluM2kKK2xpbms1ZXIKK2w0aTRuazIKK2xpNW9nCitsMmlvCis0bDRpcQorbGlzNHAKK2wxaXQKK2wyaXQuCis1bGl0M2kxY2EKK2xpMXRpCitsNGkydGljCitsNWk1dGk0YzNzMgorbGl2M2VyCitsMml2CitsMWl6Cis0bGoKK2xrYTMKK2wza2FsNAorbGthNHQKK2wxbAorbDRsYXcKK2wybGUKK2w1bGUyYQorbDNsZWMKK2wzbGVnCitsM2xlbAorbDNsZTRuCitsM2xlNHQKK2xsMmkKK2wybGluNAorbDVsNGkxbmEKK2xsNG8KK2xsb3EydWk1CitsbG8xcQorbGxvcXUyCitsMmw1b3V0CitsbG91MgorbDVsb3cKKzJsbQorbDVtZXQKK2xtM2luZworbDRtbzJkMQorbDFtbworbG1vMm40CisybDFuMgorM2xvLgorbG9iNWFsCitsbzRjaQorNGxvZgorM2xvZzFpYworbDVvMWdvCiszbG9ndQorbG9tM2VyCitsbzJtZQorNWxvbmcKK2xvMm4KK2xvbjRpCitsM28zbml6Citsb29kNQorbG9vMgorNWxvNHBlLgorbG9wM2kKK2wzbzRwMW0KK2xvMXJhNAorbG80cmExdG8KK2xvNXIyaWU0Citsb3I1b3UyCis1bG9zLgorbG9zNWV0Cis1bG9zNW8zcGhpegorbG8yc28KK2xvczRvcAorbG9zMm9waAorNWxvczVvMXBoeQorbG9zNHQKK2xvNHRhCitsb3VuNWQKK2xvdTIKKzJsb3V0Cis0bG92CisybHAKK2xwYTViCitsMXBhCitsM3BoYQorbDVwaGkKK2xwNWluZworbHBpMm4KK2wzcGl0CitsNHAybDIKK2w1cHIyCis0bDFyCisybDFzMgorbDRzYworbDJzZQorbDRzMmllNAorNGx0CitsdDVhZworbDF0YQorbHRhbmU1CitsdGEybgorbDF0ZQorbHRlbjQKK2x0ZXIxYTQKK2x0aDNpCitsNXRpZXMuCitsdDJpZTQKK2x0aXM0CitsMXRyCitsMXR1MgorbHR1MXIzYQorbHU1YQorbHUzYnIKK2x1MmNoNAorbHUzY2kKK2x1M2VuCitsdWY0CitsdTVpZAorbDJ1aTIKK2x1NG1hCis1bHUxbWkKK2w1dW1uLgorbHU0bTFuCis1bHVtM240aTFhCitsdTNvCitsdW8zcgorNGx1cAorbHUyc3M0CitsMnVzCitsdXMzdGUKKzFsdXQKK2w1dmVuCitsNXZldDQKKzJsMXcKKzFseQorNGx5YQorNGx5MWIKK2x5NW1lNAorbHkzbm8KKzJseXM0CitsNXkzczJlCisxbWEKKzJtYWIKK21hMmNhCittYTVjaDJpbmUKK21hMmNoCittYTRjaDFpbgorbWE0YzRsNAorbWFnNWluCittYWcxaQorNW1hZzFuCisybWFoCittYTJpZDUKK21haTIKKzRtYTJsZAorbWEzbDJpZworbWFsMWkKK21hNWxpbgorbWFsNGwyaQorbWFsMWwKK21hbDR0eQorbWE0bHQKKzVtYTNuNGkxYQorbWEybgorbWFuNWlzCittYW4zaXoKKzRtYXAKK21hNXJpMm5lLgorbTJhMnIKK21hcjFpCittYXIyaW40ZQorbWE1cjJpegorbWFyNGx5CittYXIxbAorbWFyM3YKK21hNXNjZQorbWFzNGUKK21hczF0Cis1bWF0ZQorbTRhdGgzCittYTN0aXMKKzRtYXRpM3phMQorbWExdGl6Cis0bTFiCittMWJhNHQ1CittNWJpbAorbTRiM2luZworbWIyaTR2Cis0bTVjCis0bWUuCisybWVkCis0bWVkLgorNW1lM2Q0aTNhCittNGVkaQorbWUzZDJpZTQKK201ZTVkMnkKK21lMmcKK21lbDVvMm4KK21lNGw0dAorbWUybQorbWUxbTFvMworMW1lbgorbWUxbjRhCittZW41YWMKK21lbjRkZQorNG1lbmUKK21lbjRpCittZTJuMXM0CittZW4xc3U1CiszbWVuMXQKK21lbjR0ZQorbWU1bzJuCittNWVyMXNhMgorbWU0cjFzMgorMm1lcworM21lc3QyaQorbWU0dGEKK21ldDNhMmwKK21lMXRlCittZTV0aGkKK200ZXRyCis1bWV0M3JpYworbWU1dHIyaWU0CittZTN0cnkKK21lNHYKKzRtMWYKKzJtaAorNW1pLgorbTJpM2EKK21pMWQ0YQorbTJpZAorbWlkNGcKK20yaWc0CiszbWlsM2kxYQorbWlsMWkKK201aTVsMmllNAorbTRpbDFsCittaTFuNGEKKzNtNGluZAorbTVpM25lZQorbTJpbmUKK200aW5nbDIKK21pbjVnbGkKK201aW5nMWx5CittaW40dAorbTRpbjF1CittaW90NAorbTJpbworbTJpcworbWk0czRlci4KK200aXNlCittaXMzZXIKK21pczVsMgorbWlzNHQyaQorbTVpNHN0cnkKK21pc3Q0cgorNG0yaXRoCittMml6Cis0bWsKKzRtMWwKK20xbQorbW1hNXJ5CittMW1hCittbTJhMnIKKzRtMW4KK20xbjRhCittNG4xaW4KK21uNG8KKzFtbworNG1vY3IKKzVtb2M1cmExdGl6CittbzJkMQorbW80Z28KK21vaXMyCittb2kyCittbzRpNXNlCis0bTJvaworbW81bGVzdAorbW9sZXMyCittbzNtZQorbW9uNWV0CittbzJuCittb241Z2UKK21vM240aTNhCittb240aTJzMW0KK21vbjFpcworbW9uNGlzdAorbW8zbml6Cittb25vbDQKK21vM255LgorbW8ycgorNG1vNXJhLgorbW8xcmEKK21vczIKK21vNXNleQorbW8zc3AKK200b3RoMworbTVvdWYKK21vdTIKKzNtbzJ1cworbW8ydgorNG0xcAorbXBhcmE1CittMXBhCittcDJhMnIKK21wYTVyYWIKK21wNGE0cjVpCittM3BlMnQKK21waGFzNAorbTJwaQorbXAyaTRhCittcDVpZXMKK21wMmllNAorbTRwMWkybgorbTVwNGlyCittcDVpcworbXBvM3JpCittMXA0b3IKK21wb3M1aXRlCittMXBvcworbTRwbzJ1cworbXBvdTIKK21wb3Y1CittcDR0cgorbTJwMXQKK20ycHkKKzRtM3IKKzRtMXMyCittNHMyaAorbTVzaQorNG10CisxbXUKK211bDJhNXI0CittdTFsYQorNW11NGx0CittdWwxdGkzCiszbXVtCittdW4yCis0bXVwCittdTR1Cis0bXcKKzFuYQorMm4xYTJiCituNGFidQorNG5hYy4KK25hNGNhCituNWEyYzF0CituYWc1ZXIuCituYWs0CituYTRsMWkKK25hNWwyaTFhCis0bmE0bHQKK25hNW1pdAorbjJhMm4KK25hbjFjaTQKK25hbjRpdAorbmE0bms0CituYXIzYworbjJhMnIKKzRuYXJlCituYXIzaQorbmFyNGwKK241YXIxbQorbjRhcworbmFzNGMKK25hczV0MmkKK24yYXQKK25hM3RhMmwKK25hMnRhCituYXQ1bzVtMml6CituYTJ0b20KK25hMXRvCituMmF1CituYXUzc2UKK25hMnVzCiszbmF1dAorbmF2NGUKKzRuMWI0CituYzJhMnI1CituMWNhCituNGNlcy4KK24zY2hhCituMmNoCituNWNoZW8KK25jaGUyCituNWNoNGlsMgorbjNjaGlzCituMmMxaW4KK24xY2kKK24yYzRpdAorbmNvdTFyNWEKK24xY28KK25jb3UyCituMWNyCituMWN1CituNGRhaTIKK24xZDJhCituNWRhMm4KK24xZGUKK25kNWUyc3QuCituZGVzMgorbmRpNGIKK241ZDJpZgorbjFkaXQKK24zZGl6CituNWR1MmMKK24xZHUKK25kdTRyCituZDJ3ZQorbmQxdworMm5lLgorbjNlMmEycgorbjJlMmIKK25lYjN1CituZTJjCis1bmVjazEKKzJuZWQKK25lNGdhdAorbmUxZ2EKK25lNGc1YTF0Mml2Cis1bmVnZQorbmU0bGEKK25lbDVpegorbmVsMmkKK25lNW1pCituZTRtbworMW5lbgorNG5lbmUKKzNuZW8KK25lNHBvCituZTJxCituMWVyCituZTJyYTViCituZXIxYQorbjRlcjNhMnIKK24yZXJlCituNGVyNWkKK25lcjRyNAorMW5lcworMm5lcy4KKzRuZTFzcAorMm5lc3QKKzRuZXM0dzIKKzNuZXQxaWMKK25lNHYKK241ZXZlCituZTR3CituM2YKK240Z2FiCituMWdhCituM2dlbAorbmdlNG40ZQorbjFnZW4KK241Z2VyZQorbjNnZXIxaQorbmc1aGEKK24zZ2liCituZzFpbgorbjVnaXQKK240Z2xhNAorbmdsMgorbmdvdjQKK24xZ28KK25nNXMyaAorbmdzMgorbjFndQorbjRndW0KK24yZ3kKKzRuMWg0CituaGE0CituaGFiMworbmhlNAorM240aTFhCituaTNhMm4KK25pNGFwCituaTNiYQorbmk0YjJsMgorbjJpNGQKK25pNWRpCituaTRlcgorbjJpZTQKK25pMmZpCituaTVmaWNhdAorbmlmaTFjYQorbjVpMWdyCituMmlnCituNGlrNAorbjFpbQorbmkzbTJpegorbmltMWkKK24xaW4KKzVuaTJuZS4KK24yaW5lCituaW40ZworbjJpNG8KKzVuMmlzLgorbmlzNHRhCituMml0CituNGl0aAorM24yaTF0MmlvCituaTF0aQorbjNpdG9yCituaTF0bworbmkzdHIKK24xagorNG5rMgorbjVrMmVybworbmsxZXIKK24za2V0CituazNpbgorbmsxaQorbjFrMWwKKzRuMWwKK241bQorbm1lNAorbm1ldDQKKzRuMW4yCitubmU0CitubmkzYWwKK24zbjRpMWEKK25uMmk0dgorbm9iNGwyCitubzNibGUKK241bzFjNGw0Cis0bjNvMmQKKzNub2UKKzRub2cKK25vMWdlNAorbm9pczVpCitub2kyCitubzVsNGkKKzVub2wxbzFnaXMKKzNub21pYworbjVvNW0yaXoKK25vNG1vCitubzNteQorbm80bgorbm9uNGFnCitubzFuMWEKK25vbjVpCituNW9uaXoKKzRub3AKKzVub3A1bzVsMmkKK25vMnI1YWIKK25vMXJhCitubzRyYXJ5Citub3IyYTJyCis0bm9zMmMKK25vczRlCitub3M1dAorbm81dGEKKzFub3UyCiszbm91bgorbm92M2VsMworbm93bDMKK24xcDQKK25waTQKK25wcmU0YworbnByMgorbjFxCituMXIKK25ydTQKKzJuMXMyCituMnM1YWIKK25zYTIKK25zYXRpNAorbnM0YworbjJzZQorbjRzM2U0cworbnMyaWQxCituczJpZzQKK24yczFsMgorbjJzM20KK240c29jCituMXNvCituczRwZQorbjVzcGkKK25zdGE1YjJsMgorbnMxdGEKK25zMnRhYgorbjF0CituMnRhNGIKK24xdGEKK250ZTRyM3MyCitudDJpCituNXRpMmIKK250aTRlcgorbnQyaWU0CitudGkyZjIKK24zdDJpbmUKK24ydDFpbgorbjR0M2luZworbnQyaTRwCitudHJvbDVsMmkKK250cm9sMWwKK240dDRzMgorbnR1M21lCituMXR1CituM3R1bQorbnUxYQorbnU0ZAorbnU1ZW4KK251ZjRmZQorbnU0ZjFmCituM3VpNG4KK24ydWkyCiszbnUzaXQKK240dW0KK251MW1lCituNXUxbWkKKzNudTRuCituM3VvCitudTN0cgorbjF2MgorbjF3NAorbnltNAorbnlwNAorNG56CituM3phMQorNG9hCitvYTJkMworbzVhNWxlczIKK28yYWxlCitvYXJkMworbzJhMnIKK29hczRlCitvYXN0NWUKK29hdDVpCitvYjNhM2IKK281YjJhMnIKK28xYmU0bAorbzFiaQorbzJiaW4KK29iNWluZworbzNicgorb2IzdWwKK28xY2UKK28yY2g0CitvM2NoZTR0CitvY2hlMgorb2NpZjMKK28xY2kKK280Y2lsCitvNGNsYW0KK28xYzRsNAorbzRjb2QKK28xY28KK29jM3JhYworb2M1cmExdGl6CitvY3JlMworNW9jcml0CitvY3JpMgorb2N0bzJyNWEKK28yYzF0CitvYzF0bworb2MzdTFsYQorbzVjdXJlCitvZDVkMWVkCitvZDFkNAorb2QzaWMKK28xZDJpM28KK28yZG80CitvZDRvcjMKK280ZDV1Y3QuCitvMWR1CitvZHUyYworb2R1MmMxdAorbzRkNXVjNHQxczIKK280ZWwKK281ZW5nCitvM2VyCitvZTR0YQorbzNldgorbzJmaQorb2Y1aXRlCitvZjRpNHQ0dDIKK28yZzVhNXIKK28xZ2EKK280ZzVhMXQyaXYKK280Z2ExdG8KK28xZ2UKK281Z2VuZQorbzFnZW4KK281Z2VvCitvNGdlcgorbzNnMmllNAorMW8xZ2lzCitvZzNpdAorbzRnbDIKK281ZzJseQorM29nbml6CitvZzFuaQorbzRnNHJvCitvMWdyCitvZzJ1NWkyCisxbzFneQorMm8yZzV5M24KK28xaDIKK29oYWI1CitvaTIKK29pYzNlcworb2kzZGVyCitvMmlkCitvaTRmMWY0CitvMmlnNAorb2k1bGV0CitvM2luZworb2ludDVlcgorb2luMXQKK281aTJzMW0KK29pNXNvMm4KK29pMnNvCitvaXN0NWVuCitvaXMxdGUKK29pM3RlcgorbzJpdGUKK281agorMm9rCitvM2tlbgorb2s1aWU0CitvazFpCitvMWxhCitvNGxhMm4KK29sYTJzczQKK28ybDJkCitvbDJkMWUKK29sM2VyCitvM2xlczJjCitvbGVzMgorbzNsZXQKK29sNGZpCitvMmxmCitvbDJpCitvM2wyaTFhCitvM2xpY2UKK29sNWlkLgorb2wyaWQKK28zbGk0ZgorbzVsNGk0bAorb2wzaW5nCitvNWwyaW8KK281bDJpcy4KK29sM2lzMmgKK281bDJpdGUKK29sMWl0CitvNWwyaTF0MmlvCitvbGkxdGkKK281bDJpdgorb2xsMmk0ZTQKK29sMWwKK29sbDJpCitvbDVvM2dpegorb2xvNHIKK29sNXAybDIKK28ybHAKK280bDJ0CitvbDN1Ygorb2wzdW1lCitvbDN1bgorbzVsMnVzCitvbDJ2CitvMmx5CitvMm01YWgKK28xbWEKK29tYTVsCitvbTVhMXRpegorb20yYmUKK280bTFiCitvbTRiMmwyCitvMm1lCitvbTNlMW40YQorbzFtZW4KK29tNWVyMnNlCitvbWU0cjFzMgorbzRtZXQKK29tNWUzdHJ5CitvbTRldHIKK28zbTJpM2EKK29tM2ljLgorb20zaTFjYQorbzVtMmlkCitvbTFpbgorbzVtMmluaQorNW9tbWVuZAorb20xbQorb20xbWVuCitvbW80Z2UKK28xbW8KK280bW8ybgorb20zcGkKK280bTFwCitvbXBybzUKK29tcHIyCitvMm4KK28xbjFhCitvbjRhYworbzNuMmEybgorb24xYworM29uY2lsCitvbjFjaQorMm9uZAorb241ZG8KK28zbmVuCitvMm41ZXN0CitvMW5lcworb240Z3UKK29uMWljCitvM24yaTRvCitvbjFpcworbzVuaTF1CitvbjNrZXkKK280bmsyCitvbjRvZGkKK280bjNvMmQKK29uM28zbXkKK28ybjNzMgorb241c3BpNAorb25zcGkxcjVhCitvbnNwNGlyCitvbjFzdTQKK29udGVuNAorb24xdAorb24zdDRpCitvbnRpMmY1CitvbjV1bQorb24xdmE1CitvbjF2Mgorb28yCitvb2Q1ZQorb29kNWkKK28ybzRrCitvb3AzaQorbzNvcmQKK29vc3Q1CitvMnBhCitvMnAyZTVkCitvcDFlcgorM29wZXIxYQorNG9wNGVyYWcKKzJvcGgKK281cGhhMm4KK281cGg0ZXIKK29wM2luZworb3BpMm4KK28zcGl0CitvNXBvMm4KK280cG9zaQorbzFwb3MKK28xcHIyCitvcDF1CitvcHk1CitvMXEKK28xcmEKK281cmEuCitvNHIzYWcKK29yNWFsMWl6CitvcmFsMWkKK29yNWFuNGdlCitvcmEybgorb3IyYW5nCitvcmU1YQorbzVyZTFhNGwKK29yM2VpMgorb3I0ZTVzMmgKK29yNWUyc3QuCitvcmVzMnQKK29yZXc0CitvcjRndQorb3JnMgorNG81cjJpM2EKK29yM2kxY2EKK281cmlsCitvcjFpbgorbzFyMmkxbworb3IzaTF0eQorbzNyaTF1CitvcjJtaQorb3IxbQorb3JuMmUKK281cm9mCitvcjNvdWcKK29yb3UyCitvcjVwZQorb3IxcAorM29ycmg0CitvcjFyNAorb3I0c2UKK280cnMyCitvcnM1ZW4KK29yc3Q0CitvcjN0aGkKK29yM3RoeQorb3I0dHkKK281cnVtCitvMXJ5CitvczNhbAorb3NhMgorb3MyYworb3M0Y2UKK28zc2NvcAorb3MxY28KKzRvc2NvcGkKK281c2NyCitvczRpNGU0CitvczVpMXQyaXYKK29zaTF0aQorb3MzaTF0bworb3MzaTF0eQorbzVzaTR1CitvczRsMgorbzJzbworbzJzNHBhCitvczRwbworb3MydGEKK281c3RhdGkKK29zNXRpbAorb3N0MmkKK29zNXRpdAorbzR0YTJuCitvMXRhCitvdGVsZTRnCitvdDNlci4KK290NWU0cjFzMgorbzR0ZXMKKzRvdGgKK290aDVlMXNpCitvdGgyZQorb3RoMWVzCitvdGgzaTQKK290M2ljLgorb3Q1aTFjYQorbzN0aWNlCitvM3RpZjIKK28zdGlzCitvdG81czIKK28xdG8KK291Mgorb3UzYjJsMgorb3VjaDVpCitvdTJjaAorb3U1ZXQKK291NGwKK291bmM1ZXIKK291bjJkCitvdTV2Mgorb3Y0ZW4KK292ZXI0bmUKK292ZTRyM3MyCitvdjRlcnQKK28zdmlzCitvNHZpMXRpNAorbzV2NG9sCitvdzNkZXIKK293M2VsCitvdzVlc3QzCitvdzFpMgorb3duNWkKK280d28yCitveTFhCisxcGEKK3BhNGNhCitwYTRjZQorcGEyYzR0CitwNGEyZAorNXBhZ2E0bgorcGExZ2EKK3AzYWdhdAorcDRhaTIKK3BhNGk0bjQKK3A0YWwKK3BhMW40YQorcGEybgorcGFuM2VsCitwYW40dHkKK3BhbjF0CitwYTNueQorcGExcAorcGE0cHUKK3BhcmE1YjJsMgorcDJhMnIKK3BhMnJhYgorcGFyNWFnZQorcGFyNWQyaQorM3BhcmUKK3BhcjVlbAorcDRhNHIxaQorcGFyNGlzCitwYTJ0ZQorcGE1dGVyCis1cGF0aGljCitwNGF0aAorcGE1dGh5CitwYTR0cmljCitwYTF0cgorcGF2NAorM3BheQorNHAxYgorcGQ0Cis0cGUuCiszcGU0YQorcGVhcjRsCitwZTJhMnIKK3BlMmMKKzJwMmVkCiszcGVkZQorM3A0ZWRpCitwZTNkNGkzYTQKK3BlZDRpYworcDRlZQorcGVlNGQKK3BlazQKK3BlNGxhCitwZWwyaTRlNAorcGVsMmkKK3BlNG4yYTJuCitwZTFuYQorcDRlbmMKK3BlbjR0aAorcGVuMXQKK3BlNW8ybgorcDRlcmEuCitwZXIxYQorcGVyYTViMmwyCitwZTJyYTRiCitwNGVyYWcKK3A0ZXIxaQorcGVyaTVzdAorcGVyMmlzCitwZXI0bWFsCit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FkMmEKK3JkMmkKK3IxZDRpNGEKK3JkaTRlcgorcmQyaWU0CityZDFpbjQKK3JkM2luZworMnJlLgorcmUxYTRsCityZTNhMm4KK3JlNWFyMXI0CityZTJhMnIKKzVyZWEydgorcmU0YXcKK3I1ZWJyYXQKK3IyZTFiCityZTNicgorcmVjNW9sMWwKK3JlMmNvbAorcmUxY28KK3JlNGM1b21wZQorcmVjbzRtMXAKK3JlNGNyZQorcmUxY3IKKzJyMmVkCityZTFkZQorcmUzZGlzMQorcjRlZGkKK3JlZDVpdAorcmU0ZmFjCityZTFmCityZTFmYQorcmUyZmUKK3JlNWZlci4KK3JlZmVyMQorcmUzZmkKK3JlNGZ5CityZWczaXMKK3JlNWl0CityZWkyCityZTFsMmkKK3JlNWx1CityNGVuNHRhCityZW4xdAorcmVuNHRlCityZTFvCityZTVwaTJuCityZTRwb3NpCityZTFwbworcmUxcG9zCityZTFwdQorcjFlcjQKK3I0ZXIxaQorcjJlcm80CityNGU1cnUKK3I0ZXMuCityZTRzcGkKK3JlMXNwCityZXM0czVpNGIKK3IyZTJzcworcmVzMXNpCityZXMydAorcmU1czJ0YTJsCityZXMxdGEKK3IyZTNzdDRyCityZTR0ZXIKK3JlNHRpNHoKK3JlM3RyaQorcjRldTIKK3JlNXUxdDJpCityZXYyCityZTR2YWwKK3JlMXZhCityZXYzZWwKK3I1ZXY1ZXIuCityZXYxZXIKK3JlNXZlNHIxczIKK3JlNXZlcnQKK3JlNXZpNGwKK3JlMXZpCityZXY1b2x1CityZTR3aAorcjFmCityM2Z1NAorcjRmeQorcmcyCityZzNlcgorcjNnZXQKK3IzZzFpYworcmdpNG4KK3JnM2luZworcjVnaXMKK3I1Z2l0CityMWdsMgorcmdvNG4yCityMWdvCityM2d1CityaDQKKzRyaC4KKzRyaGFsCityMmkzYQorcmlhNGIKK3JpNGFnCityNGliCityaWIzYQorcmljNWFzNQorcmkxY2EKK3I0aWNlCis0cjJpMWNpCis1cmk1YzJpZAorcmk0YzJpZTQKK3I0aTFjbworcmlkNWVyCityMmlkCityaTNlbmMKK3IyaWU0CityaTNlbjF0CityaTFlcgorcmk1ZXQKK3JpZzVhMm4KK3IyaWcKK3JpMWdhCis1cjRpZ2kKK3JpbDNpegorcmlsMWkKKzVyaW1hMm4KK3JpMW1hCityaW01aQorM3JpMW1vCityaW00cGUKK3JpNG0xcAorcjJpMW5hCis1cmluYS4KK3I0aW40ZAorcjJpbjRlCityaW40ZworcjJpMW8KKzVyaXBoCityMmlwCityaXBoNWUKK3JpMnAybDIKK3JpcDVsaWMKK3I0aXEKK3IyaXMKK3I0aXMuCityMmlzNGMKK3IzaXMyaAorcmlzNHAKK3JpM3RhM2IKK3JpMXRhCityNWl0ZWQuCityMml0ZQorcmkydDFlZAorcml0NWVyLgorcml0NWU0cjFzMgorcjRpMnQzaWMKK3JpMXRpCityaTJ0dQorcml0NXVyCityaXY1ZWwKK3IyaXYKK3JpdjNldAorcml2M2kKK3IzagorcjNrZXQKK3JrNGxlCityazFsCityazRsaW4KK3IxbAorcmxlNAorcjJsZWQKK3I0bDJpZworcjRsaXMKK3JsNWlzMmgKK3IzbG80CityMW0KK3JtYTVjCityMW1hCityMm1lCityM21lbgorcm01ZTRyMXMyCitybTNpbmcKK3I0bWluZy4KK3I0bTJpbworcjNtaXQKK3I0bXkKK3I0bjJhMnIKK3IxbmEKK3IzbmVsCityNG4xZXIKK3I1bmV0CityM25leQorcjVuaWMKK3IxbmlzNAorcjNuMml0CityM24yaXYKK3JubzQKK3I0bm91MgorcjNudQorcm9iM2wyCityMm9jCitybzNjcgorcm80ZQorcm8xZmUKK3JvNWZpbAorcm8yZmkKK3Iyb2syCitybzVrMWVyCis1cm9sZS4KK3JvbTVlMXRlCitybzJtZQorcm80bWV0Cityb200aQorcm80bTRwCityb240YWwKK3JvMm4KK3JvMW4xYQorcm9uNGUKK3JvNW40aXMKK3JvbjR0YQorcm9uMXQKKzFyb29tCityb28yCis1cm9vdAorcm8zcGVsCityb3AzaWMKK3JvcjNpCitybzVybworcm8yczVwZXIKK3JvMnM0cworcm80dGgyZQorcjRvdGgKK3JvNHR5CitybzR2YQorcm92NWVsCityb3g1CityMXAKK3I0cGU0YQorcjVwZW4xdAorcnA1ZXIuCityM3BlMnQKK3JwNGg0CitycDNpbmcKK3JwaTJuCityM3BvCityMXI0CitycmU0YworcnJlNGYKK3I0cmUxbworcnJlNHMydAorcnIyaTRvCitycjJpNHYKK3JybzJuNAorcnJvczQKK3JyeXM0Cis0cnMyCityMXNhMgorcnNhNXRpCityczRjCityMnNlCityM3NlYworcnNlNGNyCityNHM1ZXIuCityczNlNHMKK3I1c2U1djIKK3IxczJoCityNXNoYQorcjFzaQorcjRzaTRiCityc28ybjMKK3Ixc28KK3Ixc3AKK3I1c3cyCitydGEyY2g0CityMXRhCityNHRhZworcjN0MmUxYgorcjN0ZW40ZAorcjF0ZTVvCityMXRpCityMnQ1aTJiCitydDJpNGQKK3I0dGllcgorcnQyaWU0CityM3QyaWcKK3J0aWwzaQorcnRpbDRsCityNHRpMWx5CityNHRpc3QKK3I0dDJpdgorcjN0cmkKK3J0cjJvcGg0CitydDRzMmg0CityNHQxczIKK3J1M2EKK3J1M2U0bAorcnUzZW4KK3J1NGdsMgorcnUzaTRuCityMnVpMgorcnVtM3AybDIKK3J1NG0ycAorcnUybgorcnU0bms1CitydW40dHkKK3J1bjF0CityNXVzYzIKK3IydXMKK3J1MnQxaTVuCityNHUxdDJpCitydjRlCitydmVsNGkKK3IzdmVuCitydjVlci4KK3I1dmVzdAorcnY0ZTJzCityM3ZleQorcjN2aWMKK3IzdjJpNHYKK3Izdm8KK3Ixdworcnk0YworNXJ5bmdlCityeW41ZworcnkzdAorc2EyCisyczFhYgorNXNhY2sxCitzYWMzcmkyCitzM2EyYzF0Cis1c2FpMgorc2E0bDJhMnI0CitzNGEybDRtCitzYTVsbworc2E0bDR0Ciszc2FuYworc2Eybgorc2FuNGRlCitzNGFuZAorczFhcAorc2E1dGEKKzVzYTN0MmlvCitzYTJ0M3UKK3NhdTQKK3NhNXZvcgorNXNhdworNHM1Ygorc2NhbjR0NQorczFjYQorc2NhMm4KK3NjYTRwCitzY2F2NQorczRjZWQKKzRzM2NlaTIKK3M0Y2VzCitzMmNoMgorczRjaG8yCiszczRjMmllNAorczFjaQorNXNjNGluNGQKK3MyY2luCitzY2xlNQorczFjNGw0CitzNGNsaQorc2NvZjQKK3MxY28KKzRzY29weTUKK3Njb3UxcjVhCitzY291MgorczFjdQorNHM1ZAorNHNlLgorc2U0YQorc2VhczQKK3NlYTV3CitzZTJjM28KKzNzZTJjMXQKKzRzNGVkCitzZTRkNGUKK3M1ZWRsCitzZTJnCitzZTFnM3IKKzVzZWkyCitzZTFsZQorNXNlMmwyZgorNXNlbHYKKzRzZTFtZQorc2U0bW9sCitzZTFtbworc2VuNWF0CitzZTFuYQorNHNlbmMKK3NlbjRkCitzNWUybmVkCitzZW41ZworczVlbjFpbgorNHNlbjR0MWQKK3NlbjF0Cis0c2VuMnRsCitzZTJwM2EzCis0czFlci4KK3M0ZXIxbAorczJlcjRvCis0c2VyM3ZvCitzMWU0cworczRlNXMyaAorc2VzNXQKKzVzZTV1bQorczRldQorNXNldgorc2V2M2VuCitzZXc0aTIKKzVzZXgKKzRzM2YKKzJzM2cKK3MyaAorMnNoLgorc2gxZXIKKzVzaGV2CitzaDFpbgorc2gzaW8KKzNzaDJpNHAKK3NoMmkydjUKK3NobzQKK3NoNW8ybDJkCitzaG8ybjMKK3Nob3I0CitzaG9ydDUKKzRzaDF3CitzaTFiCitzNWljM2MKKzNzaTJkZS4KK3MyaWQKKzVzaWRlNHMyCis1c2kyZGkKK3NpNWRpegorNHNpZzFuNGEKK3MyaWcKK3NpbDRlCis0c2kxbHkKKzJzMWluCitzMmkxbmEKKzVzaTJuZS4KK3MyaW5lCitzM2luZworMXMyaW8KKzVzaW8ybgorc2lvMW41YQorczRpMnIKK3NpMXI1YQorMXNpcworM3MyaTF0MmlvCitzaTF0aQorNXNpMXUKKzFzMml2Cis1c2l6CitzazIKKzRza2UKK3Mza2V0CitzazVpbmUKK3NrMWkKK3NrNWluNGcKK3MxbDIKK3MzbGF0CitzMmxlCitzbDJpdGg1CitzbDFpdAorMnMxbQorczNtYQorc21hbDFsMworc21hMm4zCitzbWVsNAorczVtZW4KKzVzNG0yaXRoCitzbW8ybDVkNAorczFtbworczFuNAorMXNvCitzbzRjZQorc28yZnQzCitzbzRsYWIKK3NvMWxhCitzbzJsM2QyCitzbzNsaWMKK3NvbDJpCis1c29sMnYKKzNzb20KKzNzNG9uLgorc28ybgorc28xbjFhNAorc29uNGcKK3M0b3AKKzVzb3BoMWljCitzMm9waAorczVvM3BoaXoKK3M1bzFwaHkKK3NvcjVjCitzb3I1ZAorNHNvdgorc281dmkKKzJzMXBhCis1c3A0YWkyCitzcGE0bgorc3BlbjRkCisyczVwZW8KKzJzcGVyCitzMnBoZQorM3NwaDRlcgorc3BobzUKK3NwaWw0CitzcDVpbmcKK3NwaTJuCis0czNwMmkxbworczRwMWx5CitzMXAybDIKK3M0cG8ybgorczFwNG9yNAorNHNwNG90CitzcXVhbDRsCitzcXUyCitzMXIKKzJzcworczFzYTIKK3NzYXMzCitzMnM1YworczNzZWwKK3M1c2VuNWcKK3M0c2VzLgorc3MxZTRzCitzNXNldAorczFzaQorczRzMmllNAorc3NpNGVyCitzNHM1aTFseQorczRzMWwyCitzczRsaQorczRzMW40Citzc3BlbjRkNAorc3MydAorc3N1MXI1YQorczFzdQorc3N1MnIKK3NzNXcyCisyc3QuCitzMnRhZworczF0YQorczJ0YTJsCitzdGFtNGkKKzVzdDRhbmQKK3N0YTJuCitzNHRhNHAKKzVzdGF0LgorczR0MWVkCitzdGVybjVpCitzNXQyZXJvCitzdGUydworc3RlMXc1YQorczN0aDJlCitzdDJpCitzNHRpLgorczV0MmkxYQorczF0aWMKKzVzNHRpY2sxCitzNHQyaWU0CitzM3RpZjIKK3N0M2luZworczJ0MWluCis1c3Q0aXIKK3MxdGxlCitzMnRsCis1c3RvY2sxC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KK3RlNHAKK3RlNXBlCit0ZXIzYworNXRlcjNkCisxdGVyMWkKK3RlcjVpZXMKK3RlcjJpZTQKK3RlcjNpcwordGVyaTV6YTEKKzV0NGVyM24yaXQKK3RlcjV2Cis0dGVzLgorNHQyZTJzcwordDNlc3MuCit0ZXRoNWUKKzN0NGV1CiszdGV4Cis0dGV5CisydDFmCis0dDFnCisydGguCit0aGEybjQKK3RoMmUKKzR0aGVhCit0aDNlYXMKK3RoZTVhMnQKK3RoZTNpcwordGhlaTIKKzN0aGU0dAordGg1aWMuCit0aDVpMWNhCis0dGg0aWwyCis1dGg0aTRuazIKKzR0NGgxbDQKK3RoNW9kZQorNXRob2QzaWMKKzR0aG9vMgordGhvcjVpdAordGhvNXJpegorMnQ0aDFzMgorMXQyaTFhCit0aTRhYgordGk0YTF0bworMnRpMmIKKzR0aWNrMQordDRpMWNvCit0NGljMXUKKzV0aTJkaQordDJpZAorM3RpZW4KK3QyaWU0Cit0aWYyCit0aTVmeQorMnQyaWcKKzV0aWd1Cit0aWwybDVpbjQKK3RpbDFsCit0aWxsMmkKKzF0aW0KKzR0aTRtMXAKK3RpbTV1bAordGkybXUKKzJ0MWluCit0MmkxbmEKKzN0aTJuZS4KK3QyaW5lCiszdDJpbmkKKzF0MmlvCit0aTVvYwordGlvbjVlZQordGlvMm4KKzV0aXEKK3RpM3NhMgorM3Q0aXNlCit0aTJzNG0KK3RpNXNvCit0aXM0cAorNXRpc3RpMWNhCit0aXMxdDJpCit0aXMxdGljCit0aTN0bAordGk0dQorMXQyaXYKK3RpMXY0YQorMXRpegordGkzemExCit0aTN6ZTRuCit0aTJ6ZQorMnRsCit0NWxhCit0bGEybjQKKzN0bGUuCiszdGxlZAorM3RsZXMuCit0bGVzMgordDVsZXQuCit0NWxvCis0dDFtCit0bWU0CisydDFuMgorMXRvCit0bzNiCit0bzVjcmF0Cis0dG8yZG80CisydG9mCit0bzJncgordG81aWMKK3RvaTIKK3RvMm1hCit0bzRtNGIKK3RvM215Cit0b240YTRsMWkKK3RvMm4KK3RvMW4xYQordG8zbjJhdAorNHRvbm8KKzR0b255Cit0bzJyYQordG8zcjJpZTQKK3RvcjVpegordG9zMgorNXRvdXIKK3RvdTIKKzR0b3V0Cit0bzN3MmEycgorNHQxcAorMXRyYQordDJyYTNiCit0cmE1Y2gKK3RyNGEyY2k0Cit0cmEyYzRpdAordHJhYzR0ZQordHJhMmMxdAordHIyYXM0Cit0cmE1dmVuCit0cmF2NWUyczUKK3RyZTVmCit0cmU0bQordHJlbTVpCis1dHIyaTNhCit0cmk1Y2VzCit0cjRpY2UKKzV0cmkzYzJpMWEKK3Q0cjJpMWNpCis0dHJpNGMzczIKKzJ0cmltCit0cjJpNHYKK3RybzVtNGkKK3Ryb241aQordHJvMm4KKzR0cm9ueQordHJvNXBoZQordHIyb3BoCit0cm8zc3AKK3RybzN2Cit0cjJ1NWkyCit0cjJ1czQKKzR0MXMyCit0NHNjCit0czJoNAordDRzdzIKKzR0M3QyCit0NHRlcwordDV0bwordDF0dTQKKzF0dQordHUxYQordHUzYTJyCit0dTRiNGkKK3R1ZDIKKzR0dWUKKzR0dWY0Cis1dDJ1M2kyCiszdHVtCit0dTRuaXMKK3R1MW5pCisydDN1cC4KKzN0dXJlCis1dHVyaQordHVyM2lzCit0dXI1bwordHU1cnkKKzN0MnVzCis0dHYKK3R3NAorNHQxd2EKK3R3aXM0Cit0d2kyCis0dDF3bzIKKzF0eQorNHR5YQorMnR5bAordHlwZTMKK3R5NXBoCis0dHoKK3QyejRlCis0dWFiCit1YWM0Cit1YTVuYQordWEybgordWFuNGkKK3VhcjVhbjF0Cit1MmEycgordWFyYTJuCit1YXIyZAordWFyM2kKK3VhcjN0Cit1MWF0Cit1YXY0Cit1YjRlCit1NGJlbAordTNiZXIKK3U0YjJlcm8KK3UxYjRpCit1NGI1aW5nCit1M2I0bGUuCit1YjJsMgordTNjYQordWNpNGIKK3UxY2kKK3UyYzRpdAordWNsZTMKK3UxYzRsNAordTNjcgordTNjdQordTRjeQordWQ1ZDQKK3VkM2VyCit1ZDVlc3QKK3VkZXMyCit1ZGUxdjQKK3UxZGljCit1ZDNpZWQKK3VkMmllNAordWQzaWVzCit1ZDVpczEKK3U1ZGl0Cit1NGRvMm4KK3UxZG8KK3VkNHNpCit1MmQxczIKK3U0ZHUKK3U0ZW5lCit1ZTJuMXM0Cit1ZW40dGUKK3VlbjF0Cit1ZXI0aWwKK3VlcjFpCiszdTFmYQordTNmNGwyCit1Z2gzZTJuCit1ZzVpbgorMnVpMgordWlsNWl6Cit1aWwxaQordWk0bgordTFpbmcKK3VpcjRtCit1NGlyCit1aTF0YTQKK3UyaXYzCit1aTR2NGVyLgordTVqCis0dWsKK3UxbGEKK3VsYTViCit1NWxhdGkKK3VsMmNoNAordTRsMWMyCis1dWxjaGUyCit1bDNkZXIKK3UybGQKK3VsMmRlCit1bDRlCit1MWxlbgordWw0Z2kKK3U0bDFnNAordWwyaQordTVsMmkxYQordWwzaW5nCit1bDVpczJoCit1bDRsMmEycgordWwxbAordWw0bGk0YgordWxsMmkKK3VsNGxpcworNHUybDNtCit1MWw0bworNHUybDFzMgordWxzNWU0cwordWwyc2UKK3VsMXRpCit1NGx0Cit1bDF0cmEzCit1bDF0cgorNHVsMXR1MgordTNsdQordWw1dWwKK3VsNXYKK3UybTVhYgordTFtYQordW00YmkKK3U0bTFiCit1bTRiMWx5Cit1bWIybDIKK3UxbWkKK3U0bTNpbmcKK3Vtb3I1bwordTFtbwordW1vMnIKK3U0bTJwCit1bjJhdDQKK3UxbmEKK3UybmUKK3VuNGVyCit1MW5pCit1bjRpbQordTJuMWluCit1bjVpczJoCit1bjJpM3YKK3UybjNzNAordW40c3cyCit1bjJ0M2E0YgordW4xdAordW4xdGEKK3VuNHRlci4KK3VuNHRlcwordW51NAordW41eQordTRuNXoKK3U0bzRyczIKK3U1b3MKK3Uxb3UyCit1MXBlCit1cGU0cjVzMgordTVwMmkzYQordXAzaW5nCit1cGkybgordTNwMmwyCit1NHAzcAordXBwb3J0NQordXAxcDRvcgordXAydDVpMmIKK3UycDF0Cit1cDF0dTQKK3UxcmEKKzR1cmEuCit1NHJhZwordTRyMmFzCit1cjRiZQordXIxYgordXIxYzQKK3VyMWQKK3VyZTVhMnQKK3VyNGZlcjEKK3VyMWYKK3VyNGZyCit1M3JpZgordXJpNGZpYwordXJpMWZpCit1cjFpbgordTNyMmkxbwordTFyaXQKK3VyM2l6Cit1cjJsCit1cmw1aW5nLgordXI0bm80Cit1cm9zNAordXI0cGUKK3VyMXAKK3VyNHBpCit1cnM1ZXIKK3U0cnMyCit1cjJzZQordXI1dGVzCit1cjN0aDJlCit1cjF0aTQKK3VyNHQyaWU0Cit1M3J1CisydXMKK3U1c2EyZAordXNhMgordTVzYTJuCit1czRhcAordXNjMgordXMzY2kKK3VzZTVhCit1NXMyaTFhCit1M3NpYwordXM0bGluCit1czFsMgordXMxcAordXM1czFsMgordTJzcwordXM1dGVyZQordXMxdDRyCit1MnN1Cit1c3UycjQKK3UydGE0YgordTF0YQordTN0YXQKKzR1NHRlLgorNHV0ZWwKKzR1dGVuCit1dGVuNGkKKzR1MXQyaQordXRpNWwyaXoKK3V0aWwxaQordTN0MmluZQordTJ0MWluCit1dDNpbmcKK3V0aW8xbjVhCit1MXQyaW8KK3V0aW8ybgordTR0aXMKKzV1NXRpegordTR0MWwKK3UydDVvZgordTF0bwordXRvNWcKK3V0bzVtYXQxaWMKK3V0bzJtYQordTV0bzJuCit1NHRvdTIKK3U0dDFzNAordTN1Cit1dTRtCit1MXYyCit1eDF1MwordTJ6NGUKKzF2YQorNXZhLgorMnYxYTRiCit2YWM1aWwKK3Y0YTJjaQordmFjM3UKK3ZhZzQKK3ZhNGdlCit2YTVsMmk0ZTQKK3ZhbDFpCit2YWw1bwordmFsMXUKK3ZhNW1vCit2YTVuaXoKK3ZhMm4KK3ZhNXBpCit2YXI1aWVkCit2MmEycgordmFyMWkKK3ZhcjJpZTQKKzN2YXQKKzR2ZS4KKzR2ZWQKK3ZlZ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Cit3aWwybDVpbjQKK3dpbDFsCit3aWxsMmkKK3dpbjRkZQordzRpbmQKK3dpbjRnCit3NGlyNAorM3c0aXNlCit3Mml0aDMKK3dpejUKK3c0aword2w0ZXMyCit3bDNpbgordzRubworMXdvMgord29tMQord281djRlbgordzVwCit3cmE0Cit3cmk0Cit3cmkxdGE0Cit3M3MyaAord3M0bDIKK3dzNHBlCit3NXM0dAorNHd0Cit3eTQKK3gxYQoreGFjNWUKK3g0YTJnbworeGFtMworeDRhcAoreGFzNQoreDNjMgoreDFlCit4ZTRjdTF0bworeGUxY3UKK3hlM2M0dXQKK3gyZWQKK3hlcjRpCit4MmU1cm8KK3gxaAoreGhpMgoreGg0aWw1Cit4aHU0Cit4M2kKK3gyaTVhCit4aTVjCit4aTVkaQoreDJpZAoreDRpbWUKK3hpNW0yaXoKK3hpbTFpCit4M28KK3g0b2IKK3gzcAoreHA0YW40ZAoreDFwYQoreHBhMm4KK3hwZWMxdG81Cit4cGUyYworeHBlMmMxdAoreDJwMmUzZAoreDF0MgoreDN0aQoreDF1Cit4dTNhCit4eDQKK3k1YWMKKzN5MmEycjQKK3k1YXQKK3kxYgoreTFjCit5MmNlCit5YzVlcgoreTNjaAoreWNoNGUyCit5Y29tNAoreTFjbworeWNvdDQKK3kxZAoreTVlZQoreTFlcgoreTRlcjFmCit5ZXM0Cit5ZTR0Cit5NWdpCis0eTNoCit5MWkKK3kzbGEKK3lsbGE1YjJsMgoreWwxbAoreTNsbworeTVsdQoreW1ib2w1Cit5NG0xYgoreW1lNAoreW0xcGEzCit5NG0xcAoreW4zYzRocjQKK3luMmNoCit5bjVkCit5bjVnCit5bjVpYworNXlueAoreTFvNAoreW81ZAoreTRvNWcKK3lvbTQKK3lvNW5ldAoreW8ybgoreTRvMm4zczIKK3k0b3MKK3k0cDJlZAoreXBlcjUKK3lwM2kKK3kzcG8KK3k0cG80YworeXAydGEKK3kycDF0Cit5NXB1Cit5cmE1bQoreXI1aTNhCit5M3JvCit5cjRyNAore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ZXRyb3BvbDFpdAorLm1ldHJvcG9saTN0YTJuCisubWV0cm9wb2xpMXRhCisubWU4dDlyOG85cDhvOGw5aTl0OGE4bjhzLgorLm1ldHJvcG9saXRhMm4xczIKKy5taThjOHI4bzllOGM4bzluOG84bThpOGM4cy4KKy5tNGkxY3IKKy5taWNybzRlCisubWljcm9lMWNvCisubWljcm9lY28ybgorLm1pY3JvZWNvM25vbWljCisubWljcm9lY29ub21pNGMzczIKKy5taTljOHI4bzlmOGk4YzhoOGUuCisubWljcm8yZmkKKy5taWNyb2Y0aTJjaAorLm1pY3JvZmljaGUyCisubWk5YzhyOG85ZjhpOGM4aDhlOHMuCisubWljcm9maWNoMWVzCisubWk4YzhyOG85bzhyOGc4YThuOWk4czhtLgorLm1pY3JvbzIKKy5taWNyb29yZzIKKy5taWNyb29yMWdhCisubWljcm9vcmdhbjVpcworLm1pY3Jvb3JnYTJuCisubWljcm9vcmdhbmkyczFtCisubWk4YzhyOG85bzhyOGc4YThuOWk4czhtOHMuCisubWljcm9vcmdhbjRpczRtMXMyCisubWk4bDhsOWE4ZzhlLgorLm00aWwxbAorLm1pOGw5bDhpOWw4aTh0OGU4ci4KKy5taWxsMmkKKy5taWw0bDRpNGwKKy5taWxsaWwxaQorLm1pbGwyaWwxaXQKKy5taWxsaWwyaXRlCisubWk4bThlOG85ZzhyOGE4cDhoOGU4ZC4KKy5taW1lbzJnCisubWltZW8xZ3IKKy5taW1lb2dyYXBoNGVkCisubWk4bThlOG85ZzhyOGE4cDhoOHMuCisubWltZW9ncmE0cDRoMXMyCisubWk4bTlpOGM5cjhpOGU4cy4KKy5taW0xaQorLm1pbTRpMWNyCisubWltaWNyaTIKKy5taW1pY3IyaWU0CisubWk4bjlpOHMuCisubTJpbmkKKy5taW4xaXMKKy5taThuOGk5czh5OG05cDhvOXM4aTh1OG0uCisubWluaXM0eQorLm1pbmlzeTRtMXAKKy5taW5pc3ltMXBvcworLm1pbmlzeW1wbzVzaTR1CisubWk4bjhpOXM4eThtOXA4bzlzOGk4YS4KKy5taW5pc3ltcG9zMmkxYQorLm1pOW44dTh0OWU4ci4KKy5tNGluMXUKKy5taTluOHU4dDllOHM4dC4KKy5taThzOWM4aDhpOGU5djhvOHU4czlsOHkuCisubTJpczFjCisubWlzM2NoMgorLm1pc2NoMmllNAorLm1pc2NoaWV2b3UyCisubWlzY2hpZXZvMnVzCisubWlzY2hpZXZvdXMxbDIKKy5taXNjaGlldm91czFseQorLm1pOXM4ZThyOHMuCisubTRpc2UKKy5taXMzZXIKKy5taXNlNHIxczIKKy5taTlzOG84ZzlhOW04eS4KKy5taTJzbworLm1pc28xZ2EKKy5taXNvMmdhbQorLm1vOGQ5ZThsOWw4aThuOGcuCisubW8yZDEKKy5tb2RlbDFsCisubW9kZWxsMmkKKy5tb2RlbDJsaW40CisubW84bDllOWM4dThsOGUuCisubW9sZTFjdQorLm1vbGU0Y3VsCisubW9sZWN1bDRlCisubW84bDllOWM4dThsOGU4cy4KKy5tb2xlY3VsZXMyCisubW84bjlhOHI4YzhoOHMuCisubW8xbjFhCisubW9uYXIzYworLm1vbjJhMnIKKy5tb25hcjJjaAorLm1vbmFyYzRoMXMyCisubW84bjhlOHk5bDhlOG45ZDhlOHIuCisubW9uZXlsZW4xZGUKKy5tbzhuOGU4eTlsOGU4bjlkOGU4cjhzLgorLm1vbmV5bGVuZGU0cjVzMgorLm1vOG44bzljOGg4cjhvOG04ZS4KKy5tb25vMmNoNAorLm1vbm9jNGhyNAorLm1vbm9jaHJvMm1lCisubW84bjhvOWU4bjllOHI5ZzhlOHQ4aThjLgorLm1vM25vZQorLm1vbm9lbjFlcgorLm1vbm9lbmVyZzIKKy5tb25vZW5lcjNnZXQKKy5tb25vZW5lcmdldDFpYworLm1vOG45bzhpOGQuCisubW9ub2kyCisubW9ubzJpZAorLm1vOG44bzlwOG84bDhlLgorLm1vNG5vcAorLm1vOG44bzlwOG84bDhlOHMuCisubW9ub3BvbGVzMgorLm1vOW44bzhwOW84bDh5LgorLm1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hlMWxlczIKKy5ub25ldGhlM2wyZTJzcworLm5vOG45ZTh1OGM4bDhpOGQ5ZThhOG4uCisubm9uNGV1Cisubm9uZXUxYzRsNAorLm5vbmV1Y2wyaWQKKy5ub25ldWNsaWRlYTJuCisubm84bjlpOHM4bzltOG84cjlwOGg4aThjLgorLm5vbjVpCisubm9uMWlzCisubm9uaTJzbworLm5vbmkzc29tCisubm9uaXNvMW1vCisubm9uaXNvbW8ycgorLm5vbmlzb21vcjFwCisubm9uaXNvbW9ycDRoNAorLm5vbmlzb21vcnBoMWljCisubm84bjlwOHM4ZTh1OGQ4bzljOG84bTlwOGE4Yzh0LgorLm5vbjFwNAorLm5vbjJwMXMyCisubm9ucDJzZQorLm5vbnBzNGV1Cisubm9ucHNldTFkbworLm5vbnBzZXVkbzFjbworLm5vbnBzZXVkb2NvNG0xcAorLm5vbnBzZXVkb2NvbTFwYQorLm5vbnBzZXVkb2NvbXBhMmM0dAorLm5vOG45czhtOG84bzh0OGguCisubm8ybjNzMgorLm5vbjJzM20KKy5ub25zMW1vCisubm9uc21vbzIKKy5ub25zbW80b3RoCisubm84bjl1OG44aTlmOG84cjhtLgorLm5vM251NG4KKy5ub251MW5pCisubm9udW5pMWZvCisubm9udW5pZm8ycgorLm5vbnVuaWZvcjFtCisubm84bjl1OG44aTlmOG84cjhtOWw4eS4KKy5ub251bmlmb3I0bTFsCisubm9udW5pZm9ybTFseQorLm5vOHI5ZThwOWk5bjhlOHA4aDlyOGk4bjhlLgorLm5vcmU1cGkybgorLm5vcmVwMmluZQorLm5vcmVwaW5lcDRocjQKKy5ub3JlcDJpbmVwaHIyaW40ZQorLm5vOHQ5dzhpOHQ4aDlzOHQ4YThuOGQ5aThuOGcuCisubm90dzQKKy5ub3R3aTIKKy5ub3R3Mml0aDMKKy5ub3R3aTJ0NGgxczIKKy5ub3R3aXRoNXN0NGFuZAorLm5vdHdpdGhzMXRhCisubm90d2l0aHN0YTJuCisubm90d2l0aHN0YW5kMWluCisubnU5Yzh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ThzLgorLnBob25lMm1lcworLnBoOG85bjhlOW04aThjLgorLnBob25lNW1pCisucGg4bzhzOXA4aDhvOHI5aThjLgorLnBob3MxcAorLnBob3NwaG81CisucGhvc3BobzRyCisucGg4bzl0OG85ZzhyOGE4cDhoOHMuCisucGhvMXRvCisucGhvdG8yZ3IKKy5waG90b2dyYTRwNGgxczIKKy5waDhvOXQ4bzlvOGY4ZjlzOGU4dC4KKy5waG90b28yCisucGhvdG9vNGYxZgorLnBob3Rvb2YyZjNzCisucGk4YzlhOWQ4bzhyLgorLnBpMWNhCisucGljYTJkCisucGljYTFkbworLnBpY2FkNG9yCisucGk4YzlhOWQ4bzhyOHMuCisucGljYWRvNHJzMgorLnBpOHA4ZTlsOGk4bjhlLgorLnAyaXAKKy5waXBlNAorLnBpcGVsMmkKKy5waXBlMWw0aW5lCisucGk4cDhlOWw4aThuOGU4cy4KKy5waXBlbGkxbmVzCisucGk4cDhlOWw4aThuOWk4bjhnLgorLnBpcGVsMmluM2kKKy5waXBlbGluMWluCisucGlwZWxpbmluNGcKKy5waTlyOGE5bjhoOGE4cy4KKy5wNGlyCisucGkxcmEKKy5waXJhMm4KKy5waXJhNG4xaDQKKy5waXJhbmhhNAorLnBsOGE4YzhhOWI4bDhlLgorLjFwMmwyCisucGxhMWNhCisucGxhY2ExYjJsMgorLnBsOGE4bjh0OWg4bzhwOXA4ZThyLgorLjNwbGEybgorLnBsYW4xdAorLnBsYW50aG80cDFwCisucGxhbnRob3AycGUKKy5wbGFudGhvcDNwZXIKKy5wbDhhOG44dDloOG84cDlwOGU4cjhzLgorLnBsYW50aG9wcGU0cjFzMgorLnBsOGU4YThzOWE4bjhjOGUuCisucGxlMmEKKy5wbGVhc2EyCisucGxlYTNzYW5jCisucGxlYXNhMm4KKy5wbDh1OGc5aThuLgorLnBsdWc1aW4KKy5wbDh1OGc5aThuOHMuCisucGx1NWc0aTJuMXMyCisucG84bDl0OGU4cjlnOGU4aThzOHQuCisucG80bDJ0CisucG9sMXRl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vc3RodW1vdTIKKy5wbzhzOHQ5czhjOHI4aThwOHQuCisucG9zNHQxczIKKy5wb3N0NHNjCisucG9zdHNjcmkyCisucG9zdHNjcjJpcAorLnBvc3RzY3JpMnAxdAorLnBvOHM4dDlzOGM4cjhpOHA4dDhzLgorLnBvc3RzY3JpcDR0MXMyCisucG84czl0OHU4cjlhOGwuCisucG9zMXR1CisucG9zdHUxcmEKKy5wcjhlOWE4bTliOGw4ZS4KKy5wcmVhNG0xYgorLnByZWFtYjJsMgorLnByOGU5YThtOWI4bDhlOHMuCisucHJlYW1ibGVzMgorLnByOGU5bDhvOGE4ZDhlOGQuCisucHJlbDRvYQorLnByZWxvYTJkMworLnByZWxvYTJkMWVkCisucHI4ZTlwOGE4cjlpOG44Zy4KKy5wcmUycGEKKy5wcmVwNGE0cjFpCisucHJlcDJhMnIKKy5wcmVwYXJpbjRnCisucHI4ZTlwOHI4aThuOHQuCisucHIyZXByMgorLnByZXByaW40dDMKKy5wcjhlOXA4cjhpOG44dDhzLgorLnByZXByaW40dDRzMgorLnByOGU5cDhyOG84YzhlOHM5czhvOHIuCisucHJlM3BybworLnByZXByMm9jCisucHJlcHJvMWNlCisucHJlcHJvYzJlMnNzCisucHJlcHJvY2VzMXNvCisucHI4ZTlwOHI4bzhjOGU4czlzOG84cjhzLgorLnByZXByb2Nlc3NvNHJzMgorLnByOGU5czhwOGw4aTh0OXQ4aThuOGcuCisucHJlMXNwCisucHJlczFwMmwyCisucHJlc3BsMWl0CisucHJlc3BsNGk0dDN0MgorLnByZXNwbGl0MnQxaW4KKy5wcjhlOXc4cjhhOHAuCisucHJld3JhNAorLnByOGU5dzhyOGE4cDhwOGU4ZC4KKy5wcmV3cmE0cDFwCisucHJld3JhcDJwZQorLnByZXdyYXA0cDJlZAorLnByOGk4ZThzOHQ5ZThzOHM4ZThzLgorLjVwcjJpNGU0CisucHJpMWVzdAorLnByaWVzNHQyZTJzcworLnByaWVzdGVzczFlNHMKKy5wcjhlOHQ5dDh5OXA4cjhpOG45dDhlOHIuCisucHJlNHQzdDIKKy5wcmV0MXR5CisucHIyZXR0eXByMgorLnByZXR0eXByaW40dDMKKy5wcjhlOHQ5dDh5OXA4cjhpOG45dDhpOG44Zy4KKy5wcmV0dHlwcmludDJpCisucHJldHR5cHJpbjR0M2luZworLnByZXR0eXByaW4ydDFpbgorLnByOG85YzhlOWQ4dThyOWE4bC4KKy5wcjJvYworLnBybzFjZQorLnByb2NlMWR1CisucHJvY2VkdTFyYQorLnByOG84YzhlOHM4cy4KKy5wcm9jMmUyc3MKKy5wcjhvOWM4dThyOWE4bjhjOGUuCisucHJvY3UxcmEKKy5wcm9jdXJhMm4KKy5wcjhvOGc5ZTluOGk4ZThzLgorLnBybzFnZQorLnBybzFnZW4KKy5wcm9nZTVuMmllNAorLnByOG84ZzllOW44eS4KKy5wcm80Z2VueQorLnByOG85ZzhyOGE4bTltOGE4YjhsOGUuCisucHJvMWdyCisucHJvZ3JhbTFtCisucHJvZ3JhbTFtYQorLnByb2dyYW0ybWFiCisucHJvZ3JhbW1hYjJsMgorLnByOG84bTlpOW44ZThuOHQuCisucHJvbTRpCisucHJvbTFpbgorLnByb20yaW5lCisucHJvbWkxbmVuCisucHJvbWluZW4xdAorLnByOG85bThpOHM5Yzh1OW84dThzLgorLnByb20yaXMKKy5wcm9tMmlzMWMKKy5wcm9taXMxY3UKKy5wcm9taXNjdTFvdTIKKy5wcm9taXNjdW8ydXMKKy5wcjhvOG05aThzOXM4bzhyOHkuCisucHJvbTRpMnMxcworLnByb21pczFzbworLnByb21pc3NvMXJ5CisucHI4bzhtOWk4czhlLgorLnByb200aXNlCisucHI4bzhtOWk4czhlOHMuCisucHJvbWlzMWU0cworLnByOG85cDhlOGw5bDhlOHIuCisucHJvM3BlbAorLnByb3BlbDFsCisucHJvcGVsMmxlCisucHI4bzlwOGU4bDlsOGU4cjhzLgorLnByb3BlbGxlNHIxczIKKy5wcjhvOXA4ZThsOWw4aThuOGcuCisucHJvcGVsbDJpCisuc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OHM5dDhpOGMuCisudGgyZQorLnRoZXIzbTQKKy50aGVyMW1vCisudGhlcm1vNGVsCisudGhlcm1vZTFsYQorLnRoZXJtb2VsYXN0MmkKKy50aGVybW9lbGFzMXRpYworLnRpOG04ZTlzOHQ4YThtOHAuCisudGkybWVzCisudGltZXMxdGEKKy50aW1lc3RhNG0xcAorLnRpOG04ZTlzOHQ4YThtOHA4cy4KKy50aW1lc3RhbTJwMXMyCisudG84bzhsOWs4aTh0LgorLnRvbzIKKy50b29sazFpCisudG84bzhsOWs4aTh0OHMuCisudG9vbGtpNHQxczIKKy50bzhwOG85ZzhyOGE4cDhoOWk5YzhhOGwuCisudG81cG80ZworLnRvcG8xZ3IKKy50b3BvNWdyYXBoMWljCisudG9wb2dyNGFwaGkKKy50b3BvZ3JhcGhpMWNhCisudG84cTh1OGU4cy4KKy50bzFxCisudG9xdTIKKy50cjhhOGk5dDhvOHI5bzh1OHMuCisuMXRyYQorLnRyMmFpMgorLnRyYWkxdG8KKy50cmFpdG9yb3UyCisudHJhaXRvcm8ydXMKKy50cjhhOG44czljOGU4aTh2OGU4ci4KKy50cmEybgorLnRyYTJuMXMyCisudHJhbnM0YworLnRyYW40czNjZWkyCisudHJhbnNjZTJpdgorLnRyOGE4bjhzOWM4ZThpOHY4ZThyOHMuCisudHJhbnNjZWl2ZTRyMXMyCisudHI4YThuOHM5ZzhyOGU4czhzLgorLnRyYW4yczNnCisudHJhbnMxZ3IKKy50cmFuc2dyMmUyc3MKKy50cjhhOG44czl2OGU4cjlzOGE4bC4KKy50cmFuNHN2CisudHJhbnN2ZTRyMXMyCisudHJhbnN2ZXIxc2EyCisudHI4YThuOHM5djhlOHI5czhhOGw4cy4KKy50cmFuc3ZlcnNhMmwxczIKKy50cjhhOG44czl2OGU4czl0OGk4dDhlLgorLnRyYW5zdjRlMnMKKy50cmFuc3Zlc3QyaQorLnRyYW5zdmVzdDJpdGUKKy50cjhhOG44czl2OGU4czl0OGk4dDhlOHMuCisudHJhbnN2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JpZTQKKy52YThnOHU4ZThyLgorLjF2YQorLnZhZzQKKy52YTVndWVyCisudmEyZ3VlCisudmE4dThkOGU5djhpOGw4bDhlLgorLnZhdWRlMXY0CisudmF1ZGUydjNpNGwKKy52YXVkZTF2aQorLnZhdWRldmlsMWwKKy52YXVkZXZpbDJsZQorLnZpOGM5YThyOHMuCisudjRpYzJhMnIKKy52aTFjYQorLnZpY2E0cnMyCisudmk4bDlsOGE4aThuOWU4czhzLgorLjJ2aWwKKy52aWwxbAorLnZpbGxhaTIKKy52aWxsYTRpNG4KKy52aWxsYTJpbmUKKy52aWxsYWk1bjJlMnNzCisudmlsbGFpMW5lcworLnZpOHM5dThhOGwuCisudmkzc3UKKy52aXN1MWFsCisudmk4czl1OGE4bDlsOHkuCisudmlzdWFsMWwKKy52aXN1YWwxbHkKKy52aTl2OGk4cDlhOXI4bzh1OHMuCisuM3YyaXYKKy52aXYyaTRwCisudml2aTFwYQorLnZpdmlwMmEycgorLnZpdmlwYXJvdTIKKy52aXZpcGFybzJ1cworLnZvOGk4YzhlOXA4cjhpOG44dC4KKy52b2k0Cisudm9pM2NlcAorLnZvaWNlcHIyCisudm9pY2VwcmluNHQzCisudnM4cDhhOGM4ZS4KKy52MnMxcGEKKy52c3BhNGNlCisud2E4ZDlkOGk4bjhnLgorLndhMmQKKy53YWQ0ZDFpbgorLndhZDFkNAorLndhOGw4bDlmOGw4bzh3OGU4ci4KKy53YWwxbAorLndhbDJsZgorLndhbGxmNGwyCisud2FsbGZsb3cxZXIKKy53YThsOGw5ZjhsOG84dzllOHI4cy4KKy53YWxsZmxvd2U0cjFzMgorLndhOHI4bTllOHM4dC4KKy53MmEycgorLndhcjFtCisud2FyMm1lCisud2FyMm1lcworLndhOHM4dDhlOXc4YTh0OGU4ci4KKy53YXM0dAorLndhc3RlMncKKy53YXN0ZTF3NWEKKy53YXN0ZXdhMXRlCisud2E4djhlOWc4dThpOGQ4ZS4KKy53YXZlZzMKKy53YXZlZzJ1aTIKKy53YX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W5kbGU0aHI0CisuaGE5ZDhhOW04YThyOGQuCisuaGEyZAorLmhhMWQyYQorLmhhZGEybTIKKy5oYWQ0YTFtYQorLmhhZGFtMmEycgorLmhhOGk5ZjhhLgorLmhhaTFmYQorLmhhOG04aThsOXQ4bzhuOWk4YThuLgorLmhhNG0KKy5oYW1pNGx0CisuaGFtaWwxdG8KKy5oYW1pbHRvMm4KKy5oYW1pbHRvM240aTFhCisuaGFtaWx0b25pM2EybgorLmhlOGw5czhpOG44azhpLgorLmhlMmwxczIKKy5oZWwyczFpbgorLmhlbHM0aTRuazIKKy5oZWxzaW5rMWkKKy5oZThyOW04aTh0OWk4YThuLgorLmhlcjNtaXQKKy5oZXJtaTF0aQorLmhlcm00aTF0MmkxYQorLmhlcm1pdGkyYTJuCisuaGk4YjhiOHMuCisuaGkyYjFiCisuaGliMmI1czIKKy5obzhrOWs4YThpOWQ4by4KKy5oMm9rCisuaG9razQKKy5ob2trYWkyCisuaG9ra2EyaWQKKy5ob2trYWkxZG8KKy5qYThjOWs4bzh3OXM4azhpLgorLjVqYQorLmphY2sxCisuamFja293c2syCisuamFja293c2sxaQorLmphOG45dTlhOHI4eS4KKy5qYTJuCisuamFuM3UxYQorLmphbnUyYTJyCisuamE5cDhhOW44ZThzOGUuCisuamE0cAorLmphMXBhCisuamFwYTJuCisuamFwYTFuZXMKKy5qYXBhbmUxczJlCisua2E4ZDlvOG05dDhzOGU4di4KKy5rYTJkCisua2ExZG8KKy5rYWRvNG10Cisua2Fkb200dDFzMgorLmthZG9tdDVzZXYKKy5rYThuOXM4YThzLgorLmthMm4KKy5rYW4yc2EyCisua2EybjFzMgorLmthOHI4bDhzOXI4dThoOGUuCisuazJhMnIKKy5rYXIxbAorLmthcjJsMXMyCisua2FybHMxcgorLmtvOHI5dDhlOXc4ZThnLgorLmtvNXIKKy5rcjhpOHM4aDhuOGEuCisua3IyaXMKKy5rcjNpczJoCisua3JpczJoMW4KKy5rcmlzaDFuYQorLmtyOGk4czhoOW44Y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4KKy5taWNybzJzbworLm1pY3Jvc28yZnQzCisubWk4bjluOGU5YThwOW85bDhpOHMuCisubTJpNG4xbjIKKy5taW5uZTQKKy5taW5uZWFwb2wyaQorLm1pOG45bjhlOXM4bzh0OGEuCisubWluMW5lcworLm1pbm5lMXNvCisubWlubmVzbzF0YQorLm1vOHM5YzhvOHcuCisubW9zMmMKKy5tb3MxY28KKy5uYThjOGg5cjhpOGM4aDh0OGU4bi4KKy4xbmEKKy5uYTJjaAorLm5hYzRocjQKKy5uYTJjaHI0aTJjaAorLm5hY2hyaWNodDFlbgorLm5hOHM4aDl2OGk4bDhsOGUuCisubjRhcworLm5hczJoCisubmFzaDJ2aWwKKy5uYXNodmlsMWwKKy5uYXNodmlsMmxlCisubmU4dDliOHM4ZC4KKy5uZTJ0MWIKKy5uZXQyYjVzMgorLm5ldGI0czVkCisubmU4dDlzOGM4YThwOGUuCisubmU0dDFzMgorLm5ldDRzYworLm5ldHNjYTRwCisubmV0czFjYQorLm5pOGo5bThlOWc4ZThuLgorLm5pM2oKKy5uaWptZTJnCisubmlqbWUxZ2VuCisubm84ZTl0OGg4ZThyOWk4YThuLgorLjNub2UKKy5ub2V0aDJlCisubm9ldGhlcjFpCisubm9ldGhlMXIyaTNhNAorLm5vZXRoZXJpMmEybgorLm5vOG84cjhkOXc4aThqOGs4ZThyOWg4bzh1OHQuCisubm9vMgorLm5vM29yZAorLm5vb3JkMXcKKy5ub29yZHdpMgorLm5vb3Jkd2kzagorLm5vb3Jkd2lqazFlcgorLm5vb3Jkd2lqa2VyMWg0Cisubm9vcmR3aWprZXJob3UyCisubm85djhlOG05YjhlOHIuCisubm92ZTRtNWIKKy5vcDhlOG45YjhzOGQuCisub3BlNG4xYjQKKy5vcGVuMmI1czIKKy5vcGVuYjRzNWQKKy5vcDhlOG45bzhmOGY4aThjOGUuCisub3A0ZW5vCisub3Blbm80ZjFmCisub3Blbm9mMWZpCisucGE4bDhhOXQ4aThuOG8uCisucGFsYTJ0MWluCisucGF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haHJzY2hlMgorLndhaHJzY2hlaTIKKy53YWhyc2NoZTRpNG4xbAorLndhaHJzMmNoZWlubDRpMmNoCisud2FocnNjaGVpbmxpYzRoaworLndhaHJzY2hlaW5saWNoa2VpMgorLndhaHJzY2hlaW5saWNoa2VpNHQxczIKKy53YWhyc2NoZWlubGljaGtlaXRzM3RoMmUKKy53YWhyc2NoZWlubGljaGtlaXRzdGhlMW81cgorLndhaHJzY2hlaW5saWNoa2VpdHN0aGVvcjJpZTQKKy53ZThyOW44ZThyLgorLncxZXIKKy53ZXI0bjFlcgorLndlOHI5dDhoOGU4cjlpOGE4bi4KKy53ZXJ0aDJlCisud2VydGhlcjFpCisud2VydGhlMXIyaTNhNAorLndlcnRoZXJpMmEybgorLndpOG45YzhoOGU4czl0OGU4ci4KKy53aW4yY2gKKy53aW5jaGUyCisud2luY2gxZXMKKy53aThyOHQ5czhjOGg4YThmOHQuCisudzRpcjQKKy53aXI0dDFzMgorLndpcnQ0c2MKKy53aXJ0czJjaDIKKy53aXJ0c2NoYTJmCisud2lydHNjaGEyZnQKKy53aThzOXM4ZThuOXM4YzhoOGE4Zjh0OWw4aThjOGguCisudzRpMnMxcworLndpc3NlbjQKKy53aXNzZTJuMXMyCisud2lzc2VuczRjCisud2lzc2VuczJjaDIKKy53aXNzZW5zY2hhMmYKKy53aXNzZW5zY2hhMmZ0Cisud2lzc2Vuc2NoYWYydGwKKy53aXNzZW5zMmNoYWZ0bDRpMmNoCisueHY4aThpOGk4dDhoLgorLnh2NGk1aTQKKy54dmk0aTVpNAorLnh2aWkyaXRoCisueHY4aThpOHQ4aC4KKy54dmkyaXRoCisueHg4aThpOGk4cjhkLgorLnh4NAorLnh4M2kKKy54eDRpNWk0CisueHhpNGk1aTQKKy54eGlpNGlyCisueHg4aThpOG44ZC4KKy54eGk0aW5kCisueWk4bjhnOXk4bzhuOGcuCisueTFpCisueWluMmd5CisueWluZ3kxbzQKKy55aW5neW8ybgorLnNoOHU5eDh1OGUuCisuc2h1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gICAgICAgICAgYW5kcm9pZDpncmF2aXR5PSJyaWdodHxib3R0b20iCiAgICAgICAgICAgICAvPgorCiAgICAgICAgIDxjb20uYW5kcm9pZC5pbnRlcm5hbC53aWRnZXQuRGlnaXRhbENsb2NrIGFuZHJvaWQ6aWQ9IkAraWQvdGltZSIKICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3dpZHRoPSJ3cmFwX2NvbnRlbnQiCiAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IndyYXBfY29udGVudCIKICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2FsaWduUGFyZW50VG9wPSJ0cnVlIgogICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfYWxpZ25QYXJlbnRMZWZ0PSJ0cnVlIgogICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfbWFyZ2luVG9wPSI4ZGlwIgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfbWFyZ2luQm90dG9tPSI4ZGlwIgogICAgICAgICAgICAgPgogCiAgICAgICAgICAgICA8VGV4dFZpZXcgYW5kcm9pZDppZD0iQCtpZC90aW1lRGlzcGxheSIKICAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0id3JhcF9jb250ZW50IgogICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50IgotICAgICAgICAgICAgICAgIGFuZHJvaWQ6Z3Jhdml0eT0iYm90dG9tIgogICAgICAgICAgICAgICAgIGFuZHJvaWQ6c2luZ2xlTGluZT0idHJ1ZSIKICAgICAgICAgICAgICAgICBhbmRyb2lkOmVsbGlwc2l6ZT0ibm9uZSIKICAgICAgICAgICAgICAgICBhbmRyb2lkOnRleHRTaXplPSI3MnNwIgpAQCAtODQsOCArODUsOSBAQAogCiAgICAgICAgICAgICA8VGV4dFZpZXcgYW5kcm9pZDppZD0iQCtpZC9hbV9wbSIKICAgICAgICAgICAgICAgICB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aXAiCiAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9tYXJnaW5MZWZ0PSIyMGRpcCIKKyAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X21hcmdpbkJvdHRvbT0iOGRpcCIKICAgICAgICAgICAgID4KIAogICAgICAgICAgICAgPFRleHRWaWV3IGFuZHJvaWQ6aWQ9IkAraWQvdGltZURpc3BsYXkiCiAgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9IndyYXBfY29udGVudCIKICAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IndyYXBfY29udGVudCIKLSAgICAgICAgICAgICAgICBhbmRyb2lkOmdyYXZpdHk9ImJvdHRvbSIKICAgICAgICAgICAgICAgICBhbmRyb2lkOnNpbmdsZUxpbmU9InRydWUiCiAgICAgICAgICAgICAgICAgYW5kcm9pZDplbGxpcHNpemU9Im5vbmUiCiAgICAgICAgICAgICAgICAgYW5kcm9pZDp0ZXh0U2l6ZT0iNTZzcCIKQEAgLTc0LDggKzc0LDkgQEAKIAogICAgICAgICAgICAgPFRleHRWaWV3IGFuZHJvaWQ6aWQ9IkAraWQvYW1fcG0iCiAgICAgICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9IndyYXBfY29udGVudCIKLSAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9Im1hdGNoX3BhcmVudCIKLSAgICAgICAgICAgICAgICBhbmRyb2lkOmdyYXZpdHk9ImJvdHRvbSIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF90b1JpZ2h0T2Y9IkBpZC90aW1lRGlzcGxheSIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9hbGlnbkJhc2VsaW5lPSJAaWQvdGltZURpc3BsYXkiCiAgICAgICAgICAgICAgICAgYW5kcm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T09PT09PT09PT09PT09PT09PT09IC0tPgpAQCAtMTIwNiw3ICsxMjA2LDcgQEAKICAgPHB1YmxpYyB0eXBlPSJhdHRyIiBuYW1lPSJxdWlja0NvbnRhY3RCYWRnZVN0eWxlU21hbGxXaW5kb3dTbWFsbCIgaWQ9IjB4MDEwMTAyYjEiIC8+CiAgIDxwdWJsaWMgdHlwZT0iYXR0ciIgbmFtZT0icXVpY2tDb250YWN0QmFkZ2VTdHlsZVNtYWxsV2luZG93TWVkaXVtIiBpZD0iMHgwMTAxMDJiMiIgLz4KICAgPHB1YmxpYyB0eXBlPSJhdHRyIiBuYW1lPSJxdWlja0NvbnRhY3RCYWRnZVN0eWxlU21hbGxXaW5kb3dMYXJnZSIgaWQ9IjB4MDEwMTAyYjMiIC8+Ci0gIAorCiA8IS0tID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgICBSZXNvdXJjZXMgYWRkZWQgaW4gdmVyc2lvbiA3IG9mIHRoZSBwbGF0Zm9ybSAoRWNsYWlyIE1SMSkuCiAgICAgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAtLT4KQEAgLTEyMTUsNyArMTIxNSw3IEBACiAgIDxwdWJsaWMgdHlwZT0iYXR0ciIgbmFtZT0iYXV0aG9yIiBpZD0iMHgwMTAxMDJiNCIgLz4KICAgPHB1YmxpYyB0eXBlPSJhdHRyIiBuYW1lPSJhdXRvU3RhcnQiIGlkPSIweDAxMDEwMmI1IiAvPgogCi0gICAgCisKIDwhLS0gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgICAgIFJlc291cmNlcyBhZGRlZCBpbiB2ZXJzaW9uIDggb2YgdGhlIHBsYXRmb3JtIChFY2xhaXIgTVIyKS4KICAgICAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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Ci0gICAgICAgICAgICAgICAgIiwiICsgaSUyICsgIik7Iik7Ci0gICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIEN1cnNvciBjID0gbURhdGFiYXNlLnF1ZXJ5KCJ0ZXN0IiwgbnVsbCwgInMgPSAwIiwgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCk7Ci0gICAgICAgIGludCBkQ29sID0gYy5nZXRDb2x1bW5JbmRleE9yVGhyb3coImQiKTsKLSAgICAgICAgaW50IHNDb2wgPSBjLmdldENvbHVtbkluZGV4T3JUaHJvdygicyIpOwotICAgICAgICAKLSAgICAgICAgaW50IGNvdW50ID0gMDsKLSAgICAgICAgd2hpbGUgKGMubW92ZVRvTmV4dCgpKSB7Ci0gICAgICAgICAgICBhc3NlcnRUcnVlKGMudXBkYXRlSW50KGRDb2wsIDMpKTsKLSAgICAgICAgICAgIGNvdW50Kys7Ci0gICAgICAgIH0KLSAgICAgICAgYXNzZXJ0RXF1YWxzKDEwLCBjb3VudCk7Ci0gICAgICAgIAotICAgICAgICBhc3NlcnRUcnVlKGMuY29tbWl0VXBkYXRlcygpKTsKLSAgICAgICAgCi0gICAgICAgIGFzc2VydFRydWUoYy5yZXF1ZXJ5KCkpOwotICAgICAgICAKLSAgICAgICAgY291bnQgPSAwOwotICAgICAgICB3aGlsZSAoYy5tb3ZlVG9OZXh0KCkpIHsKLSAgICAgICAgICAgIGFzc2VydEVxdWFscygzLCBjLmdldEludChkQ29sKSk7Ci0gICAgICAgICAgICBjb3VudCsrOwotICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICBhc3NlcnRFcXVhbHMoMTAsIGNvdW50KTsKLSAgICAgICAgYXNzZXJ0VHJ1ZShjLm1vdmVUb0ZpcnN0KCkpOwotICAgICAgICBhc3NlcnRUcnVlKGMuZGVsZXRlUm93KCkpOwotICAgICAgICBhc3NlcnRFcXVhbHMoOSwgYy5nZXRDb3VudCgpKTsKLSAgICAgICAgYy5jbG9zZSgpOwotICAgIH0KLSAgICA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hZGQoaSwgYyk7CisgICAgICAgIH0KKworICAgICAgICBhc3NlcnRFcXVhbHMoMCwgc3RtdE9ianMuZ2V0KDApLmdldFVuaXF1ZUlkKCkpOworICAgICAgICBmb3IgKGludCBpID0gMTsgaSA8IE4rMTsgaSsrKSB7CisgICAgICAgICAgICBhc3NlcnRUcnVlKHN0bXRPYmpzLmdldChpKS5nZXRVbmlxdWVJZCgpID4gMCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAU21hbGxUZXN0CisgICAgcHVibGljIHZvaWQgdGVzdFNldE1heENhaGVzaXplKCkgeworICAgICAgICBtRGF0YWJhc2UuZXhlY1NRTCgiQ1JFQVRFIFRBQkxFIHRlc3QgKGkgaW50LCBqIGludCk7Iik7CisgICAgICAgIG1EYXRhYmFzZS5leGVjU1FMKCJpbnNlcnQgaW50byB0ZXN0IHZhbHVlcygxLDEpOyIpOworICAgICAgICAvLyBzZXQgY2FjaGUgc2l6ZQorICAgICAgICBpbnQgTiA9IFNRTGl0ZURhdGFiYXNlLk1BWF9TUUxfQ0FDSEVfU0laRTsKKyAgICAgICAgbURhdGFiYXNlLnNldE1heFNxbENhY2hlU2l6ZShOKTsKKworICAgICAgICAvLyB0cnkgcmVkdWNlIGNhY2hlc2l6ZQorICAgICAgICB0cnkgeworICAgICAgICAgICAgbURhdGFiYXNlLnNldE1heFNxbENhY2hlU2l6ZSgxKTsKKyAgICAgICAgfSBjYXRjaCAoSWxsZWdhbFN0YXRlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIGFzc2VydFRydWUoZS5nZXRNZXNzYWdlKCkuY29udGFpbnMoImNhbm5vdCBzZXQgY2FjaGVTaXplIHRvIGEgdmFsdWUgbGVzcyB0aGFuIikpOworICAgICAgICB9CisgICAgfQorCisgICAgQExhcmdlVGVzdAorICAgIHB1YmxpYyB2b2lkIHRlc3REZWZhdWx0RGF0YWJhc2VFcnJvckhhbmRsZXIoKSB7CisgICAgICAgIERlZmF1bHREYXRhYmFzZUVycm9ySGFuZGxlciBlcnJvckhhbmRsZXIgPSBuZXcgRGVmYXVsdERhdGFiYXNlRXJyb3JIYW5kbGVyKCk7CisKKyAgICAgICAgLy8gY2xvc2UgdGhlIGRhdGFiYXNlLiBhbmQgY2FsbCBjb3JydXB0aW9uIGhhbmRsZXIuCisgICAgICAgIC8vIGl0IHNob3VsZCBkZWxldGUgdGhlIGRhdGFiYXNlIGZpbGUuCisgICAgICAgIEZpbGUgZGJmaWxlID0gbmV3IEZpbGUobURhdGFiYXNlLmdldFBhdGgoKSk7CisgICAgICAgIG1EYXRhYmFzZS5jbG9zZSgpOworICAgICAgICBhc3NlcnRGYWxzZShtRGF0YWJhc2UuaXNPcGVuKCkpOworICAgICAgICBhc3NlcnRUcnVlKGRiZmlsZS5leGlzdHMoKSk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBlcnJvckhhbmRsZXIub25Db3JydXB0aW9uKG1EYXRhYmFzZSk7CisgICAgICAgICAgICBhc3NlcnRGYWxzZShkYmZpbGUuZXhpc3RzKCkpOworICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgZmFpbCgidW5leHBlY3RlZCIpOworICAgICAgICB9CisKKyAgICAgICAgLy8gY3JlYXRlIGFuIGluLW1lbW9yeSBkYXRhYmFzZS4gYW5kIGNvcnJ1cHRpb24gaGFuZGxlciBzaG91bGRuJ3QgdHJ5IHRvIGRlbGV0ZSBpdAorICAgICAgICBTUUxpdGVEYXRhYmFzZSBtZW1vcnlEYiA9IFNRTGl0ZURhdGFiYXNlLm9wZW5PckNyZWF0ZURhdGFiYXNlKCI6bWVtb3J5OiIsIG51bGwpOworICAgICAgICBhc3NlcnROb3ROdWxsKG1lbW9yeURiKTsKKyAgICAgICAgbWVtb3J5RGIuY2xvc2UoKTsKKyAgICAgICAgYXNzZXJ0RmFsc2UobWVtb3J5RGIuaXNPcGVuKCkpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgZXJyb3JIYW5kbGV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YXNzZXJ0VHJ1ZShkYk9iai5pc09wZW4oKSk7CisgICAgICAgIGF0dGFjaGVkRGJzID0gZGJPYmouZ2V0QXR0YWNoZWREYnMoKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGVycm9ySGFuZGxlci5vbkNvcnJ1cHRpb24oZGJPYmopOworICAgICAgICAgICAgYXNzZXJ0RmFsc2UoZGJmaWxlLmV4aXN0cygpKTsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgTjsgaSsrKSB7CisgICAgICAgICAgICAgICAgYXNzZXJ0RmFsc2UobmV3IEZpbGUoYXR0YWNoZWREYkZpbGVzLmdldChpKSkuZXhpc3RzKCkpOworICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgZmFpbCgidW5leHBlY3RlZCIpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogdGVzdCB0byBtYWtlIHN1cmUgdGhlIHN0YXRlbWVudCBmaW5hbGl6YXRpb25zIGFyZSBub3QgZG9uZSByaWdodCBhd2F5IGJ1dAorICAgICAqIHBpZ2d5YmFja2VkIG9udG8gdGhlIG5leHQgc3FsIHN0YXRlbWVudCBleGVjdXRpb24gb24gdGhlIHNhbWUgZGF0YWJhc2UuCisgICAgICovCisgICAgQFNtYWxsVGVzdAorICAgIHB1YmxpYyB2b2lkIHRlc3RTdGF0ZW1lbnRDbG9zZSgpIHsKKyAgICAgICAgbURhdGFiYXNlLmV4ZWNTUUwoIkNSRUFURSBUQUJMRSB0ZXN0IChpIGludCk7Iik7CisgICAgICAgIC8vIGZpbGwgdXAgc3RhdGVtZW50IGNhY2hlIGluIG1EYXRhYmFzZVwKKyAgICAgICAgaW50IE4gPSAyNjsKKyAgICAgICAgbURhdGFiYXNlLnNldE1heFNxbENhY2hlU2l6ZShOKTsKKyAgICAgICAgU1FMaXRlU3RhdGVtZW50IHN0bXQ7CisgICAgICAgIGludCBzdG10MEl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IgKGludCBpID0gMDsgaSA8IE47IGkgKyspIHsKKyAgICAgICAgICAgICAgICAgICAgc3RtdCA9IG1EYXRhYmFzZS5jb21waWxlU3RhdGVtZW50KCJpbnNlcnQgaW50byB0ZXN0IHZhbHVlcygiICsgaSArICIpOyIpOworICAgICAgICAgICAgICAgICAgICBzdG10LmV4ZWN1dGVJbnNlcnQoKTsKKyAgICAgICAgICAgICAgICAgICAgLy8ga2VlcCB0cmFjayBvZiAwdGggZW50cnkKKyAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2V0U3RtdDBJZChzdG10LmdldFVuaXF1ZUlkKCkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHN0bXQuY2xvc2UoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgICAgIHQxLnN0YXJ0KCk7CisgICAgICAgIC8vIHdhaXQgZm9yIHRoZSB0aHJlYWQgdG8gZmluaXNoCisgICAgICAgIHQxLmpvaW4oKTsKKworICAgICAgICAvLyBhZGQgb25lIG1vcmUgdG8gdGhlIGNhY2hlIC0gYW5kIHRoZSBhYm92ZSAnc3RtdDBJZCcgc2hvdWxkIGZhbGwgb3V0IG9mIGNhY2hlCisgICAgICAgIC8vIGp1c3QgZm9yIHRoZSBoZWNrIG9mIGl0LCBkbyBpdCBpbiBhIHNlcGFyYXRlIHRocmVhZAorICAgICAgICBUaHJlYWQgdDIgPSBuZXcgVGhyZWFkKCkgeworICAgICAgICAgICAgQE92ZXJyaWRlIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICBTUUxpdGVTdGF0ZW1lbnQgc3RtdDEgPSBtRGF0YWJhc2UuY29tcGlsZVN0YXRlbWVudCgKKyAgICAgICAgICAgICAgICAgICAgICAgICJzZWxlY3QgKiBmcm9tIHRlc3Qgd2hlcmUgaSA9IDE7Iik7CisgICAgICAg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9yIChpbnQgaSA9IDA7IGkgPCBOOyBpICsrKSB7CisgICAgICAgICAgICAgICAgICAgIHN0bXQgPSBtRGF0YWJhc2UuY29tcGlsZVN0YXRlbWVudCgiaW5zZXJ0IGludG8gdGVzdCB2YWx1ZXMoIiArIGkgKyAiKTsiKTsKKyAgICAgICAgICAgICAgICAgICAgc3RtdC5leGVjdXRlSW5zZXJ0KCk7CisgICAgICAgICAgICAgICAgICAgIC8vIGtlZXAgdHJhY2sgb2YgMHRoIGVudHJ5CisgICAgICAgICAgICAgICAgICAgIGlmIChpID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNldFN0bXQwSWQoc3RtdC5nZXRVbmlxdWVJZCgpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBzdG10LmNsb3NlKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9OworICAgICAgICB0MS5zdGFydCgpOworICAgICAgICAvLyB3YWl0IGZvciB0aGUgdGhyZWFkIHRvIGZpbmlzaAorICAgICAgICB0MS5qb2luKCk7CisKKyAgICAgICAgLy8gYWRkIG9uZSBtb3JlIHRvIHRoZSBjYWNoZSAtIGFuZCB0aGUgYWJvdmUgJ3N0bXQwSWQnIHNob3VsZCBmYWxsIG91dCBvZiBjYWNoZQorICAgICAgICAvLyBqdXN0IGZvciB0aGUgaGVjayBvZiBpdCwgZG8gaXQgaW4gYSBzZXBhcmF0ZSB0aHJlYWQKKyAgICAgICAgVGhyZWFkIHQyID0gbmV3IFRocmVhZCgpIHsKKyAgICAgICAgICAgIEBPdmVycmlkZSBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgU1FMaXRlU3RhdGVtZW50IHN0bXQxID0gbURhdGFiYXNlLmNvbXBpbGVTdGF0ZW1lbnQoCisgICAgICAgICAgICAgICAgICAgICAgICAic2VsZWN0ICogZnJvbSB0ZXN0IHdoZXJlIGkgPSAxOyIpOworICAgICAgICAgICAgICAgIHN0bXQxLmNsb3NlKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgICAgIHQyLnN0YXJ0KCk7CisgICAgICAgIHQyLmpvaW4oKTsKKworICAgICAgICAvLyBjbG9zZSgpIGluIHRoZSBhYm92ZSB0aHJlYWQgc2hvdWxkIGhhdmUgcXVldWVkVXAgdGhlIHN0YXRlbWVudCBmb3IgZmluYWxpemF0aW9uCisgICAgICAgIEFycmF5TGlzdDxJbnRlZ2VyPiBzdGF0ZW1lbnRJZHMgPSBtRGF0YWJhc2UuZ2V0UXVldWVkVXBTdG10TGlzdCgpOworICAgICAgICBhc3NlcnRUcnVlKGdldFN0bXQwSWQoKSA+IDApOworICAgICAgICBhc3NlcnRUcnVlKHN0YXRlbWVudElkcy5jb250YWlucyhzdG10MElkKSk7CisgICAgICAgIGFzc2VydEVxdWFscygxLCBzdGF0ZW1lbnRJZHMuc2l6ZSgpKTsKKworICAgICAgICAvLyBjbG9zZSB0aGUgZGF0YWJhc2UuIGV2ZXJ5dGhpbmcgZnJvbSBtQ2xvc2VkU3RhdGVtZW50SWRzIGluIG1EYXRhYmFzZQorICAgICAgICAvLyBzaG91bGQgYmUgZmluYWxpemVkIGFuZCBjbGVhcmVkIGZyb20gdGhlIGxpc3QKKyAgICAgICAgLy8gYWdhaW4gZG8gaXQgaW4gYSBzZXBhcmF0ZSB0aHJlYWQKKyAgICAgICAgVGhyZWFkIHQzID0gbmV3IFRocmVhZCgpIHsKKyAgICAgICAgICAgIEBPdmVycmlkZSBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgbURhdGFiYXNlLmNsb3NlKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgICAgIHQzLnN0YXJ0KCk7CisgICAgICAgIHQzLmpvaW4oKTsKKworICAgICAgICAvLyBjaGVjayBtQ2xvc2VkU3RhdGVtZW50SWRzIGluIG1EYXRhYmFzZS4gaXQgc2hvdWxkIGJlIGVtcHR5CisgIC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ChpIGludCwgaiBpbnQpOyIpOworICAgICAgICAgICAgbURhdGFiYXNlLmV4ZWNTUUwoIkNSRUFURSBUQUJMRSB0MiAoaSBpbnQsIGogaW50KTsiKTsKKyAgICAgICAgICAgIG1EYXRhYmFzZS5iZWdpblRyYW5zYWN0aW9uKCk7CisgICAgICAgICAgICBmb3IgKGludCBrID0gMDsgayA8IDU7IGsrKykgeworICAgICAgICAgICAgICAgIG1EYXRhYmFzZS5leGVjU1FMKCJpbnNlcnQgaW50byB0MSB2YWx1ZXMoPyw/KTsiLCBuZXcgU3RyaW5nW10ge2srIiIsIGsrIiJ9KTsKKyAgICAgICAgICAgICAgICBtRGF0YWJhc2UuZXhlY1NRTCgiaW5zZXJ0IGludG8gdDIgdmFsdWVzKD8sPyk7IiwgbmV3IFN0cmluZ1tdIHtrKyIiLCBrKyIifSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtRGF0YWJhc2Uuc2V0VHJhbnNhY3Rpb25TdWNjZXNzZnVsKCk7CisgICAgICAgICAgICBtRGF0YWJhc2UuZW5kVHJhbnNhY3Rpb24oKTsKKworICAgICAgICAgICAgLy8gc3RhcnQgYSB3cml0ZXIKKyAgICAgICAgICAgIFdyaXRlciB3ID0gbmV3IFdyaXRlcihtRGF0YWJhc2UpOworCisgICAgICAgICAgICAvLyBpbml0aWFsaXplIGFuIGFycmF5IG9mIGNvdW50ZXJzIHRvIGJlIHBhc3NlZCB0byB0aGUgcmVhZGVycworICAgICAgICAgICAgUmVhZGVyIHIxID0gbmV3IFJlYWRlcihtRGF0YWJhc2UsICJ0MSIsIHcsIDApOworICAgICAgICAgICAgUmVhZGVyIHIyID0gbmV3IFJlYWRlcihtRGF0YWJhc2UsICJ0MiIsIHcsIDEpOworICAgICAgICAgICAgdy5zdGFydCgpOworICAgICAgICAgICAgcjEuc3RhcnQoKTsKKyAgICAgICAgICAgIHIyLnN0YXJ0KCk7CisKKyAgICAgICAgICAgIC8vIHdhaXQgZm9yIGFsbCB0aHJlYWRzIHRvIGRpZQorICAgICAgICAgICAgdy5qb2luKCk7CisgICAgICAgICAgICByMS5qb2luKCk7CisgICAgICAgICAgICByMi5qb2luKCk7CisKKyAgICAgICAgICAgIC8vIHByaW50IHRoZSBzdGF0cworICAgICAgICAgICAgaW50W11bXSBjb3VudHMgPSBnZXRDb3VudHMoKTsKKyAgICAgICAgICAgIGJ1ZmZbaV0gPSBuZXcgU3RyaW5nQnVpbGRlcigpOworICAgICAgICAgICAgYnVmZltpXS5hcHBlbmQoImNvbm5wb29sLXNpemUgPSAiKTsKKyAgICAgICAgICAgIGJ1ZmZbaV0uYXBwZW5kKGkgKyAxKTsKKyAgICAgICAgICAgIGJ1ZmZbaV0uYXBwZW5kKCIsIG51bSB4YWN0cyBieSB3cml0ZXIgPSAiKTsKKyAgICAgICAgICAgIGJ1ZmZbaV0uYXBwZW5kKGdldE51bVhhY3RzKCkpOworICAgICAgICAgICAgYnVmZltpXS5hcHBlbmQoIiwgbnVtLXJlYWRzLWluLXhhY3QvTk9ULWluLXhhY3QgYnkgcmVhZGVyMSA9ICIpOworICAgICAgICAgICAgYnVmZltpXS5hcHBlbmQoY291bnRzWzBdWzFdICsgIi8iICsgY291bnRzWzBdWzBdKTsKKyAgICAgICAgICAgIGJ1ZmZbaV0uYXBwZW5kKCIsIGJ5IHJlYWRlcjIgPSAiKTsKKyAgICAgICAgICAgIGJ1ZmZbaV0uYXBwZW5kKGNvdW50c1sxXVsxXSArICIvIiArIGNvdW50c1sxXVswXSk7CisKKyAgICAgICAgICAgIExvZy5pKFRBRywgImRvbmUgdGVzdGluZyBmb3IgY29ubi1wb29sLXNpemUgb2YgIiArIChpKzEpKTsKKworICAgICAgICAgICAgZGJUZWFyZG93bigpOworICAgICAgICAgICAgZGJTZXRVcCgpOworICAgICAgICB9CisgICAgICAgIExvZy5pKFRBRywgImR1cmF0aW9uIG9mIHRlc3QgIiArIFRJTUVfVE9fUlVOX1dBTF9URVNUX0ZPUiArICIgc2VjIik7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgTTsgaSsrKSB7CisgICAgICAgICAgICBMb2cuaShUQUcsIGJ1ZmZbaV0udG9TdHJpbmcoKSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGJvb2xlYW4gaW5YYWN0ID0gZmFsc2U7CisgICAgcHJpdmF0ZSBpbnQgbnVtWGFjdHM7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IFRJTUVfVE9fUlVOX1dBTF9URVNUX0ZPUiA9IDE1OyAvLyBudW0gc2VjIHRoaXMgdGVzdCBzaG91ZGwgcnVuCisgICAgcHJpdmF0ZSBpbnRbXVtdIGNvdW50cyA9IG5ldyBpbnRbMl1bMl07CisKKyAgICBwcml2YXRlIHN5bmNocm9uaXplZCBib29sZWFuIGluWGFjdCgpIHsKKyAgICAgICAgcmV0dXJuIGluWGFjdDsKKyAgICB9CisKKyAgICBwcml2YXRlIHN5bmNocm9uaXplZCB2b2lkIHNldEluWGFjdEZsYWcoYm9vbGVhbiBmbGFnKSB7CisgICAgICAgIGluWGFjdCA9IGZsYWc7CisgICAgfQorCisgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgdm9pZCBzZXRDb3VudHMoaW50IHJlYWRlck51bSwgaW50W10gbnVtUmVhZHMpIHsKKyAgICAgICAgY291bnRzW3JlYWRlck51bV1bMF0gPSBudW1SZWFkc1swXTsKKyAgICAgICAgY291bnRzW3JlYWRlck51bV1bMV0gPSBudW1SZWFkc1sxXTsKKyAgICB9CisKKyAgICBwcml2YXRlIHN5bmNocm9uaXplZCBpbnRbXVtdIGdldENvdW50cygpIHsKKyAgICAgICAgcmV0dXJuIGNvdW50czsKKyAgICB9CisKKyAgICBwcml2YXRlIHN5bmNocm9uaXplZCB2b2lkIHNldE51bVhhY3RzKGludCBudW0pIHsKKyAgICAgICAgbnVtWGFjdHMgPSBudW07CisgICAgfQorCisgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgaW50IGdldE51bVhhY3RzKCkgeworICAgICAgICByZXR1cm4gbnVtWGFjdHM7CisgICAgfQorCisgICAgcHJpdmF0ZSBjbGFzcyBXcml0ZXIgZXh0ZW5kcyBUaHJlYWQgeworICAgICAgICBwcml2YXRlIFNRTGl0ZURhdGFiYXNlIGRiID0gbnVsbDsKKyAgICAgICAgcHVibGljIFdyaXRlcihTUUxpdGVEYXRhYmFzZSBkYikgeworICAgICAgICAgICAgdGhpcy5kYiA9IGRiOworICAgICAgICB9CisgICAgICAgIEBPdmVycmlkZSBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAvLyBpbiBhIGxvb3AsIGZvciBOIHNlYywgZG8gdGhlIGZvbGxvd2luZworICAgICAgICAgICAgLy8gICAgQkVHSU4gdHJhbnNhY3Rpb24KKyAgICAgICAgICAgIC8vICAgIGluc2VydCBpbnRvIHRhYmxlIHQxLCB0MgorICAgICAgICAgICAgLy8gICAgQ29tbWl0CisgICAgICAgICAgICBsb25nIG5vdyA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOworICAgICAgICAgICAgaW50IGs7CisgICAgICAgICAgICBmb3IgKGsgPSAwOyhTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSAtIG5vdykgLyAxMDAwIDwgVElNRV9UT19SVU5fV0FMX1RFU1RfRk9SOyBrKyspIHsKKyAgICAgICAgICAgICAgICBkYi5iZWdpblRyYW5zYWN0aW9uTm9uRXhjbHVzaXZlKCk7CisgICAgICAgICAgICAgICAgc2V0SW5YYWN0RmxhZyh0cnVlKTsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IDEwOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgZGIuZXhlY1NRTCgiaW5zZXJ0IGludG8gdDEgdmFsdWVzKD8sPyk7IiwgbmV3IFN0cmluZ1tdIHtpKyIiLCBpKyIifSk7CisgICAgICAgICAgICAgICAgICAgIGRiLmV4ZWNTUUwoImluc2VydCBpbnRvIHQyIHZhbHVlcyg/LD8pOyIsIG5ldyBTdHJpbmdbXSB7aSsiIiwgaSsiIn0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBkYi5zZXRUcmFuc2FjdGlvblN1Y2Nlc3NmdWwoKTsKKyAgICAgICAgICAgICAgICBzZXRJblhhY3RGbGFnKGZhbHNlKTsKKyAgICAgICAgICAgICAgICBkYi5lbmRUcmFuc2FjdGlvbigpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc2V0TnVtWGFjdHMoayk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGNsYXNzIFJlYWRlciBleHRlbmRzIFRocmVhZCB7CisgICAgICAgIHByaXZhdGUgU1FMaXRlRGF0YWJhc2UgZGIgPSBudWxsOworICAgICAgICBwcml2YXRlIFN0cmluZyB0YWJsZSA9IG51bGw7CisgICAgICAgIHByaXZhdGUgV3JpdGVyIHcgPSBudWxsOworICAgICAgICBwcml2YXRlIGludCByZWFkZXJOdW07CisgICAgICAgIHByaXZhdGUgaW50W10gbnVtUmVhZHMgPSBuZXcgaW50WzJdOworICAgICAgICBwdWJsaWMgUmVhZGVyKFNRTGl0ZURhdGFiYXNlIGRiLCBTdHJpbmcgdGFibGUsIFdyaXRlciB3LCBpbnQgcmVhZGVyTnVtKSB7CisgICAgICAgICAgICB0aGlzLmRiID0gZGI7CisgICAgICAgICAgICB0aGlzLnRhYmxlID0gdGFibGU7CisgICAgICAgICAgICB0aGlzLncgPSB3OworICAgICAgICAgICAgdGhpcy5yZWFkZXJOdW0gPSByZWFkZXJOdW07CisgICAgICAgIH0KKyAgICAgICAgQE92ZXJyaWRlIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgIC8vIHdoaWxlIHRoZSB3cml0ZSBpcyBhbGl2ZSwgaW4gYSBsb29wIGRvIHRoZSBxdWVyeSBvbiBhIHRhYmxlCisgICAgICAgICAgICB3aGlsZSAody5pc0FsaXZlKCkpIHsKKyAgICA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5nZXRMaXN0KCkpOwotICAgIH0KLQotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyBDdXJzb3IgcXVlcnkoVXJpIHVyaSxTdHJpbmdbXSBwcm9qZWN0aW9uLAotICAgICAgICAgICAgU3RyaW5nIHNlbGVjdGlvbiwgU3RyaW5nW10gc2VsZWN0aW9uQXJncywgU3RyaW5nIHNvcnRPcmRlcikgewotICAgICAgICBtVGVzdENhc2UuYXNzZXJ0VHJ1ZShWQ2FyZENvbXBvc2VyLkNPTlRBQ1RTX1RFU1RfQ09OVEVOVF9VUkkuZXF1YWxzKHVyaSkpOwotICAgICAgICAvLyBJbiB0aGlzIHRlc3QsIGZvbGxvd2luZyBhcmd1bWVudHMgYXJlIG5vdCBzdXBwb3J0ZWQuCi0gICAgICAgIG1UZXN0Q2FzZS5hc3NlcnROdWxsKHNlbGVjdGlvbik7Ci0gICAgICAgIG1UZXN0Q2FzZS5hc3NlcnROdWxsKHNlbGVjdGlvbkFyZ3MpOwotICAgICAgICBtVGVzdENhc2UuYXNzZXJ0TnVsbChzb3J0T3JkZXIpOwotCi0gICAgICAgIHJldHVybiBuZXcgTW9ja0N1cnNvcigpIHsKLSAgICAgICAgICAgIGludCBtQ3VycmVudFBvc2l0aW9uID0gLTE7Ci0KLSAgICAgICAgICAgIEBPdmVycmlkZQotICAgICAgICAgICAgcHVibGljIGludCBnZXRDb3VudCgpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gbUNvbnRhY3RFbnRyeUxpc3Quc2l6ZSgpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgICAgIHB1YmxpYyBib29sZWFuIG1vdmVUb0ZpcnN0KCkgewotICAgICAgICAgICAgICAgIG1DdXJyZW50UG9zaXRpb24gPSAwOwotICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgICAgIHB1YmxpYyBib29sZWFuIG1vdmVUb05leHQoKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1DdXJyZW50UG9zaXRpb24gPCBtQ29udGFjdEVudHJ5TGlzdC5zaXplKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgbUN1cnJlbnRQb3NpdGlvbisrOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgICAgIHB1YmxpYyBib29sZWFuIGlzQmVmb3JlRmlyc3QoKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIG1DdXJyZW50UG9zaXRpb24gPCAwOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgICAgIHB1YmxpYyBib29sZWFuIGlzQWZ0ZXJMYXN0KCkgewotICAgICAgICAgICAgICAgIHJldHVybiBtQ3VycmVudFBvc2l0aW9uID49IG1Db250YWN0RW50cnlMaXN0LnNpemUoKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgICAgICBwdWJsaWMgaW50IGdldENvbHVtbkluZGV4KFN0cmluZyBjb2x1bW5OYW1lKSB7Ci0gICAgICAgICAgICAgICAgbVRlc3RDYXNlLmFzc2VydEVxdWFscyhDb250YWN0cy5fSUQsIGNvbHVtbk5hbWUpOwotICAgICAgICAgICAgICAgIHJldHVybiAwOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgICAgIHB1YmxpYyBpbnQgZ2V0SW50KGludCBjb2x1bW5JbmRleCkgewotICAgICAgICAgICAgICAgIG1UZXN0Q2FzZS5hc3NlcnRFcXVhbHMoMCwgY29sdW1uSW5kZXgpOwotICAgICAgICA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dWVTZXQoKSkgewotICAgICAgICAgICAgICAgICAgICBPYmplY3QgdmFsdWUgPSBlbnRyeS5nZXRWYWx1ZSgpOwotICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgPT0gbnVsbCB8fCBUZXh0VXRpbHMuaXNFbXB0eSh2YWx1ZS50b1N0cmluZygpKSkgewotICAgICAgICAgICAgICAgICAgICAgICAga2V5VG9CZVJlbW92ZWQuYWRkKGVudHJ5LmdldEtleSgpKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBmb3IgKFN0cmluZyBrZXk6IGtleVRvQmVSZW1vdmVkKSB7Ci0gICAgICAgICAgICAgICAgICAgIGFjdHVhbENvbnRlbnRWYWx1ZXMucmVtb3ZlKGtleSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8qIGZvciB0ZXN0aW5nCi0gICAgICAgICAgICAgICAgTG9nLmQoIkBAQCIsCi0gICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcuZm9ybWF0KCJNaW1lVHlwZTogJXMsIGRhdGE6ICVzIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWltZVR5cGUsIGFjdHVhbENvbnRlbnRWYWx1ZXMudG9TdHJpbmcoKSkpOyAqLwotICAgICAgICAgICAgICAgIC8vIFJlbW92ZSBSQVdfQ09OVEFDVF9JRCBlbnRyeSBqdXN0IGZvciBzYWZldHksIHNpbmNlIHdlIGRvIG5vdCBjYXJlCi0gICAgICAgICAgICAgICAgLy8gaG93IHJlc29sdmVyLXJlbGF0ZWQgY29kZSBoYW5kbGVzIHRoZSBlbnRyeSBpbiB0aGlzIHVuaXQgdGVzdCwKLSAgICAgICAgICAgICAgICBpZiAoYWN0dWFsQ29udGVudFZhbHVlcy5jb250YWluc0tleShEYXRhLlJBV19DT05UQUNUX0lEKSkgewotICAgICAgICAgICAgICAgICAgICBhY3R1YWxDb250ZW50VmFsdWVzLnJlbW92ZShEYXRhLlJBV19DT05UQUNUX0lEKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZmluYWwgQ29sbGVjdGlvbjxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzQ29sbGVjdGlvbiA9Ci0gICAgICAgICAgICAgICAgICAgIG1NaW1lVHlwZVRvRXhwZWN0ZWRDb250ZW50VmFsdWVzLmdldChtaW1lVHlwZSk7Ci0gICAgICAgICAgICAgICAgaWYgKGNvbnRlbnRWYWx1ZXNDb2xsZWN0aW9uLmlzRW1wdHkoKSkgewotICAgICAgICAgICAgICAgICAgICBtVGVzdENhc2UuZmFpbCgiQ29udGVudFZhbHVlcyBmb3IgTWltZVR5cGUgIiArIG1pbWVUeXBlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGlzIG5vdCBleHBlY3RlZCBhdCBhbGwgKCIgKyBhY3R1YWxDb250ZW50VmFsdWVzICsgIikiKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYm9vbGVhbiBjaGVja2VkID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgZm9yIChDb250ZW50VmFsdWVzIGV4cGVjdGVkQ29udGVudFZhbHVlcyA6IGNvbnRlbnRWYWx1ZXNDb2xsZWN0aW9uKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8qZm9yIHRlc3RpbmcKLSAgICAgICAgICAgICAgICAgICAgTG9nLmQoIkBAQCIsICJleHBlY3RlZDogIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgY29udmVydFRvRWFzaWx5UmVhZGFibGVTdHJpbmcoZXhwZWN0ZWRDb250ZW50VmFsdWVzKSk7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5kKCJAQEAiLCAiYWN0dWFsICA6ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGNvbnZlcnRUb0Vhc2lseVJlYWRhYmxlU3RyaW5nKGFjdHVhbENvbnRlbnRWYWx1ZXMpKTsqLwotICAgICAgICAgICAgICAgICAgICBpZiAoZXF1YWxzRm9yQ29udGVudFZhbHVlcyhleHBlY3RlZENvbnRlbnRWYWx1ZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0dWFsQ29udGVudFZhbHVlcykpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1UZXN0Q2FzZS5hc3NlcnRUcnVlKGNvbnRlbnRWYWx1ZXNDb2xsZWN0aW9uLnJlbW92ZShleHBlY3RlZENvbnRlbnRWYWx1ZXMpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrZWQgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKCFjaGVja2VkKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCJVbmV4cGVjdGVkOiAiKTsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoY29udmVydFRvRWFzaWx5UmVhZGFibGVTdHJpbmcoYWN0dWFsQ29udGVudFZhbHVlcykpOwotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiXG5FeHBlY3RlZDogIik7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoQ29udGVudFZhbHVlcyBleHBlY3RlZENvbnRlbnRWYWx1ZXMgOiBjb250ZW50VmFsdWVzQ29sbGVjdGlvbikgewotICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoY29udmVydFRvRWFzaWx5UmVhZGFibGVTdHJpbmcoZXhwZWN0ZWRDb250ZW50VmFsdWVzKSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgbVRlc3RDYXNlLmZhaWwoYnVpbGRlci50b1N0cmluZygpKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIG1UZXN0Q2FzZS5mYWlsKCJVbmV4cGVjdGVkIFVyaSBoYXMgY29tZTogIiArIHVyaSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gIC8vIGZvciAoaW50IGkgPSAwOyBpIDwgc2l6ZTsgaSsrKSB7Ci0gICAgICAgIHJldHVybiBmYWtlUmVzdWx0QXJyYXk7Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgdmVyaWZ5KCkgewotICAgICAgICBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICBmb3IgKENvbGxlY3Rpb248Q29udGVudFZhbHVlcz4gY29udGVudFZhbHVlc0NvbGxlY3Rpb24gOgotICAgICAgICAgICAgICAgIG1NaW1lVHlwZVRvRXhwZWN0ZWRDb250ZW50VmFsdWVzLnZhbHVlcygpKSB7Ci0gICAgICAgICAgICBmb3IgKENvbnRlbnRWYWx1ZXMgZXhwZWN0ZWRDb250ZW50VmFsdWVzOiBjb250ZW50VmFsdWVzQ29sbGVjdGlvbikgewotICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGNvbnZlcnRUb0Vhc2lseVJlYWRhYmxlU3RyaW5nKGV4cGVjdGVkQ29udGVudFZhbHVlcykpOwotICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCJcbiIpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGlmIChidWlsZGVyLmxlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGZhaWxNc2cgPQotICAgICAgICAgICAgICAgICJUaGVyZSBpcyhhcmUpIHJlbWFpbmluZyBleHBlY3RlZCBDb250ZW50VmFsdWVzIGluc3RhbmNlKHMpO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AgICAgICBmaW5hbCBpbnQgbGVuZ3RoID0gbGluZUFycmF5Lmxlbmd0aDsKLSAgICAgICAgYm9vbGVhbiBiZWdpbkV4aXN0cyA9IGZhbHNlOwotICAgICAgICBib29sZWFuIGVuZEV4aXN0cyA9IGZhbHNlOwotICAgICAgICBib29sZWFuIHZlcnNpb25FeGlzdHMgPSBmYWxzZTsKLQotICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgbGluZSA9IGxpbmVBcnJheVtpXTsKLSAgICAgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eShsaW5lKSkgewotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoIkJFR0lOOlZDQVJEIi5lcXVhbHNJZ25vcmVDYXNlKGxpbmUpKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGJlZ2luRXhpc3RzKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1UZXN0Q2FzZS5mYWlsKCJNdWx0aXBsZSBcIkJFR0lOOlZDQVJEXCIgbGluZSBmb3VuZCIpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGJlZ2luRXhpc3RzID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIGlmICgiRU5EOlZDQVJEIi5lcXVhbHNJZ25vcmVDYXNlKGxpbmUpKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGVuZEV4aXN0cykgewotICAgICAgICAgICAgICAgICAgICBtVGVzdENhc2UuZmFpbCgiTXVsdGlwbGUgXCJFTkQ6VkNBUkRcIiBsaW5lIGZvdW5kIik7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgZW5kRXhpc3RzID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIGlmICgobUlzVjMwID8gIlZFUlNJT046My4wIiA6ICJWRVJTSU9OOjIuMSIpLmVxdWFsc0lnbm9yZUNhc2UobGluZSkpIHsKLSAgICAgICAgICAgICAgICBpZiAodmVyc2lvbkV4aXN0cykgewotICAgICAgICAgICAgICAgICAgICBtVGVzdENhc2UuZmFpbCgiTXVsdGlwbGUgVkVSU0lPTiBsaW5lICsgZm91bmQiKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICB2ZXJzaW9uRXhpc3RzID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoIWJlZ2luRXhpc3RzKSB7Ci0gICAgICAgICAgICAgICAgbVRlc3RDYXNlLmZhaWwoIlByb3BlcnR5IG90aGVyIHRoYW4gQkVHSU4gY2FtZSBiZWZvcmUgQkVHSU4gcHJvcGVydHk6ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICsgbGluZSk7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGVuZEV4aXN0cykgewotICAgICAgICAgICAgICAgIG1UZXN0Q2FzZS5mYWlsKCJQcm9wZXJ0eSBvdGhlciB0aGFuIEVORCBjYW1lIGFmdGVyIEVORCBwcm9wZXJ0eTogIgotICAgICAgICAgICAgICAgICAgICAgICAgKyBsaW5lKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgZmluYWwgaW50IGluZGV4ID0gbUV4cGVjdGVkTGluZUxpc3QuaW5kZXhPZihsaW5lKTsKLSAgICAgICAgICAgIGlmIChpbmRleCA+PSAwKSB7Ci0gICAgICAgICAgICAgICAgbUV4cGVjdGVkTGluZUxpc3QucmVtb3ZlKGluZGV4KTsKLSAgICAgICAgICAgIH0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AgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIiwgIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgnIicpOwotICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoZWxlbSk7Ci0gICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgnIicpOwotICAgICAgICB9Ci0gICAgICAgIGJ1aWxkZXIuYXBwZW5kKCJdIik7Ci0gICAgICAgIGlmICghcHJvcEdyb3VwU2V0LmlzRW1wdHkoKSkgewotICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIiwgcHJvcEdyb3VwU2V0OiBbIik7Ci0gICAgICAgICAgICBmaXJzdCA9IHRydWU7Ci0gICAgICAgICAgICBmb3IgKFN0cmluZyBlbGVtIDogcHJvcEdyb3VwU2V0KSB7Ci0gICAgICAgICAgICAgICAgaWYgKGZpcnN0KSB7Ci0gICAgICAgICAgICAgICAgICAgIGZpcnN0ID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIiwgIik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCciJyk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoZWxlbSk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoJyInKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCJdIik7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKHByb3BWYWx1ZV92ZWN0b3IgIT0gbnVsbCAmJiBwcm9wVmFsdWVfdmVjdG9yLnNpemUoKSA+IDEpIHsKLSAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIsIHByb3BWYWx1ZV92ZWN0b3Igc2l6ZTogIik7Ci0gICAgICA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AgICBMaXN0PFByb3BlcnR5Tm9kZT4gZXhwZWN0ZWRCdXREaWZmZXJlbnRWYWx1ZUxpc3QgPSBuZXcgQXJyYXlMaXN0PFByb3BlcnR5Tm9kZT4oKTsKLSAgICAgICAgICAgICAgICBpZiAoZXhwZWN0ZWROb2RlLnByb3BOYW1lLmVxdWFscyhwcm9wTmFtZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGV4cGVjdGVkTm9kZS5lcXVhbHMoYWN0dWFsTm9kZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGV4cGVjdGVkTm9kZUxpc3QucmVtb3ZlKGkpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV4cGVjdGVkTm9kZUxpc3Quc2l6ZSgpID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtT3JkZXJlZE5vZGVNYXAucmVtb3ZlKHByb3BOYW1lKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGV4cGVjdGVkQnV0RGlmZmVyZW50VmFsdWVMaXN0LmFkZChleHBlY3RlZE5vZGUpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLy8gImFjdHVhbE5vZGUiIGlzIG5vdCBpbiBvcmRlcmVkIGV4cGVjdGVkIGxpc3QuCi0gICAgICAgICAgICAgICAgLy8gVHJ5IGxvb2tpbmcgb3ZlciB1bm9yZGVyZWQgZXhwZWN0ZWQgbGlzdC4KLSAgICAgICAgICAgICAgICBpZiAodHJ5Rm91bmRFeHBlY3RlZE5vZGVGcm9tVW5vcmRlcmVkTGlzdChhY3R1YWxOb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgZXhwZWN0ZWRCdXREaWZmZXJlbnRWYWx1ZUxpc3QpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoIWV4cGVjdGVkQnV0RGlmZmVyZW50VmFsdWVMaXN0LmlzRW1wdHkoKSkgewotICAgICAgICAgICAgICAgICAgICAvLyBTYW1lIHByb3BOYW1lIGV4aXN0cyBidXQgd2l0aCBkaWZmZXJlbnQgdmFsdWUocykuCi0gICAgICAgICAgICAgICAgICAgIGZhaWxXaXRoRXhwZWN0ZWROb2RlTGlzdChwcm9wTmFtZSwgYWN0dWFsTm9kZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHBlY3RlZEJ1dERpZmZlcmVudFZhbHVlTGlzdCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gVGhlcmUncyBubyBleHBlY3RlZCBub2RlIHdpdGggc2FtZSBwcm9wTmFtZS4KLSAgICAgICAgICAgICAgICAgICAgbVRlc3RDYXNlLmZhaWwoIlVuZXhwZWN0ZWQgcHJvcGVydHkgXCIiICsgcHJvcE5hbWUgKyAiXCIgZXhpc3RzLiIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIExpc3Q8UHJvcGVydHlOb2RlPiBleHBlY3RlZEJ1dERpZmZlcmVudFZhbHVlTGlzdCA9Ci0gICAgICAgICAgICAgICAgbmV3IEFycmF5TGlzdDxQcm9wZXJ0eU5vZGU+KCk7Ci0gICAgICAgICAgICBpZiAodHJ5Rm91bmRFeHBlY3RlZE5vZGVGcm9tVW5vcmRlcmVkTGlzdChhY3R1YWxOb2RlLCBleHBlY3RlZEJ1dERpZmZlcmVudFZhbHVlTGlzdCkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGlmICghZXhwZWN0ZWRCdXREaWZmZXJlbnRWYWx1ZUxpc3QuaXNFbXB0eSgpKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIFNhbWUgcHJvcE5hbWUgZXhpc3RzIGJ1dCB3aXRoIGRpZmZlcmVudCB2YWx1ZShzKS4KLSAgICAgICAgICAgICAgICAgICAgZmFpbFdpdGhFeHBlY3RlZE5vZGVMaXN0KHByb3BOYW1lLCBhY3R1YWxOb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4cGVjdGVkQnV0RGlmZmVyZW50VmFsdWVMaXN0KTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAvLyBUaGVyZSdzIG5vIGV4cGVjdGVkIG5vZGUgd2l0aCBzYW1lIHByb3BOYW1lLgotICAgICAgICAgICAgICAgICAgICBtVGVzdENhc2UuZmFpbCgiVW5leHBlY3RlZCBwcm9wZXJ0eSBcIiIgKyBwcm9wTmFtZSArICJcIiBleGlzdHMuIik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcHJpdmF0ZSBTdHJpbmcgY29uY2F0aW5hdGVMaXN0V2l0aFNlbWlDb2xvbihMaXN0PFN0cmluZz4gYXJyYXkpIHsKLSAgICAgICAgU3RyaW5nQnVmZmVyIGJ1ZmZlciA9IG5ldyBTdHJpbmdCdWZmZXIoKTsKLSAgICAgICAgYm9vbGVhbiBmaXJzdCA9IHRydWU7Ci0gICAgICAgIGZvciAoU3RyaW5nIHByb3BWYWx1ZUVsZW0gOiBhcnJheSkgewotICAgICAgICAgICAgaWYgKGZpcnN0KSB7Ci0gICAgICAgICAgICAgICAgZmlyc3QgPSBmYWxzZTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgYnVmZmVyLmFwcGVuZCgnOycpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnVmZmVyLmFwcGVuZChwcm9wVmFsdWVFbGVtKTsKLSAgICA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90RW1pdFN1ZmZpeDIiKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZE5hbWUuUEhPTkVUSUNfRkFNSUxZX05BTUUsICJEb05vdEVtaXRQaG9uZXRpY0ZhbWlseTIiKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZE5hbWUuUEhPTkVUSUNfR0lWRU5fTkFNRSwgIkRvTm90RW1pdFBob25ldGljR2l2ZW4yIikKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWROYW1lLlBIT05FVElDX01JRERMRV9OQU1FLCAiRG9Ob3RFbWl0UGhvbmV0aWNNaWRkbGUyIikKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWROYW1lLklTX1BSSU1BUlksIDEpOwotCi0gICAgICAgIC8vIFdpdGggIklTX1NVUEVSX1BSSU1BUlk9MSIuIFRoaXMgaXMgd2hhdCB3ZSBzaG91bGQgdXNlLgotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFN0cnVjdHVyZWROYW1lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZE5hbWUuRkFNSUxZX05BTUUsICJBcHByb3ByaWF0ZUZhbWlseU5hbWUiKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZE5hbWUuR0lWRU5fTkFNRSwgIkFwcHJvcHJpYXRlR2l2ZW5OYW1lIikKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWROYW1lLk1JRERMRV9OQU1FLCAiQXBwcm9wcmlhdGVNaWRkbGVOYW1lIikKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWROYW1lLlBSRUZJWCwgIkFwcHJvcHJpYXRlUHJlZml4IikKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWROYW1lLlNVRkZJWCwgIkFwcHJvcHJpYXRlU3VmZml4IikKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjd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AgICBDb250YWN0RW50cnkgZW50cnkgPSBtVmVyaWZpZXIuYWRkSW5wdXRFbnRyeSgpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiMTAiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9IT01FKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjIwIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfV09SSyk7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIzMCIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX0ZBWF9IT01FKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjQwIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfRkFYX1dPUkspOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiNTAiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9NT0JJTEUpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiNjAiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9QQUdFUik7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICI3MCIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX09USEVSKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjgwIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfQ0FSKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjkwIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfQ09NUEFOWV9NQUlOKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjEwMCIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX0lTRE4pOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiMTEwIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfTUFJTik7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIxMjAiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9PVEhFUl9GQVgpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiMTMwIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfVEVMRVgpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiMTQwIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfV09SS19NT0JJTEUpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiMTUwIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfV09SS19QQUdFUik7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIxNjAiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9NTVMpOwotCi0gICAgICAgIG1WZXJpZmllci5hZGRQcm9wZXJ0eU5vZGVzVmVyaWZpZXJFbGVtV2l0aEVtcHR5TmFtZSgpCi0g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ICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiMSIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX0hPTUUpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiMiIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX1dPUkspCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5JU19QUklNQVJZLCAxKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjMiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9GQVhfSE9NRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLklTX1BSSU1BUlksIDEpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiNCIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX0ZBWF9XT1JLKTsKLQotICAgICAgICBtVmVyaWZpZXIuYWRkUHJvcGVydHlOb2Rlc1ZlcmlmaWVyRWxlbVdpdGhFbXB0eU5hbWUoKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGUoIlRFTCIsICI0IiwgbmV3IFR5cGVTZXQoIldPUksiLCAiRkFYIikpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZSgiVEVMIiwgIjMiLCBuZXcgVHlwZVNldCgiSE9NRSIsICJGQVgiLCAiUFJ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dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX0NVU1RPTSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLkxBQkVMLCAiTVNHIik7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIzIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfQ1VTVE9NKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTEFCRUwsICJCQlMiKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjQiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9DVVNUT00pCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5MQUJFTCwgIlZJREVPIik7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICI1IikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfQ1VTVE9NKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjYiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9DVVNUT00pCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5MQUJFTCwgIl9BVVRPX0NFTEwiKTsgIC8vIFRoZSBvbGQgaW5kaWNhdG9yIGZvciB0aGUgdHlwZS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0KEltLlBST1RPQ09MLCBJbS5QUk9UT0NPTF9NU04pCi0gICAgICAgICAgICAgICAgLnB1dChJbS5EQVRBLCAibXNuIik7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoSW0uQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChJbS5QUk9UT0NPTCwgSW0uUFJPVE9DT0xfWUFIT08pCi0gICAgICAgICAgICAgICAgLnB1dChJbS5EQVRBLCAieWFob28iKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhJbS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KEltLlBST1RPQ09MLCBJbS5QUk9UT0NPTF9TS1lQRSkKLSAgICAgICAgICAgICAgICAucHV0KEltLkRBVEEsICJza3lwZSIpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKEltLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoSW0uUFJPVE9DT0wsIEltLlBST1RPQ09MX1FRKQotICAgICAgICAgICAgICAgIC5wdXQoSW0uREFUQSwgInFxIik7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoSW0uQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChJbS5QUk9UT0NPTCwgSW0uUFJPVE9DT0xfR09PR0xFX1RBTEspCi0gICAgICAgICAgICAgICAgLnB1dChJbS5EQVRBLCAiZ29vZ2xlIHRhbGsiKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhJbS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KEltLlBST1RPQ09MLCBJbS5QUk9UT0NPTF9JQ1EpCi0gICAgICAgICAgICAgICAgLnB1dChJbS5EQVRBLCAiaWNxIik7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoSW0uQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChJbS5QUk9UT0NPTCwgSW0uUFJPVE9DT0xfSkFCQkVSKQotICAgICAgICAgICAgICAgIC5wdXQoSW0uREFUQSwgImphYmJlciIpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKEltLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoSW0uUFJPVE9DT0wsIEltLlBST1RPQ09MX05FVE1FRVRJTkcpCi0gICAgICAgICAgICAgICAgLnB1dChJbS5EQVRBLCAibmV0bWVldGluZyIpOwotCi0gICAgICAgIC8vIE5vIGRldGVybWluZWQgd2F5IHRvIGV4cHJlc3MgdW5rbm93biB0eXBlLi4uCi0gICAgICAgIG1WZXJpZmllci5hZGRQcm9wZXJ0eU5vZGVzVmVyaWZpZXJFbGVtV2l0aEVtcHR5TmFtZSgpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZSgiWC1KQUJCRVIiLCAiamFiYmVyIikKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlKCJYLUlDUSIsICJpY3EiKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGUoIlgtR09PR0xFLVRBTEsiLCAiZ29vZ2xlIHRhbGsiKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGUoIlgtUVEiLCAicXEiKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGUoIlgtU0tZUEUtVVNFUk5BTUUiLCAic2t5cGUiKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGUoIlgtWUFIT08iLCAieWFob28iKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGUoIlgtTVNOIiwgIm1zbiIpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZSgiWC1ORVRNRUVUSU5HIiwgIm5ldG1lZXRpbmciKQotIC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k9JRC1DVVNUT00iLAotICAgICAgICAgICAgICAgICAgICAgICAgZ2V0QW5kcm9pZFByb3BWYWx1ZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRXZlbnQuQ09OVEVOVF9JVEVNX1RZUEUsICIyMDE4LTAzLTEyIiwgRXZlbnQuVFlQRV9PVEhFUikpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZSgiWC1BTkRST0lELUNVU1RPTSIsCi0gICAgICAgICAgICAgICAgICAgICAgICBnZXRBbmRyb2lkUHJvcFZhbHVlKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFdmVudC5DT05URU5UX0lURU1fVFlQRSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIldoZW4gdGhlIFRvd2VyIG9mIEhhbm9pIHdpdGggNjQgcmluZ3MgaXMgY29tcGxldGVkLiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV2ZW50LlRZUEVfQ1VTVE9NLCAiVGhlIGxhc3QgZGF5IikpOwotICAgIH0KLQotICAgIHB1YmxpYyB2b2lkIHRlc3RFdmVudFYyMSgpIHsKLSAgICAgICAgdGVzdEV2ZW50Q29tbW9uKFYyMSk7Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgdGVzdEV2ZW50VjMwKCkgewotICAgICAgICB0ZXN0RXZlbnRDb21tb24oVjMwKTsKLSAgICB9Ci0KLSAgICBwcml2YXRlIHZvaWQgdGVzdE5vdGVDb21tb24oaW50IHZjYXJkVHlwZSkgewotICAgICAgICBtVmVyaWZpZXIuaW5pdEZvckV4cG9ydFRlc3QodmNhcmRUeXBlKTsKLSAgICAgICAgQ29udGFjdEVudHJ5IGVudHJ5ID0gbVZlcmlmaWVyLmFkZElucHV0RW50cnkoKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhOb3RlLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoTm90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ICAgICAgIENvbnRlbnRWYWx1ZXNWZXJpZmllckVsZW0gZWxlbSA9IG1WZXJpZmllci5hZGRDb250ZW50VmFsdWVzVmVyaWZpZXJFbGVtKCk7Ci0gICAgICAgIGVsZW0uYWRkRXhwZWN0ZWQoU3RydWN0dXJlZE5hbWUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChEYXRhLk1JTUVUWVBFLCBTdHJ1Y3R1cmVkTmFtZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWROYW1lLkRJU1BMQVlfTkFNRSwgIlNtaXRoIik7Ci0gICAgICAgIGVsZW0uYWRkRXhwZWN0ZWQoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIxIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfSE9NRSk7Ci0gICAgICAgIGVsZW0uYWRkRXhwZWN0ZWQoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIyIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfV09SSykKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLklTX1BSSU1BUlksIDEpOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiMyIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX0lTRE4pOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKEVtYWlsLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoRW1haWwuREFUQSwgInRlc3RAZXhhbXBsZS5jb20iKQotICAgICAgICAgICAgICAgIC5wdXQoRW1haWwuVFlQRSwgRW1haWwuVFlQRV9IT01FKQotICAgICAgICAgICAgICAgIC5wdXQoRW1haWwuSVNfUFJJTUFSWSwgMSk7Ci0gICAgICAgIGVsZW0uYWRkRXhwZWN0ZWQoRW1haWwuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChFbWFpbC5EQVRBLCAidGVzdDJAZXhhbWluYXRpb24uY29tIikKLSAgICAgICAgICAgICAgICAucHV0KEVtYWlsLlRZUEUsIEVtYWlsLlRZUEVfTU9CSUxFKQotICAgICAgICAgICAgICAgIC5wdXQoRW1haWwuSVNfUFJJTUFSWSwgMSk7Ci0gICAgICAgIGVsZW0uYWRkRXhwZWN0ZWQoT3JnYW5pemF0aW9uLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoT3JnYW5pemF0aW9uLkNPTVBBTlksICJDb21wYW55IikKLSAgICAgICAgICAgICAgICAucHV0KE9yZ2FuaXphdGlvbi5USVRMRSwgIkVuZ2luZWVyIikKLSAgICAgICAgICAgICAgICAucHV0KE9yZ2FuaXphdGlvbi5UWVBFLCBPcmdhbml6YXRpb24uVFlQRV9XT1JLKTsKLSAgICAgICAgZWxlbS5hZGRFeHBlY3RlZChPcmdhbml6YXRpb24uQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChPcmdhbml6YXRpb24uQ09NUEFOWSwgIk15c3RlcnkiKQotICAgICAgICAgICAgICAgIC5wdXQoT3JnYW5pemF0aW9uLlRJVExFLCAiQmxvZ2dlciIpCi0gICAgICAgICAgICAgICAgLnB1dChPcmdhbml6YXRpb24uVFlQRSwgT3JnYW5pemF0aW9uLlRZUEVfV09SSyk7Ci0gICAgICAgIGVsZW0uYWRkRXhwZWN0ZWQoT3JnYW5pemF0aW9uLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgI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heXRvd247TEE7MzAzMTQ7VW5pdGVkIFN0YXRlcyBvZiBBbWVyaWNhIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5cy5hc0xpc3QoIiIsICIiLCAiMTAwIFdhdGVycyBFZGdlIiwgIkJheXRvd24iLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTEEiLCAiMzAzMTQiLCAiVW5pdGVkIFN0YXRlcyBvZiBBbWVyaWNhIiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG5ldyBUeXBlU2V0KCJXT1JLIiksIG51bGwpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZVdpdGhPcmRlcigiTEFCRUwiLAotICAgICAgICAgICAgICAgICAgICAgICAgIjEwMCBXYXRlcnMgRWRnZVxyXG5CYXl0b3duLCBMQSAzMDMxNFxyXG5Vbml0ZWQgIFN0YXRlcyBvZiBBbWVyaWNhIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG1Db250ZW50VmFsdWVzRm9yUVAsIG5ldyBUeXBlU2V0KCJXT1JLIiksIG51bGwpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZVdpdGhPcmRlcigiQURSIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICI7OzQyIFBsYW50YXRpb24gU3QuO0JheXRvd247TEE7MzAzMTQ7VW5pdGVkIFN0YXRlcyBvZiBBbWVyaWNhIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5cy5hc0xpc3QoIiIsICIiLCAiNDIgUGxhbnRhdGlvbiBTdC4iLCAiQmF5dG93biIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJMQSIsICIzMDMxNCIsICJVbml0ZWQgU3RhdGVzIG9mIEFtZXJpY2EiKSwgbnVsbCwgbnVsbCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFR5cGVTZXQoIkhPTUUiKSwgbnVsbCkKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlV2l0aE9yZGVyKCJMQUJFTCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAiNDIgUGxhbnRhdGlvbiBTdC5cclxuQmF5dG93biwgTEEgMzAzMTRcclxuVW5pdGVkICBTdGF0ZXMgb2YgQW1lcmljYSIsCi0gICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBtQ29udGVudFZhbHVlc0ZvclFQLAotICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFR5cGVTZXQoIkhPTUUiKSwgbnVsbCkKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlV2l0aE9yZGVyKCJFTUFJTCIsICJmb3JyZXN0Z3VtcEB3YWxsYWRhbGxhLmNvbSIsCi0gICAgICAgICAgICAgICAgICAgICAgICBuZXcgVHlwZVNldCgiUFJFRiIsICJJTlRFUk5FVCIpKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGVXaXRoT3JkZXIoIkVNQUlMIiwgImNlbGxAZXhhbXBsZS5jb20iLCBuZXcgVHlwZVNldCgiQ0VMTCIpKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGVXaXRoT3JkZXIoIk5PVEUiLCAiVGhlIGZvbGxvd2luZyBub3RlIGlzIHRoZSBleGFtcGxlIGZyb20gUkZDIDIwNDUuIikKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlV2l0aE9yZGVyKCJOT1RFIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICJOb3cncyB0aGUgdGltZSBmb3IgYWxsIGZvbGsgdG8gY29tZSB0byB0aGUgYWlkIG9mIHRoZWlyIGNvdW50cnkuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG1Db250ZW50VmFsdWVzRm9yUVAsIG51bGwsIG51bGwpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZV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udGVudFZhbHVlc1ZlcmlmaWVyRWxlbSgpOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKFN0cnVjdHVyZWROYW1lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZE5hbWUuRkFNSUxZX05BTUUsICJHdW1wIikKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWROYW1lLkdJVkVOX05BTUUsICJGb3JyZXN0IikKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWROYW1lLk1JRERMRV9OQU1FLCAiSG9nZSIpCi0gICAgICAgICAgICAgICAgLnB1dChTdHJ1Y3R1cmVkTmFtZS5QUkVGSVgsICJQb3MiKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZE5hbWUuU1VGRklYLCAiVGFvIikKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWROYW1lLkRJU1BMQVlfTkFNRSwgIkpvZSBEdWUiKTsKLSAgICAgICAgZWxlbS5hZGRFeHBlY3RlZChPcmdhbml6YXRpb24uQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChPcmdhbml6YXRpb24uVFlQRSwgT3JnYW5pemF0aW9uLlRZUEVfV09SSykKLSAgICAgICAgICAgICAgICAucHV0KE9yZ2FuaXphdGlvbi5DT01QQU5ZLCAiR3VtcCBTaHJpbXAgQ28uIikKLSAgICAgICAgICAgICAgICAucHV0KE9yZ2FuaXphdGlvbi5ERVBBUlRNRU5ULCAiU2FsZXMgRGVwdC47TWFuYWdlciBGaXNoIGtlZXBlciIpCi0gICAgICAgICAgICAgICAgLnB1dChPcmdhbml6YXRpb24uVElUTEUsICJTaHJpbXAgTWFuIik7Ci0gICAgICAgIGVsZW0uYWRkRXhwZWN0ZWQoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX1dPUkspCi0gICAgICAgICAgICAgICAgLy8gUGhvbmUgbnVtYmVyIGlzIGV4cGVjdGVkIHRvIGJlIGZvcm1hdGVkIHdpdGggTkFNUCBmb3JtYXQgaW4gZGVmYXVsdC4KLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjExMS01NTUtMTIxMiIpOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9IT01FKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiNDA0LTU1NS0xMjEyIik7Ci0gICAgICAgIGVsZW0uYWRkRXhwZWN0ZWQoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX01PQklMRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjAzMS0xMTEtMTExMSIpOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9DVVNUT00pCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5MQUJFTCwgIlZJREVPIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjAzMi0yMjItMjIyMiIpOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9DVVNUT00pCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5MQUJFTCwgIlZPSUNFIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjA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ICAgICAgLnB1dChTdHJ1Y3R1cmVkUG9zdGFsLlBPU1RDT0RFLCAiMzAzMTQiKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZFBvc3RhbC5SRUdJT04sICJMQSIpCi0gICAgICAgICAgICAgICAgLnB1dChTdHJ1Y3R1cmVkUG9zdGFsLkNJVFksICJCYXl0b3duIikKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWRQb3N0YWwuU1RSRUVULCAiNDIgUGxhbnRhdGlvbiBTdC4iKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZFBvc3RhbC5GT1JNQVRURURfQUREUkVTUywKLSAgICAgICAgICAgICAgICAgICAgICAgICI0MiBQbGFudGF0aW9uIFN0LiBCYXl0b3duIExBIDMwMzE0IFVuaXRlZCBTdGF0ZXMgb2YgQW1lcmljYSIpOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKEVtYWlsLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC8vICJUWVBFPUlOVEVSTkVUIiAtPiBUWVBFX0NVU1RPTSArIHRoZSBsYWJlbCAiSU5URVJORVQiCi0gICAgICAgICAgICAgICAgLnB1dChFbWFpbC5UWVBFLCBFbWFpbC5UWVBFX0NVU1RPTSkKLSAgICAgICAgICAgICAgICAucHV0KEVtYWlsLkxBQkVMLCAiSU5URVJORVQiKQotICAgICAgICAgICAgICAgIC5wdXQoRW1haWwuREFUQSwgImZvcnJlc3RndW1wQHdhbGxhZGFsbGEuY29tIikKLSAgICAgICAgICAgICAgICAucHV0KEVtYWlsLklTX1BSSU1BUlksIDEpOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKEVtYWlsLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoRW1haWwuVFlQRSwgRW1haWwuVFlQRV9NT0JJTEUpCi0gICAgICAgICAgICAgICAgLnB1dChFbWFpbC5EQVRBLCAiY2VsbEBleGFtcG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4NUU0IiwgIlx1MzBFRFx1MzBBNFx1MzBDOVx1MDAzMSIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIiLCAiIiwgIiIpLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbUNvbnRlbnRWYWx1ZXNGb3JTSmlzLCBudWxsLCBudWxsKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGVXaXRoT3JkZXIoIkZOIiwgIlx1NUI4OVx1ODVFNFx1MDAyMFx1MzBFRFx1MzBBNFx1MzBDOVx1MDAyMFx1MDAzMSIsCi0gICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBtQ29udGVudFZhbHVlc0ZvclNKaXMsIG51bGwsIG51bGwpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZVdpdGhPcmRlcigiU09VTkQiLAotICAgICAgICAgICAgICAgICAgICAgICAgIlx1RkY3MVx1RkY5RFx1RkY4NFx1RkY5RVx1RkY3MztcdUZGOUJcdUZGNzJcdUZGODRcdUZGOUVcdTAwMzE7OzsiLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbUNvbnRlbnRWYWx1ZXNGb3JTSmlzLAotICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFR5cGVTZXQoIlgtSVJNQy1OIiksIG51bGwpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZVdpdGhPcmRlcigiQURSIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICI7XHU2NzcxXHU0RUFDXHU5MEZEXHU2RTBCXHU4QzM3XHU1MzNBXHU2ODVDIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAiXHU0RTE4XHU3NTNBXHUwMDMyXHUwMDM2XHUwMDJEXHUwMDMxXHUzMEJCIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAiXHUzMEVCXHUzMEVBXHUzMEEyXHUzMEYzXHUzMEJGXHUzMEVGXHUzMEZDXHUwMDM2IiArCi0gICAgICAgICAgICAgICAgICAgICAgICAiXHU5NjhFOzs7OzE1MC04NTEyOyIsCi0gICAgICAgICAgICAgICAgICAgICAgICBBcnJheXMuYXNMaXN0KCIiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiXHU2NzcxXHU0RUFDXHU5MEZEXHU2RTBCXHU4QzM3XHU1MzNBXHU2ODVDIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJcdTRFMThcdTc1M0FcdTAwMzJcdTAwMzZcdTAwMkRcdTAwMzFcdTMwQkIiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlx1MzBFQlx1MzBFQVx1MzBBMlx1MzBGM1x1MzBCRlx1MzBFRlx1MzBGQyIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiXHUwMDM2XHU5NjhFIiwgIiIsICIiLCAiIiwgIjE1MC04NTEyIiwgIiIpLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbUNvbnRlbnRWYWx1ZXNGb3JRUEFuZFNKaXMsIG5ldyBUeXBlU2V0KCJIT01FIiksIG51bGwpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZVdpdGhPcmRlcigiTk9URSIsICJcdTMwRTFcdTMwRTIiLCBudWxsLCBudWxsLAotICAgICAgICAgICAgICAgICAgICAgICAgbUNvbnRlbnRWYWx1ZXNGb3JRUEFuZFNKaXMsIG51bGwsIG51bGwpOwotICAgIH0KLQotICAgIHB1YmxpYyB2b2lkIHRlc3RWMjFKYXBhbmVzZTJfVHlwZV9HZW5lcmljX1V0ZjgoKSB7Ci0gICAgICAgIG1WZXJpZmllci5pbml0Rm9ySW1wb3J0VGVzdChWMjEsIFIucmF3LnYyMV9qYXBhbmVzZV8yKTsKLSAgICAgICAgQ29udGVudFZhbHVlc1ZlcmlmaWVyRWxlbSBlbGVtID0gbVZlcmlmaWVyLmFkZENvbnRlbnRWYWx1ZXNWZXJpZmllckVsZW0oK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b3N0YWwuU1RSRUVULAotICAgICAgICAgICAgICAgICAgICAgICAgIlx1Njc3MVx1NEVBQ1x1OTBGRFx1NkUwQlx1OEMzN1x1NTMzQVx1Njg1QyIgKwotICAgICAgICAgICAgICAgICAgICAgICAgIlx1NEUxOFx1NzUzQVx1MDAzMlx1MDAzNlx1MDAyRFx1MDAzMVx1MzBCQiIgKwotICAgICAgICAgICAgICAgICAgICAgICAgIlx1MzBFQlx1MzBFQVx1MzBBMlx1MzBGM1x1MzBCRlx1MzBFRlx1MzBGQyIgKwotICAgICAgICAgICAgICAgICAgICAgICAgIlx1MDAzNlx1OTY4RSIpCi0gICAgICAgICAgICAgICAgLnB1dChTdHJ1Y3R1cmVkUG9zdGFsLkZPUk1BVFRFRF9BRERSRVNTLAotICAgICAgICAgICAgICAgICAgICAgICAgIlx1Njc3MVx1NEVBQ1x1OTBGRFx1NkUwQlx1OEMzN1x1NTMzQVx1Njg1QyIgKwotICAgICAgICAgICAgICAgICAgICAgICAgIlx1NEUxOFx1NzUzQVx1MDAzMlx1MDAzNlx1MDAyRFx1MDAzMVx1MzBCQiIgKwotICAgICAgICAgICAgICAgICAgICAgICAgIlx1MzBFQlx1MzBFQVx1MzBBMlx1MzBGM1x1MzBCRlx1MzBFRlx1MzBGQyIgKwotICAgICAgICAgICAgICAgICAgICAgICAgIlx1MDAzNlx1OTY4RSAxNTAtODUxMiIpCi0gICAgICAgICAgICAgICAgLnB1dChTdHJ1Y3R1cmVkUG9zdGFsLlRZUEUsIFN0cnVjdHVyZWRQb3N0YWwuVFlQRV9IT01FKTsKLSAgICAgICAgZWxlbS5hZGRFeHBlY3RlZChOb3RlLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoTm90ZS5OT1RFLCAiXHUzMEUxXHUzMEUyIik7Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgdGVzdFYyMU11bHRpcGxlRW50cnlDYXNlX1BhcnNlKCkgewotICAgICAgICBtVmVyaWZ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AiMTMiKTsKLSAgICAgICAgZWxlbS5hZGRFeHBlY3RlZChQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfUEFHRVIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIxNCIpOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9DVVNUT00pCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5MQUJFTCwgIk5FQy1GQU1JTFkiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiMTUiKTsKLSAgICAgICAgZWxlbS5hZGRFeHBlY3RlZChQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfQ1VTVE9NKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTEFCRUwsICJORUMtR0lSTCIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIxNiIpOwotCi0gICAgICAgIGVsZW0gPSBtVmVyaWZpZXIuYWRkQ29udGVudFZhbHVlc1ZlcmlmaWVyRWxlbSgpOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKFN0cnVjdHVyZWROYW1lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZE5hbWUuRkFNSUxZX05BTUUsICJcdTVCODlcdTg1RTRcdTMwRURcdTMwQTRcdTMwQzlcdTAwMzUiKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZE5hbWUuRElTUExBWV9OQU1FLCAiXHU1Qjg5XHU4NUU0XHUzMEVEXHUzMEE0XHUzMEM5XHUwMDM1IikKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWROYW1lLlBIT05FVElDX0dJVkVOX05BTUUsCi0gICAgICAgICAgICAgICAgICAgICAgICAiXHVGRjcxXHVGRjlEXHVGRjg0XHVGRjlFXHVGRjczXHVGRjlCXHVGRjcyXHVGRjg0XHVGRjlFXHUwMDM1Iik7Ci0gICAgICAgIGVsZW0uYWRkRXhwZWN0ZWQoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX0NVU1RPTSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLkxBQkVMLCAiTkVDLUJPWSIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIxNyIpOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9DVVNUT00pCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5MQUJFTCwgIk5FQy1GUklFTkQiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiMTgiKTsKLSAgICAgICAgZWxlbS5hZGRFeHBlY3RlZChQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfQ1VTVE9NKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTEFCRUwsICJORUMtUEhTIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjE5Iik7Ci0gICAgICAgIGVsZW0uYWRkRXhwZWN0ZWQoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX0NVU1RPTSkKLSAgICAgICAgICAgICAgICAucHV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uUEhPTkVUSUNfRkFNSUxZX05BTUUsICJcdUZGOTRcdUZGOEZcdUZGODBcdUZGOUUiKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZE5hbWUuUEhPTkVUSUNfTUlERExFX05BTUUsCi0gICAgICAgICAgICAgICAgICAgICAgICAiXHVGRjkwXHVGRjg0XHVGRjlFXHVGRjk5XHVGRjg4XHVGRjcwXHVGRjkxIikKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWROYW1lLlBIT05FVElDX0dJVkVOX05BTUUsICJcdUZGODBcdUZGOUJcdUZGNzMiKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZE5hbWUuRElTUExBWV9OQU1FLAotICAgICAgICAgICAgICAgICAgICAgICAgIlx1RkY5NFx1RkY4Rlx1RkY4MFx1RkY5RSBcdUZGOTBcdUZGODRcdUZGOUVcdUZGOTlcdUZGODhcdUZGNzBcdUZGOTEgIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAiXHVGRjgwXHVGRjlCXHVGRjczIik7Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgdGVzdFBob25ldGljTmFtZUZvck1vYmlsZVYyMV8yKCkgewotICAgICAgICBtVmVyaWZpZXIuaW5pdEZvckV4cG9ydFRlc3QoVkNhcmRDb25maWcuVkNBUkRfVFlQRV9WMjFfSkFQQU5FU0VfTU9CSUxFKTsKLSAgICAgICAgQ29udGFjdEVudHJ5IGVudHJ5ID0gbVZlcmlmaWVyLmFkZElucHV0RW50cnkoKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhTdHJ1Y3R1cmVkTmFtZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWROYW1lLlBIT05FVElDX0ZBTUlMWV9OQU1FLCAiXHUzMDg0XHUzMDdFXHUzMDYwIikKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWROYW1lLlBIT05FVElDX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UFFSU1RVVldYWVoiKSk7Ci0gICAgICAgIGFzc2VydFRydWUoVkNhcmRVdGlscy5jb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkoIjAxMjM0NTY3ODktIikpOwotICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IDB4MzA7IGkrKykgewotICAgICAgICAgICAgaWYgKGkgPT0gMHgyRCkgeyAgLy8gLQotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYXNzZXJ0RmFsc2UoVkNhcmRVdGlscy5jb250YWluc09ubHlBbHBoYURpZ2l0SHlwaGVuKFN0cmluZy52YWx1ZU9mKChjaGFyKWkpKSk7Ci0gICAgICAgIH0KLSAgICAgICAgZm9yIChpbnQgaSA9IDB4M0E7IGkgPCAweDQxOyBpKyspIHsKLSAgICAgICAgICAgIGFzc2VydEZhbHNlKFZDYXJkVXRpbHMuY29udGFpbnNPbmx5QWxwaGFEaWdpdEh5cGhlbihTdHJpbmcudmFsdWVPZigoY2hhcilpKSkpOwotICAgICAgICB9Ci0gICAgICAgIGZvciAoaW50IGkgPSAweDVCOyBpIDwgMHg2MTsgaSsrKSB7Ci0gICAgICAgICAgICBhc3NlcnRGYWxzZShWQ2FyZFV0aWxzLmNvbnRhaW5zT25seUFscGhhRGlnaXRIeXBoZW4oU3RyaW5nLnZhbHVlT2YoKGNoYXIpaSkpKTsKLSAgICAgICAgfQotICAgICAgICBmb3IgKGludCBpID0gMHg3QjsgaSA8IDB4MTAwOyBpKyspIHsKLSAgICAgICAgICAgIGFzc2VydEZhbHNlKFZDYXJkVXRpbHMuY29udGFpbnNPbmx5QWxwaGFEaWdpdEh5cGhlbihTdHJpbmcudmFsdWVPZigoY2hhcilpKSkpOwotICAgICAgICB9Ci0gICAgfQotfQpkaWZmIC0tZ2l0IGEvY29yZS90ZXN0cy9jb3JldGVzdHMvc3JjL2FuZHJvaWQvcGltL3ZjYXJkL1ZDYXJkVmVyaWZpZXIu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7Ci0gICAgICAgICAgICBtVGVzdENhc2UuZmFpbCgiVW5leHBlY3RlZCBWQ2FyZEV4Y2VwdGlvbjogIiArIGUuZ2V0TWVzc2FnZSgpKTsKLSAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgIGlmIChpcyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgaXMuY2xvc2UoKTsKLSAgICAgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgdmVyaWZ5KCkgewotICAgICAgICBpZiAoIW1Jbml0aWFsaXplZCkgewotICAgICAgICAgICAgbVRlc3RDYXNlLmZhaWwoIk5vdCBpbml0aWFsaXplZC4iKTsKLSAgICAgICAgfQotICAgICAgICBpZiAobVZlcmlmaWVkKSB7Ci0gICAgICAgICAgICBtVGVzdENhc2UuZmFpbCgidmVyaWZ5KCkgd2FzIGNhbGxlZCB0d2ljZS4iKTsKLSAgICAgICAgfQotICAgICAgICBpZiAobUlucHV0U3RyZWFtICE9IG51bGwpIHsKLSAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgdmVyaWZ5Rm9ySW1wb3J0VGVzdCgpOwotICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgIG1UZXN0Q2FzZS5mYWlsKCJJT0V4Y2VwdGlvbiB3YXMgdGhyb3duOiAiICsgZS5nZXRNZXNzYWdlKCkpOwotICAgICAgICAgICAgfSBjYXRjaCAoVkNhcmRFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgIG1UZXN0Q2FzZS5mYWlsKCJWQ2FyZEV4Y2VwdGlvbiB3YXMgdGhyb3duOiAiICsgZS5nZXRNZXNzYWdlKCkpOwotICAgICAgICAgICAgfQotICAg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RlcygpKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWU7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGVuY29kaW5nLmVxdWFscygiUVVPVEVELVBSSU5UQUJMRSIpKSB7Ci0gICAgICAgICAgICAgICAgU3RyaW5nIHF1b3RlZFByaW50YWJsZSA9IHZhbHVlCi0gICAgICAgICAgICAgICAgLnJlcGxhY2VBbGwoIj0gIiwgIiAiKS5yZXBsYWNlQWxsKCI9XHQiLCAiXHQiKTsKLSAgICAgICAgICAgICAgICBTdHJpbmdbXSBsaW5lczsKLSAgICAgICAgICAgICAgICBpZiAobVN0cmljdExpbmVCcmVha1BhcnNpbmcpIHsKLSAgICAgICAgICAgICAgICAgICAgbGluZXMgPSBxdW90ZWRQcmludGFibGUuc3BsaXQoIlxyXG4iKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICAgICAgICAgICAgICBpbnQgbGVuZ3RoID0gcXVvdGVkUHJpbnRhYmxlLmxlbmd0aCgpOwotICAgICAgICAgICAgICAgICAgICBBcnJheUxpc3Q8U3RyaW5nPiBsaXN0ID0gbmV3IEFycmF5TGlzdDxTdHJpbmc+KCk7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgY2ggPSBxdW90ZWRQcmludGFibGUuY2hhckF0KGkpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoID09ICdcbicpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0LmFkZChidWlsZGVyLnRvU3RyaW5nKCkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PSAnXHInKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC5hZGQoYnVpbGRlci50b1N0cmluZygpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA8IGxlbmd0aCAtIDEpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhciBuZXh0Q2ggPSBxdW90ZWRQcmludGFibGUuY2hhckF0KGkgKyAxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5leHRDaCA9PSAnXG4nKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpKys7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGNoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgZmluYWxMaW5lID0gYnVpbGRlci50b1N0cmluZygpOwotICAgICAgICAgICAgICAgICAgICBpZiAoZmluYWxMaW5lLmxlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC5hZGQoZmluYWxMaW5lKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBsaW5lcyA9IGxpc3QudG9BcnJheShuZXcgU3RyaW5nWzBdKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgICAgICAgICBmb3IgKFN0cmluZyBsaW5lIDogbGluZXMpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGxpbmUuZW5kc1dpdGgoIj0iKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgbGluZSA9IGxpbmUuc3Vic3RyaW5nKDAsIGxpbmUubGVuZ3RoKCkgLSAxKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChsaW5lKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnl0ZVtdIGJ5dGVzOwotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ5dGVzID0gYnVpbGRlci50b1N0cmluZygpLmdldEJ5dGVzKG1Tb3VyY2VDaGFyc2V0KTsKLSAgICAgICAgICAgICAgICB9IGNhdGNoIChVbnN1cHBvcnRlZEVuY29kaW5nRXhjZXB0aW9uIGUxKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJGYWlsZWQgdG8gZW5jb2RlOiBjaGFyc2V0PSIgKyBtU291cmNlQ2hhcnNldCk7Ci0gICAgICAgICAgICAgICAgICAgIGJ5dGVzID0gYnVpbGRlci50b1N0cmluZygpLmdldEJ5dGVzKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ5dGVzID0gUXVvdGVkUHJpbnRhYmxlQ29kZWMuZGVjb2RlUXVvdGVkUHJpbnRhYmxlKGJ5dGVzKTsKLSAgICAgICAgICAgICAgICB9IGNhdGNoIChEZWNvZGVyRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIkZhaWxlZCB0byBkZWNvZGUgcXVvdGVkLXByaW50YWJsZTogIiArIGUpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gIiI7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBTdHJpbmcoYnl0ZXMsIHRhcmdldENoYXJzZXQpOwotICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFVuc3VwcG9ydGVkRW5jb2RpbmdFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiRmFpbGVkIHRvIGVuY29kZTogY2hhcnNldD0iICsgdGFyZ2V0Q2hhcnNldCk7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgU3RyaW5nKGJ5dGVzKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAvLyBVbmtub3duIGVuY29kaW5nLiBGYWxsIGJhY2sgdG8gZGVmYXVsdC4KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gZW5jb2RlU3RyaW5nKHZhbHVlLCB0YXJnZXRDaGFyc2V0KTsKLSAgICB9Ci0gICAgCi0gICAgcHVibGljIHZvaWQgcHJvcGVydHlWYWx1ZXMoTGlzdDxTdHJpbmc+IHZhbHVlcykgewotICAgICAgICBpZiAodmFsdWVzID09IG51bGwgfHwgdmFsdWVzLnNpemUoKSA9PSAwKSB7Ci0gICAgICAgICAgICBtQ3VycmVudFByb3BOb2RlLnByb3BWYWx1ZV9ieXRlcyA9IG51bGw7Ci0gICAgICAgICAgICBtQ3VycmVudFByb3BOb2RlLnByb3BWYWx1ZV92ZWN0b3IuY2xlYXIoKTsKLSAgICAgICAgICAgIG1DdXJyZW50UHJvcE5vZGUucHJvcFZhbHVlX3ZlY3Rvci5hZGQoIiIpOwotICAgICAgICAgICAgbUN1cnJlbnRQcm9wTm9kZS5wcm9wVmFsdWUgPSAiIjsKLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotICAgICAgICAKLSAgICAgICAgQ29udGVudFZhbHVlcyBwYX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AgLTE0NCw0ICsxNDQsNTEgQEAKIAogICAgICAgICBhc3NlcnRFcXVhbHMobnVsbCwgU2V0dGluZ3MuQm9va21hcmtzLmdldEludGVudEZvclNob3J0Y3V0KHIsICcqJykpOwogICAgIH0KKworICAgIEBNZWRpdW1UZXN0CisgICAgcHVibGljIHZvaWQgdGVzdFBhcnNlUHJvdmlkZXJMaXN0KCkgeworICAgICAgICBDb250ZW50UmVzb2x2ZXIgciA9IGdldENvbnRleHQoKS5nZXRDb250ZW50UmVzb2x2ZXIoKTsKKworICAgICAgICAvLyBNYWtlIHN1cmUgd2UgZ2V0IG91dCB3aGF0IHdlIHB1dCBpbi4KKyAgICAgICAgU2V0dGluZ3MuU2VjdXJlLnB1dFN0cmluZyhyLCBTZXR0aW5ncy5TZWN1cmUuTE9DQVRJT05fUFJPVklERVJTX0FMTE9XRUQsCisgICAgICAgICAgICAgICAgInRlc3QxLHRlc3QyLHRlc3QzIik7CisgICAgICAgIGFzc2VydEVxdWFscyhTZXR0aW5ncy5TZWN1cmUuZ2V0U3RyaW5nKHIsIFNldHRpbmdzLlNlY3VyZS5MT0NBVElPTl9QUk9WSURFUlNfQUxMT1dFRCksCisgICAgICAgICAgICAgICAgInRlc3QxLHRlc3QyLHRlc3QzIik7CisKKyAgICAgICAgLy8gVGVzdCBhZGRpbmcgYSB2YWx1ZQorICAgICAgICBTZXR0aW5ncy5TZWN1cmUucHV0U3RyaW5nKHIsIFNldHRpbmdzLlNlY3VyZS5MT0NBVElPTl9QUk9WSURFUlNfQUxMT1dFRCwKKyAgICAgICAgICAgICAgICAiIik7CisgICAgICAgIFNldHRpbmdzLlNlY3VyZS5wdXRTdHJpbmcociwgU2V0dGluZ3MuU2VjdXJlLkxPQ0FUSU9OX1BST1ZJREVSU19BTExPV0VELCAiK3Rlc3QxIik7CisgICAgICAgIGFzc2VydEVxdWFscygidGVzdDEiLAorICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5nZXRTdHJpbmcociwgU2V0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AgICAgICJhQTFCIiwKKyAgICAgICAgImFBMUIyIiwKKworICAgICAgICAvLyBydGwKKyAgICAgICAgIkEiLAorICAgICAgICAiQTEiLAorICAgICAgICAiQWEiLAorICAgICAgICAiQTFCIiwKKyAgICAgICAgIkExYSIsCisgICAgICAgICJBYTEiLAorICAgICAgICAiQWFCIgorICAgIH07CisKKyAgICAvLyBFeHBlY3RlZCBkaXJlY3Rpb25zIGFyZSBhbiBhcnJheSBvZiBzdGFydC9sZW5ndGgrbGV2ZWwgcGFpcnMsCisgICAgLy8gaW4gdmlzdWFsIG9yZGVyIGZyb20gdGhlIGxlYWRpbmcgbWFyZ2luLgorICAgIHByaXZhdGUgc3RhdGljIERpcmVjdGlvbnNbXSBleHBlY3RlZCA9IHsKKyAgICAgICAgRElSU19BTExfTEVGVF9UT19SSUdIVCwKKyAgICAgICAgRElSU19BTExfTEVGVF9UT19SSUdIVCwKKyAgICAgICAgRElSU19BTExfTEVGVF9UT19SSUdIVCwKKyAgICAgICAgRElSU19BTExfTEVGVF9UT19SSUdIVCwKKyAgICAgICAgZGlycygwLCAxLCAxLCBMVkwxXzEpLAorICAgICAgICBESVJTX0FMTF9MRUZUX1RPX1JJR0hULAorICAgICAgICBkaXJzKDAsIDIsIDIsIExWTDFfMSksCisgICAgICAgIGRpcnMoMCwgMSwgMiwgTFZMMl8xLCAxLCBMVkwxXzEpLAorICAgICAgICBkaXJzKDAsIDEsIDEsIExWTDFfMSwgMiwgMSksCisgICAgICAgIGRpcnMoMCwgMSwgMywgTFZMMV8xLCAyLCBMVkwyXzEsIDEsIExWTDFfMSksCisgICAgICAgIGRpcnMoMCwgMSwgNCwgTFZMMl8xLCAzLCBMVkwxXzEsIDIsIExWTDJfMSwgMSwgTFZMMV8xKSwKKworICAgICAgICAvLyBydGwKKyAgICAgICAgRElSU19BTExfUklHSFRfVE9fTEVGVCwKKyAgICAgICAgZGlycygwLCBMVkwxXzEsIDEsIExWTDJfMSksCisgICAgICAgIGRpcnMoMCwgT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gZXhwZWN0ZWQsIHJlc3VsdCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdE5leHRUb1JpZ2h0T2YoKSB7CisgICAgICAgIExheW91dEJ1aWxkZXIgYiA9IFN0YXRpY0xheW91dFRlc3QuYnVpbGRlcigpOworICAgICAgICBiLnNldFRleHQocHNldWRvQmlkaVRvUmVhbCgiYUExQjIiKSk7CisgICAgICAgIC8vIHZpc3VhbCBhMkIxQSBwb3NpdGlvbnMgMDQzMjEKKyAgICAgICAgLy8gMDogfGEyQjFBLCBzdHJvbmcgaXMgc29sLCBhZnRlciAtPiAwCisgICAgICAgIC8vIDE6IGF8MkIxQSwgc3Ryb25nIGlzIGEsIGFmdGVyIC0+LCAxCisgICAgICAgIC8vIDI6IGEyfEIxQSwgc3Ryb25nIGlzIEIsIGFmdGVyIC0+IDQKKyAgICAgICAgLy8gMzogYTJCfDFBLCBzdHJvbmcgaXMgQiwgYmVmb3JlIC0+IDMKKyAgICAgICAgLy8gNDogYTJCMXxBLCBzdHJvbmcgaXMgQSwgYWZ0ZXIgLT4gMgorICAgICAgICAvLyA1OiBhMkIxQXwsIHN0cm9uZyBpcyBlb2wsIGJlZm9yZSAtPiA1CisgICAgICAgIGludFtdIGV4cGVjdGVkID0geyAwLCAxLCA0LCAzLCAyLCA1IH07CisgICAgICAgIExheW91dCBsID0gYi5idWlsZCgpOworICAgICAgICBpbnQgbiA9IDA7CisgICAgICAgIGZvciAoaW50IGkgPSAxOyBpIDwgZXhwZWN0ZWQubGVuZ3RoOyArK2kpIHsKKyAgICAgICAgICAgIGludCB0ID0gbC5nZXRPZmZzZXRUb1JpZ2h0T2Yobik7CisgICAgICAgICAgICBpZiAodCAhPSBleHBlY3RlZFtpXSkgeworICAgICAgICAgICAgICAgIGZhaWwoIm9mZnNldFsiICsgaSArICJdIHRvIHJpZ2h0IG9mOiAiICsgbiArICIgZXhwZWN0ZWQ6ICIgKworICAgICAgICAgICAgICAgICAgICAgICAgZXhwZWN0ZWRbaV0gKyAiIGdvdDogIiArIHQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbiA9IHQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB0ZXN0TmV4dFRvTGVmdE9mKCkgeworICAgICAgICBMYXlvdXRCdWlsZGVyIGIgPSBTdGF0aWNMYXlvdXRUZXN0LmJ1aWxkZXIoKTsKKyAgICAgICAgYi5zZXRUZXh0KHBzZXVkb0JpZGlUb1JlYWwoImFBMUIyIikpOworICAgICAgICBpbnRbXSBleHBlY3RlZCA9IHsgMCwgMSwgNCwgMywgMiwgNSB9OworICAgICAgICBMYXlvdXQgbCA9IGIuYnVpbGQoKTsKKyAgICAgICAgaW50IG4gPSA1OworICAgICAgICBmb3IgKGludCBpID0gZXhwZWN0ZWQubGVuZ3RoIC0gMTsgLS1pID49IDA7KSB7CisgICAgICAgICAgICBpbnQgdCA9IGwuZ2V0T2Zmc2V0VG9MZWZ0T2Yobik7CisgICAgICAgICAgICBpZiAodCAhPSBleHBlY3RlZFtpXSkgeworICAgICAgICAgICAgICAgIGZhaWwoIm9mZnNldFsiICsgaSArICJdIHRvIGxlZnQgb2Y6ICIgKyBuICsgIiBleHBlY3RlZDogIiArCisgICAgICAgICAgICAgICAgICAgICAgICBleHBlY3RlZFtpXSArICIgZ290OiAiICsgdCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBuID0gdDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8vIHV0aWxpdHksIG5vdCByZWFsbHkgYSB0ZXN0CisgICAgLyoKKyAgICBwdWJsaWMgdm9pZCB0ZXN0TWVhc3VyZVRleHQxKCkgeworICAgICAgICBMYXlvdXRCdWlsZGVyIGIgPSBTdGF0aWNMYXlvdXRUZXN0LmJ1aWxkZXIoKTsKKyAgICAgICAgU3RyaW5nIHRleHQgPSAiQUJDIjsgLy8gImFiQUIiCisgICAgICAgIGIuc2V0VGV4dChwc2V1ZG9CaWRpVG9SZWFsKHRleHQpKTsKKyAgICAgICAgTGF5b3V0IGwgPSBiLmJ1aWxkKCk7CisgICAgICAgIERpcmVjdGlvbnMgZGlyZWN0aW9ucyA9IGwuZ2V0TGluZURpcmVjdGlvbnMoMCk7CisKKyAgICAgICAgVGV4dFBhaW50IHdvcmtQYWludCA9IG5ldyBUZXh0UGFpbnQoKTsKKworICAgICAgICBpbnQgZGlyID0gLTE7IC8vIExFRlRfVE9fUklHSFQKKyAgICAgICAgYm9vbGVhbiB0cmFpbGluZyA9IHRydWU7CisgICAgICAgIGJvb2xlYW4gYWx0ID0gdHJ1ZTsKKyAgICAgICAgZG8geworICAgICAgICAgICAgZGlyID0gLWRpcjsKKyAgICAgICAgICAgIGRvIHsKKyAgICAgICAgICAgICAgICB0cmFpbGluZyA9ICF0cmFpbGluZzsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBvZmZzZXQgPSAwLCBlbmQgPSBiLnRleHQubGVuZ3RoKCk7IG9mZnNldCA8PSBlbmQ7ICsrb2Zmc2V0KSB7CisgICAgICAgICAgICAgICAgICAgIGZsb2F0IHdpZHRoID0gTGF5b3V0Lm1lYXN1cmVUZXh0KGIucGFpbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgd29ya1BhaW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIudGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCBvZmZzZXQsIGVuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXIsIGRpcmVjdGlvbnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhaWxpbmcsIGZhbHNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwpOworICAgICAgICAgICAgICAgICAgICBMb2cuaSgiQklESSIsICJkaXI6ICIgKyBkaXIgKyAiIHRyYWlsOiAiICsgdHJhaWxpbmcgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgb2Zmc2V0OiAiICsgb2Zmc2V0ICsgIiB3aWR0aDogIiArIHdpZHRoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IHdoaWxlICghdHJhaWxpbmcpOworICAgICAgICB9IHdoaWxlIChkaXIgPiAwKTsKKyAgICB9CisgICAgKi8KKworICAgIC8vIHV0aWxpdHkgZm9yIGRpc3BsYXlpbmcgYXJyYXlzIGluIGhleAorICAgIHByaXZhdGUgc3RhdGljIFN0cmluZyBoZXhBcnJheShpbnRbXSBhcnJheSkgeworICAgICAgICBTdHJpbmdCdWlsZGVyIHNiID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKKyAgICAgICAgc2IuYXBwZW5kKCd7Jyk7CisgICAgICAgIGZvciAoaW50IGkgOiBhcnJheSkgeworICAgICAgICAgICAgaWYgKHNiLmxlbmd0aCgpID4gMSkgeworICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgiLCAiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNiLmFwcGVuZChJbnRlZ2VyLnRvSGV4U3RyaW5nKGkpKTsKKyAgICAgICAgfQorICAgICAgICBzYi5hcHBlbmQoJ30nKTsKKyAgICAgICAgcmV0dXJuIHNiLnRvU3RyaW5nKCk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGNoZWNrRGlyZWN0aW9ucyhMYXlvdXQgbCwgaW50IGksIFN0cmluZyB0ZXh0LAorICAgICAgICAgICAgRGlyZWN0aW9uc1tdIGV4cGVjdGVkRGlycywgRm9ybWF0dGVyIGYpIHsKKyAgICAgICAgRGlyZWN0aW9ucyBleHBlY3RlZCA9IGV4cGVjdGVkRGlyc1tpXTsKKyAgICAgICAgRGlyZWN0aW9ucyByZXN1bHQgPSBsLmdldExpbmVEaXJlY3Rpb25zKDApOworICAgICAgICBpZiAoIUFycmF5cy5lcXVhbHMoZXhwZWN0ZWQubURpcmVjdGlvbnMsIHJlc3VsdC5tRGlyZWN0aW9ucykpIHsKKyAgICAgICAgICAgIGYuZm9ybWF0KCIlblslMmRdICclcycsICVzICE9ICV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oKSB8fCBjaGlsZCA8IDApIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICAKLSAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgIH0KLSAgICAKLSAgICAvKioKLSAgICAgKiBHZXRzIGEgdmlldyBmb3IgdGhlIHBhY2tlZCBwb3NpdGlvbiwgcG9zc2libHkgcmV1c2luZyB0aGUgY29udmVydFZpZXcuCi0gICAgICogCi0gICAgICogQHBhcmFtIHBhY2tlZFBvc2l0aW9uIFRoZSBwb3NpdGlvbiB0byBnZXQgYSB2aWV3IGZvci4KLSAgICAgKiBAcGFyYW0gY29udmVydFZpZXcgT3B0aW9uYWwgdmlldyB0byBjb252ZXJ0LgotICAgICAqIEBwYXJhbSBwYXJlbnQgVGhlIGZ1dHVyZSBwYXJlbnQuCi0gICAgICogQHJldHVybiBBIHZpZXcuCi0gICAgICovCi0gICAgcHJpdmF0ZSBWaWV3IGdldFZpZXcobG9uZyBwYWNrZWRQb3NpdGlvbiwgVmlldyBjb252ZXJ0VmlldywgVmlld0dyb3VwIHBhcmVudCkgewotICAgICAgICBpZiAoaXNPdXRPZkJvdW5kcyhwYWNrZWRQb3NpdGlvbikpIHsKLSAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oInBvc2l0aW9uIG91dCBvZiByYW5nZSBmb3IgYWRhcHRlciEiKTsKLSAgICAgICAgfQotICAgICAgICAKLSAgICAgICAgZmluYWwgRXhwYW5kYWJsZUxpc3RWaWV3IGVsdiA9IGdldEV4cGFuZGFibGVMaXN0VmlldygpOwotICAgICAgICBmaW5hbCBpbnQgZmxQb3MgPSBlbHYuZ2V0RmxhdExpc3RQb3NpdGlvbihwYWNrZWRQb3NpdGlvbik7IAotICAgICAgICAKLSAgICAgICAgaWYgKGNvbnZlcnRWaWV3ICE9IG51bGwpIHsKLSAgICAgICAgICAgICgoVGV4dFZpZXcp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RDb250ZXh0KCkpOwotICAgICAgICByZXN1bHQuc2V0SGVpZ2h0KGRlc2lyZWRIZWlnaHQpOwotICAgICAgICByZXN1bHQuc2V0VGV4dChnZXRWYWx1ZUF0UG9zaXRpb24ocGFja2VkUG9zaXRpb24pKTsKLSAgICAgICAgZmluYWwgVmlld0dyb3VwLkxheW91dFBhcmFtcyBscCA9IG5ldyBBYnNMaXN0Vmlldy5MYXlvdXRQYXJhbXMoCi0gICAgICAgICAgICAgICAgVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQsCi0gICAgICAgICAgICAgICAgVmlld0dyb3VwLkxheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQpOwotICAgICAgICByZXN1bHQuc2V0TGF5b3V0UGFyYW1zKGxwKTsKLSAgICAgICAgcmVzdWx0LnNldEdyYXZpdHkoR3Jhdml0eS5DRU5URVJfVkVSVElDQUwpOwotICAgICAgICByZXN1bHQuc2V0UGFkZGluZygzNiwgMCwgMCwgMCk7Ci0gICAgICAgIHJlc3VsdC5zZXRJZChmbFBvcyk7Ci0gICAgICAgIHJldHVybiByZXN1bHQ7Ci0gICAgfQotICAgIAotICAgIC8qKgotICAgICAqIFJldHVybnMgYSBncm91cCBpbmRleCBjb250YWluaW5nIGVpdGhlciB0aGUgbnVtYmVyIG9mIGNoaWxkcmVuIG9yIGF0Ci0gICAgICogbGVhc3Qgb25lIGNoaWxkLgotICAgICAqIAotICAgICAqIEBwYXJhbSBudW1DaGlsZHJlbiBUaGUgZ3JvdXAgbXVzdCBoYXZlIHRoaXMgYW1vdW50LCBvciAtMSBpZiB1c2luZwotICAgICAqICAgICAgICAgICAgYXRMZWFzdE9uZUNoaWxkLgotICAgICAqIEBwYXJhbSBhdExlYXN0T25lQ2hpbGQgVGhlIGdyb3VwIG11c3QgaGF2ZSBhdCBsZWFzdCBvbmUgY2hpbGQsIG9yIGZhbHNlCi0gICAgICogICAgICAgICAgICBpZiB1c2luZyBudW1DaGlsZHJlbi4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ICAgIHB1YmxpYyBPYmplY3QgZ2V0R3JvdXAoaW50IGdyb3VwUG9zaXRpb24pIHsKLSAgICAgICAgICAgIHJldHVybiBnZXRWYWx1ZUF0UG9zaXRpb24oRXhwYW5kYWJsZUxpc3RWaWV3LmdldFBhY2tlZFBvc2l0aW9uRm9yR3JvdXAoZ3JvdXBQb3NpdGlvbikpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIGludCBnZXRHcm91cENvdW50KCkgewotICAgICAgICAgICAgcmV0dXJuIG1Hcm91cHMuc2l6ZSgpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIGxvbmcgZ2V0R3JvdXBJZChpbnQgZ3JvdXBQb3NpdGlvbikgewotICAgICAgICAgICAgcmV0dXJuIG1Hcm91cHMuZ2V0KGdyb3VwUG9zaXRpb24pLmlkOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIFZpZXcgZ2V0R3JvdXBWaWV3KGludCBncm91cFBvc2l0aW9uLCBib29sZWFuIGlzRXhwYW5kZWQsIFZpZXcgY29udmVydFZpZXcsCi0gICAgICAgICAgICAgICAgVmlld0dyb3VwIHBhcmVudCkgewotICAgICAgICAgICAgcmV0dXJuIGdldFZpZXcoRXhwYW5kYWJsZUxpc3RWaWV3LmdldFBhY2tlZFBvc2l0aW9uRm9yR3JvdXAoZ3JvdXBQb3NpdGlvbiksCi0gICAgICAgICAgICAgICAgICAgIGNvbnZlcnRWaWV3LCBwYXJlbnQpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIGJvb2xlYW4gaXNDaGlsZFNlbGVjdGFibGUoaW50IGdyb3VwUG9zaXRpb24sIGludCBjaGlsZFBvc2l0aW9uKSB7Ci0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBib29sZWFuIGhhc1N0YWJsZUlkcygpIHsKLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9Ci0gICAgICAgIAot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J1bWVudGF0aW9uLndhaXRGb3JJZGxlU3luYygpOwotICAgICAgICAgICAgQXNzZXJ0LmFzc2VydE51bGwobWVudUxpc3RlbmVyLmdldEVycm9yTWVzc2FnZSgpLCBtZW51TGlzdGVuZXIuZ2V0RXJyb3JNZXNzYWdlKCkpOwotICAgICAgICAgICAgaW5kZXgrKzsKLQotICAgICAgICAgICAgZmluYWwgaW50IGNoaWxkcmVuQ291bnQgPSBtQWRhcHRlci5nZXRDaGlsZHJlbkNvdW50KGdyb3VwSW5kZXgpOwotICAgICAgICAgICAgZm9yIChpbnQgY2hpbGRJbmRleCA9IDA7IGNoaWxkSW5kZXggPCBjaGlsZHJlbkNvdW50OyBjaGlsZEluZGV4KyspIHsKLSAgICAgICAgICAgICAgICAvLyBDaGVjayBjaGlsZCBpbmRleCBpbiBjb250ZXh0IG1lbnUKLSAgICAgICAgICAgICAgICBtTGlzdFV0aWwuYXJyb3dTY3JvbGxUb1NlbGVjdGVkUG9zaXRpb24oaW5kZXgpOwotICAgICAgICAgICAgICAgIG1lbnVMaXN0ZW5lci5leHBlY3RDaGlsZENvbnRleHRNZW51KGdyb3VwSW5kZXgsIGNoaWxkSW5kZXgpOwotICAgICAgICAgICAgICAgIFZpZXcgY2hpbGQgPSBtRXhwYW5kYWJsZUxpc3RWaWV3LmdldENoaWxkQXQoaW5kZXgKLSAgICAgICAgICAgICAgICAgICAgICAgIC0gbUV4cGFuZGFibGVMaXN0Vmlldy5nZXRGaXJzdFZpc2libGVQb3NpdGlvbigpKTsKLSAgICAgICAgICAgICAgICBtRXhwYW5kYWJsZUxpc3RWaWV3LnNob3dDb250ZXh0TWVudUZvckNoaWxkKGNoaWxkKTsKLSAgICAgICAgICAgICAgICBtSW5zdHJ1bWVudGF0aW9uLndhaXRGb3JJZGxlU3luYygpOwotICAgICAgICAgICAgICAgIEFzc2VydC5hc3NlcnROdWxsKG1lbnVMaXN0ZW5lci5nZXRFcnJvck1lc3NhZ2UoKSwgbWVudUxpc3Rlbm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gdGhlIHZpZXdwb3J0IGRpbWVuc2lvbnMgaWYgdGhpcyBjYW52YXMgaXMgR0wgYmFzZWQuIElmIGl0IGlzIG5vdCwKICAgICAgKiB0aGlzIG1ldGhvZCBpcyBpZ25vcmVkIGFuZCBubyBleGNlcHRpb24gaXMgdGhyb3duLgogICAgICAqCi0gICAgICogIEBwYXJhbSB3aWR0aCAgICBUaGUgd2lkdGggb2YgdGhlIHZpZXdwb3J0Ci0gICAgICogIEBwYXJhbSBoZWlnaHQgICBUaGUgaGVpZ2h0IG9mIHRoZSB2aWV3cG9ydAorICAgICAqICBAcGFyYW0gd2lkdGggVGhlIHdpZHRoIG9mIHRoZSB2aWV3cG9ydAorICAgICAqICBAcGFyYW0gaGVpZ2h0IFRoZSBoZWlnaHQgb2YgdGhlIHZpZXdwb3J0CisgICAgICogCisgICAgICogQGRlcHJlY2F0ZWQgVGhpcyBtZXRob2QgaXMgbm90IHN1cHBvcnRlZCBhbmQgc2hvdWxkIG5vdCBiZSBpbnZva2VkLgogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHNldFZpZXdwb3J0KGludCB3aWR0aCwgaW50IGhlaWdodCkgewogICAgICAgICBpZiAobUdMICE9IG51bGwpIHsKQEAgLTYyMSw3ICs2NTMsMTEgQEAKICAgICAgICAgRWRnZVR5cGUoaW50IG5hdGl2ZUludCkgewogICAgICAgICAgICAgdGhpcy5uYXRpdmVJbnQgPSBuYXRpdmVJbnQ7CiAgICAgICAgIH0KLSAgICAgICAgZmluYWwgaW50IG5hdGl2ZUludDsKKworICAgICAgICAvKioKKyAgICAgICAgICogQGhpZGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBmaW5hbCBpbnQgbmF0aXZlSW50OwogICAgIH0KIAogICAgIC8qKgpAQCAtMTI0Niw4ICsxMjgyLDggQEAKICAgICAgICAgICAgICh0ZXh0Lmxlbmd0aCAtIGluZGV4IC0gY291bnQpKSA8IDApIHsKICAgICAgICAgICAgIHRocm93IG5ldyBJbm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mllZCBwYWludC4KQEAgLTEyNzcsOCArMTMxNiw4IEBACiAgICAgICAgIGlmICgoc3RhcnQgfCBlbmQgfCAoZW5kIC0gc3RhcnQpIHwgKHRleHQubGVuZ3RoKCkgLSBlbmQpKSA8IDApIHsKICAgICAgICAgICAgIHRocm93IG5ldyBJbmRleE91dE9mQm91bmRzRXhjZXB0aW9uKCk7CiAgICAgICAgIH0KLSAgICAgICAgbmF0aXZlX2RyYXdUZXh0KG1OYXRpdmVDYW52YXMsIHRleHQsIHN0YXJ0LCBlbmQsIHgsIHksCi0gICAgICAgICAgICAgICAgICAgICAgICBwYWludC5tTmF0aXZlUGFpbnQpOworICAgICAgICBuYXRpdmVfZHJhd1RleHQobU5hdGl2ZUNhbnZhcywgdGV4dCwgc3RhcnQsIGVuZCwgeCwgeSwgcGFpbnQubUJpZGlGbGFncywKKyAgICAgICAgICAgICAgICBwYWludC5tTmF0aXZlUGFpbnQpOwogICAgIH0KIAogICAgIC8qKgpAQCAtMTI5OSwxNiArMTMzOCwxMDggQEAKICAgICAgICAgaWYgKHRleHQgaW5zdGFuY2VvZiBTdHJpbmcgfHwgdGV4dCBpbnN0YW5jZW9mIFNwYW5uZWRTdHJpbmcgfHwKICAgICAgICAgICAgIHRleHQgaW5zdGFuY2VvZiBTcGFubmFibGVTdHJpbmcpIHsKICAgICAgICAgICAgIG5hdGl2ZV9kcmF3VGV4dChtTmF0aXZlQ2FudmFzLCB0ZXh0LnRvU3RyaW5nKCksIHN0YXJ0LCBlbmQsIHgsIHksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFpbnQubU5hdGl2ZVBhaW50KTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmICh0ZXh0IGluc3RhbmNlb2YgR3JhcGhpY3NPcGVyYXRpb25zKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFpbnQubUJpZGlGbGFncywgcGFpbnQubU5hdGl2ZVBhaW50KTsKKyAgICAgICAgfSBlbHNlIGlmICh0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isgICAgICogZGV0ZXJtaW5lZCBieSB0aGUgUGFpbnQncyBUZXh0QWxpZ24gdmFsdWUuCisgICAgICogCisgICAgICogQHBhcmFtIHRleHQgdGhlIHRleHQgdG8gcmVuZGVyCisgICAgICogQHBhcmFtIGluZGV4IHRoZSBzdGFydCBvZiB0aGUgdGV4dCB0byByZW5kZXIKKyAgICAgKiBAcGFyYW0gY291bnQgdGhlIGNvdW50IG9mIGNoYXJzIHRvIHJlbmRlcgorICAgICAqIEBwYXJhbSBjb250ZXh0SW5kZXggdGhlIHN0YXJ0IG9mIHRoZSBjb250ZXh0IGZvciBzaGFwaW5nLiAgTXVzdCBiZQorICAgICAqICAgICAgICAgbm8gZ3JlYXRlciB0aGFuIGluZGV4LgorICAgICAqIEBwYXJhbSBjb250ZXh0Q291bnQgdGhlIG51bWJlciBvZiBjaGFyYWN0ZXJzIGluIHRoZSBjb250ZXh0IGZvciBzaGFwaW5nLgorICAgICAqICAgICAgICAgQ29udGV4SW5kZXggKyBjb250ZXh0Q291bnQgbXVzdCBiZSBubyBsZXNzIHRoYW4gaW5kZXgKKyAgICAgKiAgICAgICAgICsgY291bnQuCisgICAgICogQHBhcmFtIHggdGhlIHggcG9zaXRpb24gYXQgd2hpY2ggdG8gZHJhdyB0aGUgdGV4dAorICAgICAqIEBwYXJhbSB5IHRoZSB5IHBvc2l0aW9uIGF0IHdoaWNoIHRvIGRyYXcgdGhlIHRleHQKKyAgICAgKiBAcGFyYW0gZGlyIHRoZSBydW4gZGlyZWN0aW9uLCBlaXRoZXIge0BsaW5rICNESVJFQ1RJT05fTFRSfSBvcgorICAgICAqICAgICAgICAge0BsaW5rICNESVJFQ1RJT05fUlRMfS4KKyAgICAgKiBAcGFyYW0gcGFpbnQgdGhlIHBhaW50CisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBkcmF3VGV4dFJ1bihjaGFyW10gdGV4dCwgaW50IGluZGV4LCBpbnQgY291bnQsCisgICAgICAgICAgICBpbnQgY29udGV4dEluZGV4LCBpbnQgY29udGV4dENvdW50LCBmbG9hdCB4LCBmbG9hdCB5LCBpbnQgZGlyLAorICAgICAgICAgICAgUGFpbnQgcGFpbnQpIHsKKworICAgICAgICBpZiAodGV4dCA9PSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgTnVsbFBvaW50ZXJFeGNlcHRpb24oInRleHQgaXMgbnVsbCIpOworICAgICAgICB9CisgICAgICAgIGlmIChwYWludCA9PSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgTnVsbFBvaW50ZXJFeGNlcHRpb24oInBhaW50IGlzIG51bGwiKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoKGluZGV4IHwgY291bnQgfCB0ZXh0Lmxlbmd0aCAtIGluZGV4IC0gY291bnQpIDwgMCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IEluZGV4T3V0T2ZCb3VuZHNFeGNlcHRpb24oKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoZGlyICE9IERJUkVDVElPTl9MVFIgJiYgZGlyICE9IERJUkVDVElPTl9SVEwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oInVua25vd24gZGlyOiAiICsgZGlyKTsKKyAgICAgICAgfQorCisgICAgICAgIG5hdGl2ZV9kcmF3VGV4dFJ1bihtTmF0aXZlQ2FudmFzLCB0ZXh0LCBpbmRleCwgY291bnQsCisgICAgICAgICAgICAgICAgY29udGV4dEluZGV4LCBjb250ZXh0Q291bnQsIHgsIHksIGRpciwgcGFpbnQubU5hdGl2ZVBhaW50KTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZW5kZXIgYSBydW4gb2YgYWxsIExUUiBvciBhbGwgUlRMIHRleHQsIHdpdGggc2hhcGluZy4gVGhpcyBkb2VzIG5vdCBydW4KKyAgICAgKiBiaWRpIG9uIHRoZSBwcm92aWRlZCB0ZXh0LCBidXQgcmVuZGVycyBpdC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CwgZmxvYXQgeCwgZmxvYXQgeSwgaW50IGRpciwKKyAgICAgICAgICAgIFBhaW50IHBhaW50KSB7CisKKyAgICAgICAgaWYgKHRleHQgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IE51bGxQb2ludGVyRXhjZXB0aW9uKCJ0ZXh0IGlzIG51bGwiKTsKKyAgICAgICAgfQorICAgICAgICBpZiAocGFpbnQgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IE51bGxQb2ludGVyRXhjZXB0aW9uKCJwYWludCBpcyBudWxsIik7CisgICAgICAgIH0KKyAgICAgICAgaWYgKChzdGFydCB8IGVuZCB8IGVuZCAtIHN0YXJ0IHwgdGV4dC5sZW5ndGgoKSAtIGVuZCkgPCAwKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSW5kZXhPdXRPZkJvdW5kc0V4Y2VwdGlvbigpOworICAgICAgICB9CisKKyAgICAgICAgaW50IGZsYWdzID0gZGlyID09IDAgPyAwIDogMTsKKworICAgICAgICBpZiAodGV4dCBpbnN0YW5jZW9mIFN0cmluZyB8fCB0ZXh0IGluc3RhbmNlb2YgU3Bhbm5lZFN0cmluZyB8fAorICAgICAgICAgICAgICAgIHRleHQgaW5zdGFuY2VvZiBTcGFubmFibGVTdHJpbmcpIHsKKyAgICAgICAgICAgIG5hdGl2ZV9kcmF3VGV4dFJ1bihtTmF0aXZlQ2FudmFzLCB0ZXh0LnRvU3RyaW5nKCksIHN0YXJ0LCBlbmQsCisgICAgICAgICAgICAgICAgICAgIGNvbnRleHRTdGFydCwgY29udGV4dEVuZCwgeCwgeSwgZmxhZ3MsIHBhaW50Lm1OYXRpdmVQYWludCk7CisgICAgICAgIH0gZWxzZSBpZiAodGV4dCBpbnN0YW5jZW9mIEdyYXBoaWNzT3BlcmF0aW9ucykgeworICAgICAgICAgICAgKChHcmFwaGljc09wZXJhdGlvbnMpIHRleHQpLmRyYXdUZXh0UnVuKHRoaXMsIHN0YXJ0LCBlbmQsCisgICAgICAgICAgICAgICAgICAgIGNvbnRleHRTdGFydCwgY29udGV4dEVuZCwgeCwgeSwgZmxhZ3MsIHBhaW50KTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGludCBjb250ZXh0TGVuID0gY29udGV4dEVuZCAtIGNvbnRleHRTdGFydDsKKyAgICAgICAgICAgIGludCBsZW4gPSBlbmQgLSBzdGFydDsKKyAgICAgICAgICAgIGNoYXJbXSBidWYgPSBUZW1wb3JhcnlCdWZmZXIub2J0YWluKGNvbnRleHRMZW4pOworICAgICAgICAgICAgVGV4dFV0aWxzLmdldENoYXJzKHRleHQsIGNvbnRleHRTdGFydCwgY29udGV4dEVuZCwgYnVmLCAwKTsKKyAgICAgICAgICAgIG5hdGl2ZV9kcmF3VGV4dFJ1bihtTmF0aXZlQ2FudmFzLCBidWYsIHN0YXJ0IC0gY29udGV4dFN0YXJ0LCBsZW4sCisgICAgICAgICAgICAgICAgICAgIDAsIGNvbnRleHRMZW4sIHgsIHksIGZsYWdzLCBwYWludC5tTmF0aXZlUGFpbnQpOwogICAgICAgICAgICAgVGVtcG9yYXJ5QnVmZmVyLnJlY3ljbGUoYnVmKTsKICAgICAgICAgfQogICAgIH0KQEAgLTE1NTUsMTAgKzE2ODYsMTkgQEAKICAgICAKICAgICBwcml2YXRlIHN0YXRpYyBuYXRpdmUgdm9pZCBuYXRpdmVfZHJhd1RleHQoaW50IG5hdGl2ZUNhbnZhcywgY2hhcltdIHRleHQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBpbmRleCwgaW50IGNvdW50LCBmbG9hdCB4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB5LCBpbnQgcGFpbnQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB5LCBpbnQgZmxhZ3MsIGludCBwYWludCk7CiAgICAgcHJpdmF0ZSBzdGF0aWMgbmF0aXZlIHZvaWQgbmF0aXZlX2RyYXdUZXh0KGludCBuYXRpdmVDYW52YXMsIFN0cmluZyB0ZXh0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc3RhcnQsIGludCBlbmQsIGZsb2F0IHgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHksIGludCBwYWludCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHksIGludCBmbGFncywgaW50IHBhaW50KTsKKworICAgIHByaXZhdGUgc3RhdGljIG5hdGl2ZSB2b2lkIG5hdGl2ZV9kcmF3VGV4dFJ1bihpbnQgbmF0aXZlQ2FudmFzLCBTdHJpbmcgdGV4dCwKKyAgICAgICAgICAgIGludCBzdGFydCwgaW50IGVuZCwgaW50IGNvbnRleHRTdGFydCwgaW50IGNvbnRleHRFbmQsCisgICAgICAgICAgICBmbG9hdCB4LCBmbG9hdCB5LCBpbnQgZmxhZ3MsIGludCBwYWludCk7CisKKyAgICBwcml2YXRlIHN0YXRpYyBuYXRpdmUgdm9pZCBuYXRpdmVfZHJhd1RleHRSdW4oaW50IG5hdGl2ZUNhbnZhcywgY2hhcltdIHRleHQsCisgICAgICAgICAgICBpbnQgc3RhcnQsIGludCBjb3VudCwgaW50IGNvbnRleHRTdGFydCwgaW50IGNvbnRleHRDb3VudCwKKyAgICAgICAgICAgIGZsb2F0IHgsIGZsb2F0IHksIGludCBmbGFncywgaW50IHBhaW50KTsKKwogICAgIHByaXZhdGUgc3RhdGljIG5hdGl2ZSB2b2lkIG5hdGl2ZV9kcmF3UG9zVGV4dChpbnQgbmF0aXZlQ2FudmFzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyW10gdGV4dCwgaW50IGluZGV4LAogICAgICAgICAgICAgICAgICAgICAgICAgIC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RldGVjdCBwYXJhZ3JhcGggZGlyZWN0aW9uIHZpYSBoZXVyaXN0aWNzLCBkZWZhdWx0aW5nIHRvCisgICAgICogUlRMLgorICAgICAqIAorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgQklESV9ERUZBVUxUX1JUTCA9IDB4MzsKKworICAgIC8qKgorICAgICAqIEJpZGkgZmxhZyB0byBvdmVycmlkZSBkaXJlY3Rpb24gdG8gYWxsIExUUiAoaWdub3JlIGJpZGkpLgorICAgICAqIAorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgQklESV9GT1JDRV9MVFIgPSAweDQ7CisKKyAgICAvKioKKyAgICAgKiBCaWRpIGZsYWcgdG8gb3ZlcnJpZGUgZGlyZWN0aW9uIHRvIGFsbCBSVEwgKGlnbm9yZSBiaWRpKS4KKyAgICAgKiAKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEJJRElfRk9SQ0VfUlRMID0gMHg1OworCisgICAgLyoqCisgICAgICogTWF4aW11bSBCaWRpIGZsYWcgdmFsdWUuCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgQklESV9NQVhfRkxBR19WQUxVRSA9IEJJRElfRk9SQ0VfUlRMOworCisgICAgLyoqCisgICAgICogTWFzayBmb3IgYmlkaSBmbGFncy4KKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBCSURJX0ZMQUdfTUFTSyA9IDB4NzsKKworICAgIC8qKgorICAgICAqIEZsYWcgZm9yIGdldFRleHRSdW5BZHZhbmNlcyBpbmRpY2F0aW5nIGxlZnQtdG8tcmlnaHQgcnVuIGRpcmVjdGlvbi4KKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IERJUkVDVElPTl9MVFIgPSAwOworCisgICAgLyoqCisgICAgICogRmxhZyBmb3IgZ2V0VGV4dFJ1bkFkdmFuY2VzIGluZGljYXRpbmcgcmlnaHQtdG8tbGVmdCBydW4gZGlyZWN0aW9uLgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRElSRUNUSU9OX1JUTCA9IDE7CisKKyAgICAvKioKKyAgICAgKiBPcHRpb24gZm9yIGdldFRleHRSdW5DdXJzb3IgdG8gY29tcHV0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WdzOwogICAgICAgICB9CiAgICAgfQogCkBAIC0yNTIsMTAgKzM3MCwzMyBAQAogICAgICAgICAgICAgbUludkNvbXBhdFNjYWxpbmcgPSAxLjBmL2ZhY3RvcjsKICAgICAgICAgfQogICAgIH0KLSAgICAKKworICAgIC8qKgorICAgICAqIFJldHVybiB0aGUgYmlkaSBmbGFncyBvbiB0aGUgcGFpbnQuCisgICAgICogCisgICAgICogQHJldHVybiB0aGUgYmlkaSBmbGFncyBvbiB0aGUgcGFpbnQKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBpbnQgZ2V0QmlkaUZsYWdzKCkgeworICAgICAgICByZXR1cm4gbUJpZGlGbGFnczsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTZXQgdGhlIGJpZGkgZmxhZ3Mgb24gdGhlIHBhaW50LgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0QmlkaUZsYWdzKGludCBmbGFncykgeworICAgICAgICAvLyBvbmx5IGZsYWcgdmFsdWUgaXMgdGhlIDMtYml0IEJJREkgY29udHJvbCBzZXR0aW5nCisgICAgICAgIGZsYWdzICY9IEJJRElfRkxBR19NQVNLOworICAgICAgICBpZiAoZmxhZ3MgPiBCSURJX01BWF9GTEFHX1ZBTFVFKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJ1bmtub3duIGJpZGkgZmxhZzogIiArIGZsYWdzKTsKKyAgICAgICAgfQorICAgICAgICBtQmlkaUZsYWdzID0gZmxhZ3M7CisgICAgfQorCiAgICAgLyoqCiAgICAgICogUmV0dXJuIHRoZSBwYWludCdzIGZsYWdzLiBVc2UgdGhlIEZsYWcgZW51bSB0byB0ZXN0IGZsYWcgdmFsdWVzLgotICAgICAqCisgICAgICogCiAgICAgICogQHJldHVybiB0aGUgcGFpbnQncyBmbGFncyAoc2VlIGVudW1zIGVuZGluZyBpbiBfRmxhZyBmb3IgYml0IG1hc2tzKQogICAgICAqLwogICAgIHB1YmxpYyBuYXRpdmUgaW50IGdldEZsYWdzKCk7CkBAIC0xMjMyLDEwICsxMzczLDEwIEBACiAgICAgICAgIH0KIAogICAgICAgICBjaGFyW10gYnVmID0gVGVtcG9yYXJ5QnVmZmVyLm9idGFpbihlbmQgLSBzdGFydCk7Ci0gICAgCVRleHRVdGlscy5nZXRDaGFycyh0ZXh0LCBzdGFydCwgZW5kLCBidWYsIDApOwotICAgIAlpbnQgcmVzdWx0ID0gZ2V0VGV4dFdpZHRocyhidWYsIDAsIGVuZCAtIHN0YXJ0LCB3aWR0aHMpOworICAgICAgICBUZXh0VXRpbHMuZ2V0Q2hhcnModGV4dCwgc3RhcnQsIGVuZCwgYnVmLCAwKTsKKyAgICAgICAgaW50IHJlc3VsdCA9IGdldFRleHRXaWR0aHMoYnVmLCAwLCBlbmQgLSBzdGFydCwgd2lkdGhzKTsKICAgICAgICAgVGVtcG9yYXJ5QnVmZmVyLnJlY3ljbGUoYnVmKTsKLSAgICAJcmV0dXJuIHJlc3VsdDsKKyAgICAgICAgcmV0dXJuIHJlc3VsdDsKICAgICB9CiAKICAgICAvKioKQEAgLTEyODIsNiArMTQyMywyODQgQEAKICAgICB9CiAKICAgICAvKioKKyAgICAgKiBDb252ZW5pZW5jZSBvdmVybG9hZCB0aGF0IHRha2VzIGEgY2hhciBhcnJheSBpbnN0ZWFkIG9mIGEKKyAgICAgKiBTdHJpbmcuCisgICAgICoKKyAgICAgKiBAc2VlICNnZXRUZXh0UnVuQWR2YW5jZXMoU3RyaW5nLCBpbnQsIGludCwgaW50LCBpbnQsIGludCwgZmxvYXRbXSwgaW50KQorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIGZsb2F0IGdldFRleHRSdW5BZHZhbmNlcyhjaGFyW10gY2hhcnMsIGludCBpbmRleCwgaW50IGNvdW50LAorICAgICAgICAgICAgaW50IGNvbnRleHRJbmRleCwgaW50IGNvbnRleHRDb3VudCwgaW50IGZsYWdzLCBmbG9hdFtdIGFkdmFuY2VzLAorICAgICAgICAgICAgaW50IGFkdmFuY2VzSW5kZXgpIHsKKworICAgICAgICBpZiAoKGluZGV4IHwgY291bnQgfCBjb250ZXh0SW5kZXggfCBjb250ZXh0Q291bnQgfCBhZHZhbmNlc0luZGV4CisgICAgICAgICAgICAgICAgfCAoaW5kZXggLSBjb250ZXh0SW5kZXgpCisgICAgICAgICAgICAgICAgfCAoKGNvbnRleHRJbmRleCArIGNvbnRleHRDb3VudCkgLSAoaW5kZXggKyBjb3VudCkpCisgICAgICAgICAgICAgICAgfCAoY2hhcnMubGVuZ3RoIC0gKGNvbnRleHRJbmRleCArIGNvbnRleHRDb3VudCkpCisgICAgICAgICAgICAgICAgfCAoYWR2YW5jZXMgPT0gbnVsbCA/IDAgOgorICAgICAgICAgICAgICAgICAgICAoYWR2YW5jZXMubGVuZ3RoIC0gKGFkdmFuY2VzSW5kZXggKyBjb3VudCkpKSkgPCAwKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSW5kZXhPdXRPZkJvdW5kc0V4Y2VwdGlvbigpOworICAgICAgICB9CisgICAgICAgIGlmIChmbGFncyAhPSBESVJFQ1RJT05fTFRSICYmIGZsYWdzICE9IERJUkVDVElPTl9SVEwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oInVua25vd24gZmxhZ3MgdmFsdWU6ICIgKyBmbGFncyk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoIW1IYXNDb21wYXRTY2FsaW5nKSB7CisgICAgICAgICAgICByZXR1cm4gbmF0aXZlX2dldFRleHRSdW5BZHZhbmNlcyhtTmF0aXZlUGFpbnQsIGNoYXJzLCBpbmRleCwgY291bnQsCisgICAgICAgICAgICAgICAgICAgIGNvbnRleHRJbmRleCwgY29udGV4dENvdW50LCBmbGFncywgYWR2YW5jZXMsIGFkdmFuY2VzSW5kZXgpOworICAgICAgICB9CisKKyAgICAgICAgZmluYWwgZmxvYXQgb2xkU2l6ZSA9IGdldFRleHRTaXplKCk7CisgICAgICAgIHNldFRleHRTaXplKG9sZFNpemUgKiBtQ29tcGF0U2NhbGluZyk7CisgICAgICAgIGZsb2F0IHJlcyA9IG5hdGl2ZV9nZXRUZXh0UnVuQWR2YW5jZXMobU5hdGl2ZVBhaW50LCBjaGFycywgaW5kZXgsIGNvdW50LAorICAgICAgICAgICAgICAgIGNvbnRleHRJbmRleCwgY29udGV4dENvdW50LCBmbGFncywgYWR2YW5jZXMsIGFkdmFuY2VzSW5kZXgpOworICAgICAgICBzZXRUZXh0U2l6ZShvbGRTaXplKTsKKworICAgICAgICBpZiAoYWR2YW5jZXMgIT0gbnVsbCkgeworICAgICAgICAgICAgZm9yIChpbnQgaSA9IGFkdmFuY2VzSW5kZXgsIGUgPSBpICsgY291bnQ7IGkgPCBlOyBpKyspIHsKKyAgICAgICAgICAgICAgICBhZHZhbmNlc1tpXSAqPSBtSW52Q29tcGF0U2NhbGluZzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcmVzICogbUludkNvbXBhdFNjYWxpbmc7IC8vIGFzc3VtZSBlcnJvcnMgYXJlIG5vdCBzaWduaWZpY2FudAorICAgIH0KKworICAgIC8qKgorICAgICAqIENvbnZlbmllbmNlIG92ZXJsb2FkIHRoYXQgdGFrZXMgYSBDaGFyU2VxdWVuY2UgaW5zdGVhZCBvZiBhCisgICAgICogU3RyaW5nLgorICAgICAqCisgICAgICogQHNlZSAjZ2V0VGV4dFJ1bkFkdmFuY2VzKFN0cmluZywgaW50LCBpbnQsIGludCwgaW50LCBpbnQsIGZsb2F0W10sIGludCkKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBmbG9hdCBnZXRUZXh0UnVuQWR2YW5jZXMoQ2hhclNlcXVlbmNlIHRleHQsIGludCBzdGFydCwgaW50IGVuZCwKKyAgICAgICAgICAgIGludCBjb250ZXh0U3RhcnQsIGludCBjb250ZXh0RW5kLCBpbnQgZmxhZ3MsIGZsb2F0W10gYWR2YW5jZXMsCisgICAgICAgICAgICBpbnQgYWR2YW5jZXNJbmRleCkgeworCisgICAgICAgIGlmICh0ZXh0IGluc3RhbmNlb2YgU3RyaW5nKSB7CisgICAgICAgICAgICByZXR1cm4gZ2V0VGV4dFJ1bkFkdmFuY2VzKChTdHJpbmcpIHRleHQsIHN0YXJ0LCBlbmQsCisgICAgICAgICAgICAgICAgICAgIGNvbnRleHRTdGFydCwgY29udGV4dEVuZCwgZmxhZ3MsIGFkdmFuY2VzLCBhZHZhbmNlc0luZGV4KTsKKyAgICAgICAgfQorICAgICAgICBpZiAodGV4dCBpbnN0YW5jZW9mIFNwYW5uZWRTdHJpbmcgfHwKKyAgICAgICAgICAgIHRleHQgaW5zdGFuY2VvZiBTcGFubmFibGVTdHJpbmcpIHsKKyAgICAgICAgICAgIHJldHVybiBnZXRUZXh0UnVuQWR2YW5jZXModGV4dC50b1N0cmluZygpLCBzdGFydCwgZW5kLAorICAgICAgICAgICAgICAgICAgICBjb250ZXh0U3RhcnQsIGNvbnRleHRFbmQsIGZsYWdzLCBhZHZhbmNlcywgYWR2YW5jZXNJbmRleCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHRleHQgaW5zdGFuY2VvZiBHcmFwaGljc09wZXJhdGlvbnMpIHsKKyAgICAgICAgICAgIHJldHVybiAoKEdyYXBoaWNzT3BlcmF0aW9ucykgdGV4dCkuZ2V0VGV4dFJ1bkFkdmFuY2VzKHN0YXJ0LCBlbmQsCisgICAgICAgICAgICAgICAgICAgIGNvbnRleHRTdGFydCwgY29udGV4dEVuZCwgZmxhZ3MsIGFkdmFuY2VzLCBhZHZhbmNlc0luZGV4LCB0aGlzKTsKKyAgICAgICAgfQorCisgICAgICAgIGludCBjb250ZXh0TGVuID0gY29udGV4dEVuZCAtIGNvbnRleHRTdGFydDsKKyAgICAgICAgaW50IGxlbiA9IGVuZCAtIHN0YXJ0OworICAgICAg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0cmluZyB0ZXh0LCBpbnQgc3RhcnQsIGludCBlbmQsIGludCBjb250ZXh0U3RhcnQsCisgICAgICAgICAgICBpbnQgY29udGV4dEVuZCwgaW50IGZsYWdzLCBmbG9hdFtdIGFkdmFuY2VzLCBpbnQgYWR2YW5jZXNJbmRleCkgeworCisgICAgICAgIGlmICgoc3RhcnQgfCBlbmQgfCBjb250ZXh0U3RhcnQgfCBjb250ZXh0RW5kIHwgYWR2YW5jZXNJbmRleCB8IChlbmQgLSBzdGFydCkKKyAgICAgICAgICAgICAgICB8IChzdGFydCAtIGNvbnRleHRTdGFydCkgfCAoY29udGV4dEVuZCAtIGVuZCkKKyAgICAgICAgICAgICAgICB8ICh0ZXh0Lmxlbmd0aCgpIC0gY29udGV4dEVuZCkKKyAgICAgICAgICAgICAgICB8IChhZHZhbmNlcyA9PSBudWxsID8gMCA6CisgICAgICAgICAgICAgICAgICAgIChhZHZhbmNlcy5sZW5ndGggLSBhZHZhbmNlc0luZGV4IC0gKGVuZCAtIHN0YXJ0KSkpKSA8IDApIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbmRleE91dE9mQm91bmRzRXhjZXB0aW9uKCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGZsYWdzICE9IERJUkVDVElPTl9MVFIgJiYgZmxhZ3MgIT0gRElSRUNUSU9OX1JUTCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigidW5rbm93biBmbGFncyB2YWx1ZTogIiArIGZsYWdzKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmICghbUhhc0NvbXBhdFNjYWxpbmcpIHsKKyAgICAgICAgICAgIHJldHVybiBuYXRpdmVfZ2V0VGV4dFJ1bkFkdmFuY2VzKG1OYXRpdmVQYWludCwgdGV4dCwgc3RhcnQsIGVuZCwKKyAgICAgICAgICAgICAgICAgICAgY29udGV4dFN0YXJ0LCBjb250ZXh0RW5kLCBmbGFncywgYWR2YW5jZXMsIG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hlIGN1cnNvciwgb25lIG9mIHtAbGluayAjQ1VSU09SX0FGVEVSfSwKKyAgICAgKiB7QGxpbmsgI0NVUlNPUl9BVF9PUl9BRlRFUn0sIHtAbGluayAjQ1VSU09SX0JFRk9SRX0sCisgICAgICoge0BsaW5rICNDVVJTT1JfQVRfT1JfQkVGT1JFfSwgb3Ige0BsaW5rICNDVVJTT1JfQVR9CisgICAgICogQHJldHVybiB0aGUgb2Zmc2V0IG9mIHRoZSBuZXh0IHBvc2l0aW9uLCBvciAtMQorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIGludCBnZXRUZXh0UnVuQ3Vyc29yKGNoYXJbXSB0ZXh0LCBpbnQgY29udGV4dFN0YXJ0LCBpbnQgY29udGV4dExlbmd0aCwKKyAgICAgICAgICAgIGludCBmbGFncywgaW50IG9mZnNldCwgaW50IGN1cnNvck9wdCkgeworICAgICAgICBpbnQgY29udGV4dEVuZCA9IGNvbnRleHRTdGFydCArIGNvbnRleHRMZW5ndGg7CisgICAgICAgIGlmICgoKGNvbnRleHRTdGFydCB8IGNvbnRleHRFbmQgfCBvZmZzZXQgfCAoY29udGV4dEVuZCAtIGNvbnRleHRTdGFydCkKKyAgICAgICAgICAgICAgICB8IChvZmZzZXQgLSBjb250ZXh0U3RhcnQpIHwgKGNvbnRleHRFbmQgLSBvZmZzZXQpCisgICAgICAgICAgICAgICAgfCAodGV4dC5sZW5ndGggLSBjb250ZXh0RW5kKSB8IGN1cnNvck9wdCkgPCAwKQorICAgICAgICAgICAgICAgIHx8IGN1cnNvck9wdCA+IENVUlNPUl9PUFRfTUFYX1ZBTFVFKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSW5kZXhPdXRPZkJvdW5kc0V4Y2VwdGlvbigpOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIG5hdGl2ZV9nZXRUZXh0UnVuQ3Vyc29yKG1OYXRpdmVQYWludCwgdGV4dCwKKyAgICAgICAgICAgICAgICBjb250ZXh0U3Rhc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zZXQsIGN1cnNvck9wdCk7CisgICAgfQorCisgICAgLyoqCiAgICAgICogUmV0dXJuIHRoZSBwYXRoIChvdXRsaW5lKSBmb3IgdGhlIHNwZWNpZmllZCB0ZXh0LgogICAgICAqIE5vdGU6IGp1c3QgbGlrZSBDYW52YXMuZHJhd1RleHQsIHRoaXMgd2lsbCByZXNwZWN0IHRoZSBBbGlnbiBzZXR0aW5nIGluCiAgICAgICogdGhlIHBhaW50LgpAQCAtMTQwNCw2ICsxODIzLDE5IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhcltdIHRleHQsIGludCBpbmRleCwgaW50IGNvdW50LCBmbG9hdFtdIHdpZHRocyk7CiAgICAgcHJpdmF0ZSBzdGF0aWMgbmF0aXZlIGludCBuYXRpdmVfZ2V0VGV4dFdpZHRocyhpbnQgbmF0aXZlX29iamVjdCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgdGV4dCwgaW50IHN0YXJ0LCBpbnQgZW5kLCBmbG9hdFtdIHdpZHRocyk7CisKKyAgICBwcml2YXRlIHN0YXRpYyBuYXRpdmUgZmxvYXQgbmF0aXZlX2dldFRleHRSdW5BZHZhbmNlcyhpbnQgbmF0aXZlX29iamVjdCwKKyAgICAgICAgICAgIGNoYXJbXSB0ZXh0LCBpbnQgaW5kZXgsIGludCBjb3VudCwgaW50IGNvbnRleHRJbmRleCwgaW50IGNvbnRleHRDb3VudCwKKyAgICAgICAgICAgIGludCBmbGFncywgZmxvYXRbXSBhZHZhbmNlcywgaW50IGFkdmFuY2VzSW5kZXgpOworICAgIHByaXZhdGUgc3RhdGljIG5hdGl2ZSBmbG9hdCBuYXRpdmVfZ2V0VGV4dFJ1bkFkdmFuY2VzKGludCBuYXRpdmVfb2JqZWN0LAorICAgICAgICAgICAgU3RyaW5nIHRleHQsIGludCBzdGFydCwgaW50IGVuZCwgaW50IGNvbnRleHRTdGFydCwgaW50IGNvbnRleHRFbmQsCisgICAgICAgICAgICBpbnQgZ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XF1YWxzKCJtaXBtYXAiKSkgeworICAgICAgICAgICAgZHJhd2FibGUgPSBuZXcgTWlwbWFwRHJhd2FibGUoKTsKICAgICAgICAgfSBlbHNlIGlmIChuYW1lLmVxdWFscygibGF5ZXItbGlzdCIpKSB7CiAgICAgICAgICAgICBkcmF3YWJsZSA9IG5ldyBMYXllckRyYXdhYmxlKCk7CiAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5lcXVhbHMoInRyYW5zaXRpb24iKSkgewpAQCAtNzcxLDcgKzc4NCw3IEBACiAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5lcXVhbHMoImluc2V0IikpIHsKICAgICAgICAgICAgIGRyYXdhYmxlID0gbmV3IEluc2V0RHJhd2FibGUoKTsKICAgICAgICAgfSBlbHNlIGlmIChuYW1lLmVxdWFscygiYml0bWFwIikpIHsKLSAgICAgICAgICAgIGRyYXdhYmxlID0gbmV3IEJpdG1hcERyYXdhYmxlKCk7CisgICAgICAgICAgICBkcmF3YWJsZSA9IG5ldyBCaXRtYXBEcmF3YWJsZShyKTsKICAgICAgICAgICAgIGlmIChyICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICgoQml0bWFwRHJhd2FibGUpIGRyYXdhYmxlKS5zZXRUYXJnZXREZW5zaXR5KHIuZ2V0RGlzcGxheU1ldHJpY3MoKSk7CiAgICAgICAgICAgICB9CkBAIC04MDYsNiArODE5LDkgQEAKICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgfQogCisgICAgLyoqCisgICAgICogSW5mbGF0ZSB0aGlzIERyYXdhYmxlIGZyb20gYW4gWE1MIHJlc291cmNlLgorICAgICAqLwogICAgIHB1YmxpYyB2b2lkIGluZmxhdGUoUmVzb3VyY2VzIHIsIFhtbFB1bGxQYXJzZXIgcGFyc2VyLCBBdHRyaWJ1dGVTZXQgYXR0cnMpCiAgICAgICAgICAgICB0aHJvd3MgWG1sUHVsbFBhcnNlckV4Y2VwdGlvbiwgSU9FeGNlcHRpb24gewogCkBAIC04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gICAgIGludCB0eXBlOworCisgICAgICAgIGZpbmFsIGludCBpbm5lckRlcHRoID0gcGFyc2VyLmdldERlcHRoKCkgKyAxOworICAgICAgICBpbnQgZGVwdGg7CisgICAgICAgIHdoaWxlICgodHlwZSA9IHBhcnNlci5uZXh0KCkpICE9IFhtbFB1bGxQYXJzZXIuRU5EX0RPQ1VNRU5UCisgICAgICAgICAgICAgICAgJiYgKChkZXB0aCA9IHBhcnNlci5nZXREZXB0aCgpKSA+PSBpbm5lckRlcHRoCisgICAgICAgICAgICAgICAgICAgICAgICB8fCB0eXBlICE9IFhtbFB1bGxQYXJzZXIuRU5EX1RBRykpIHsKKyAgICAgICAgICAgIGlmICh0eXBlICE9IFhtbFB1bGxQYXJzZXIuU1RBUlRfVEFHKSB7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChkZXB0aCA+IGlubmVyRGVwdGggfHwgIXBhcnNlci5nZXROYW1lKCkuZXF1YWxzKCJpdGVtIikpIHsKKyAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgVHlwZWRBcnJheSBhID0gci5vYnRhaW5BdHRyaWJ1dGVzKGF0dHJzLAorICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5NaXBtYXBEcmF3YWJsZUl0ZW0pOworCisgICAgICAgICAgICBpbnQgZHJhd2FibGVSZXMgPSBhLmdldFJlc291cmNlSWQoCisgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLk1pcG1hcERyYXdhYmxlSXRlbV9kcmF3YWJsZSwgMCk7CisKKyAgICAgICAgICAgIGEucmVjeWNsZSgpOworCisgICAgICAgICAgICBEcmF3YWJsZSBkcjsKKyAgICAgICAgICAgIGlmIChkcmF3YWJsZVJlcyAhPSAwKSB7CisgICAgICAgICAgICAgICAgZHIgPSByLmdldERyYXdhYmxlKGRyYXdhYmxlUmVzKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgd2hpbGUgKCh0eXBlID0gcGFyc2VyLm5leHQoKSkgPT0gWG1sUHVsbFBhcnNlci5URVhUKSB7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICh0eXBlICE9IFhtbFB1bGxQYXJzZXIuU1RBUlRfVEFHKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBYbWxQdWxsUGFyc2VyRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlci5nZXRQb3NpdGlvbkRlc2NyaXB0aW9uKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArICI6IDxpdGVtPiB0YWcgcmVxdWlyZXMgYSAnZHJhd2FibGUnIGF0dHJpYnV0ZSBvciAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiY2hpbGQgdGFnIGRlZmluaW5nIGEgZHJhd2FibGUiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZHIgPSBEcmF3YWJsZS5jcmVhdGVGcm9tWG1sSW5uZXIociwgcGFyc2VyLCBhdHRycyk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1NaXBtYXBDb250YWluZXJTdGF0ZS5hZGREcmF3YWJsZShkcik7CisgICAgICAgIH0KKworICAgICAgICBvbkRyYXdhYmxlQWRkZWQoKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgRHJhd2FibGUgbXV0YXRlKCkgeworICAgICAgICBpZiAoIW1NdXRhdGVkICYmIHN1cGVyLm11dGF0ZSgpID09IHRoaXMpIHsKKyAgICAgICAgICAgIG1NaXBtYXBDb250YWluZXJTdGF0ZS5tTWlwbWFwSGVpZ2h0cyA9IG1NaXBtYXBDb250YWluZXJTdGF0ZS5tTWlwbWFwSGVpZ2h0cy5jbG9uZSgpOworICAgICAgICAgICAgbU11dGF0ZWQgPSB0cnVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgc3RhdGljIGNsYXNzIE1pcG1hcENvbnRhaW5lclN0YXRlIGV4dGVuZHMgRHJhd2FibGVDb250YWluZXJTdGF0ZSB7CisgICAgICAgIHByaXZhdGUgaW50W10gbU1pcG1hcEhlaWdodHM7CisKKyAgICAgICAgTWlwbWFwQ29udGFpbmVyU3RhdGUoTWlwbWFwQ29udGFpbmVyU3RhdGUgb3JpZywgTWlwbWFwRHJhd2FibGUgb3duZXIsIFJlc291cmNlcyByZXMpIHsKKyAgICAgICAgICAgIHN1cGVyKG9yaWcsIG93bmVyLCByZXMpOworCisgICAgICAgICAgICBpZiAob3JpZyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbU1pcG1hcEhlaWdodHMgPSBvcmlnLm1NaXBtYXBIZWlnaHRzOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtTWlwbWFwSGVpZ2h0cyA9IG5ldyBpbnRbZ2V0Q2hpbGRyZW4oKS5sZW5ndGhdOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBDaGFuZ2UgdGhlIGRlZmF1bHQgdmFsdWUKKyAgICAgICAgICAgIHNldENvbnN0YW50U2l6ZSh0cnVlKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBSZXR1cm5zIHRoZSBpbmRleCBvZiB0aGUgY2hpbGQgbWlwbWFwIGRyYXdhYmxlIHRoYXQgd2lsbCBiZXN0IGZpdCB0aGUgcHJvdmlkZWQgYm91bmRzLgorICAgICAgICAgKiBUaGlzIGluZGV4IGlzIGRldGVybWluZWQgYnkgY29tcGFyaW5nIGJvdW5kcycgaGVpZ2h0IGFuZCBjaGlsZHJlbiBpbnRyaW5zaWMgaGVpZ2h0cy4KKyAgICAgICAgICogVGhlIHJldHVybmVkIG1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dhYmxlIHRvIHJlc3RvcmUgdGhlIHNvcnQgYnkgaW50cmluc2ljIGhlaWdodAorICAgICAgICAgICAgZmluYWwgaW50IGRyYXdhYmxlSGVpZ2h0ID0gZHJhd2FibGUuZ2V0SW50cmluc2ljSGVpZ2h0KCk7CisKKyAgICAgICAgICAgIHdoaWxlIChwb3MgPiAwKSB7CisgICAgICAgICAgICAgICAgZmluYWwgRHJhd2FibGUgcHJldmlvdXNEcmF3YWJsZSA9IG1EcmF3YWJsZXNbcG9zLTFdOworICAgICAgICAgICAgICAgIGZpbmFsIGludCBwcmV2aW91c0ludHJpbnNpY0hlaWdodCA9IHByZXZpb3VzRHJhd2FibGUuZ2V0SW50cmluc2ljSGVpZ2h0KCk7CisKKyAgICAgICAgICAgICAgICBpZiAoZHJhd2FibGVIZWlnaHQgPCBwcmV2aW91c0ludHJpbnNpY0hlaWdodCkgeworICAgICAgICAgICAgICAgICAgICBtRHJhd2FibGVzW3Bvc10gPSBwcmV2aW91c0RyYXdhYmxlOworICAgICAgICAgICAgICAgICAgICBtTWlwbWFwSGVpZ2h0c1twb3NdID0gcHJldmlvdXNJbnRyaW5zaWNIZWlnaHQ7CisKKyAgICAgICAgICAgICAgICAgICAgbURyYXdhYmxlc1twb3MtMV0gPSBkcmF3YWJsZTsKKyAgICAgICAgICAgICAgICAgICAgbU1pcG1hcEhlaWdodHNbcG9zLTFdID0gZHJhd2FibGVIZWlnaHQ7CisgICAgICAgICAgICAgICAgICAgIHBvcy0tOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBJbnRyaW5zaWMgc2l6ZXMgYXJlIHRob3NlIG9mIHRoZSBsYXJnZXN0IGF2YWlsYWJsZSBtaXBtYXAuCisgICAgICAgICAqIE1pbmltdW0gc2l6ZXMgYXJlIHRob3NlIG9mIHRoZSBzbWFsbGVzdCBhdmFpbGFibGUgbWlwbWFwLgorICAgICAgICAgKi8KKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIGNvbXB1dGVDb25zdGFudFNpemUoKSB7CisgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IGdldENoaWxkQ291bnQoKTsKKyAgICAgICAgICAgIGlmIChOID4gMCkgeworICAgICAgICAgICAgICAgIGZpbmFsIERyYXdhYmxlIHNtYWxsZXN0RHJhd2FibGUgPSBtRHJhd2FibGVzWzBdOworICAgICAgICAgICAgICAgIG1Db25zdGFudE1pbmltdW1XaWR0aCA9IHNtYWxsZXN0RHJhd2FibGUuZ2V0TWluaW11bVdpZHRoKCk7CisgICAgICAgICAgICAgICAgbUNvbnN0YW50TWluaW11bUhlaWdodCA9IHNtYWxsZXN0RHJhd2FibGUuZ2V0TWluaW11bUhlaWdodCgpOworCisgICAgICAgICAgICAgICAgZmluYWwgRHJhd2FibGUgbGFyZ2VzdERyYXdhYmxlID0gbURyYXdhYmxlc1tOLTFdOworICAgICAgICAgICAgICAgIG1Db25zdGFudFdpZHRoID0gbGFyZ2VzdERyYXdhYmxlLmdldEludHJpbnNpY1dpZHRoKCk7CisgICAgICAgICAgICAgICAgbUNvbnN0YW50SGVpZ2h0ID0gbGFyZ2VzdERyYXdhYmxlLmdldEludHJpbnNpY0hlaWdodCgpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtQ29uc3RhbnRXaWR0aCA9IG1Db25zdGFudEhlaWdodCA9IC0xOworICAgICAgICAgICAgICAgIG1Db25zdGFudE1pbmltdW1XaWR0aCA9IG1Db25zdGFudE1pbmltdW1IZWlnaHQgPSAwOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUNvbXB1dGVkQ29uc3RhbnRTaXplID0gdHJ1ZTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgRHJhd2FibGUgbmV3RHJhd2FibGUoKSB7CisgICAgICAgICAgICByZXR1cm4gbmV3IE1pcG1hcERyYXdhYmxlKHRoaXMsIG51bGwpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBEcmF3YWJsZSBuZXdEcmF3YWJsZShSZXNvdXJjZXMgcmVzKSB7CisgICAgICAgICAgICByZXR1cm4gbmV3IE1pcG1hcERyYXdhYmxlKHRoaXMsIHJlcyk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgZ3Jvd0FycmF5KGludCBvbGRTaXplLCBpbnQgbmV3U2l6ZSkgeworICAgICAgICAgICAgc3VwZXIuZ3Jvd0FycmF5KG9sZFNpemUsIG5ld1NpemUpOworICAgICAgICAgICAgaW50W10gbmV3SW50cyA9IG5ldyBpbnRbbmV3U2l6ZV07CisgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KG1NaXBtYXBIZWlnaHRzLCAwLCBuZXdJbnRzLCAwLCBvbGRTaXplKTsKKyAgICAgICAgICAgIG1NaXBtYXBIZWlnaHRzID0gbmV3SW50czsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgTWlwbWFwRHJhd2FibGUoTWlwbWFwQ29udGFpbmVyU3RhdGUgc3RhdGUsIFJlc291cmNlcyByZXMpIHsKKyAgICAgICAgTWlwbWFwQ29udGFpbmVyU3RhdGUgYXMgPSBuZXcgTWlwbWFwQ29udGFpbmVyU3RhdGUoc3RhdGUsIHRoaXMsIHJlcyk7CisgICAgICAgIG1NaXBtYXBDb250YWluZXJTdGF0ZSA9IGFzOworICAgICAgICBzZXRDb25zdGFudFN0YXRlKGFzKTsKKyAgICAgICAgb25EcmF3YWJsZUFkZGVkKCk7CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvZ3JhcGhpY3MvamF2YS9hbmRyb2lkL3JlbmRlcnNjcmlwdC9BbGxvY2F0aW9uLmphdmEg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KTsKKyAgICB9CisKICAgICBwcml2YXRlIHZvaWQgZGF0YTFEQ2hlY2tzKGludCBvZmYsIGludCBjb3VudCwgaW50IGxlbiwgaW50IGRhdGFTaXplKSB7CiAgICAgICAgIG1SUy52YWxpZGF0ZSgpOwotICAgICAgICBpZigob2ZmIDwgMCkgfHwgKGNvdW50IDwgMSkgfHwgKChvZmYgKyBjb3VudCkgPiBtVHlwZS5nZXRFbGVtZW50Q291bnQoKSkpIHsKLSAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIk9mZnNldCBvciBDb3VudCBvdXQgb2YgYm91bmRzLiIpOworICAgICAgICBpZihvZmYgPCAwKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJPZmZzZXQgbXVzdCBiZSA+PSAwLiIpOworICAgICAgICB9CisgICAgICAgIGlmKGNvdW50IDwgMSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiQ291bnQgbXVzdCBiZSA+PSAxLiIpOworICAgICAgICB9CisgICAgICAgIGlmKChvZmYgKyBjb3VudCkgPiBtVHlwZS5nZXRFbGVtZW50Q291bnQoKSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiT3ZlcmZsb3csIEF2YWlsYWJsZSBjb3VudCAiICsgbVR5cGUuZ2V0RWxlbWVudENvdW50KCkgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiLCBnb3QgIiArIGNvdW50ICsgIiBhdCBvZmZzZXQgIiArIG9mZiArICIuIik7CiAgICAgICAgIH0KICAgICAgICAgaWYoKGxlbikgPCBkYXRhU2l6ZSkgewogICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiQXJyYXkgdG9vIHNtYWxsIGZv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1JBTV9GUkFHTUVOVCAoMjEsIDQpLAotICAgICAgICBSU19QUk9HUkFNX1ZFUlRFWCAoMjIsIDQpLAotICAgICAgICBSU19QUk9HUkFNX1JBU1RFUiAoMjMsIDQpLAotICAgICAgICBSU19QUk9HUkFNX1NUT1JFICgyNCwgNCk7CisgICAgICAgIFVOU0lHTkVEXzVfNl81ICgxMywgMiksCisgICAgICAgIFVOU0lHTkVEXzVfNV81XzEgKDE0LCAyKSwKKyAgICAgICAgVU5TSUdORURfNF80XzRfNCAoMTUsIDIpLAorCisgICAgICAgIFJTX0VMRU1FTlQgKDE2LCA0KSwKKyAgICAgICAgUlNfVFlQRSAoMTcsIDQpLAorICAgICAgICBSU19BTExPQ0FUSU9OICgxOCwgNCksCisgICAgICAgIFJTX1NBTVBMRVIgKDE5LCA0KSwKKyAgICAgICAgUlNfU0NSSVBUICgyMCwgNCksCisgICAgICAgIFJTX01FU0ggKDIxLCA0KSwKKyAgICAgICAgUlNfUFJPR1JBTV9GUkFHTUVOVCAoMjIsIDQpLAorICAgICAgICBSU19QUk9HUkFNX1ZFUlRFWCAoMjMsIDQpLAorICAgICAgICBSU19QUk9HUkFNX1JBU1RFUiAoMjQsIDQpLAorICAgICAgICBSU19QUk9HUkFNX1NUT1JFICgyNSwgNCk7CiAKICAgICAgICAgaW50IG1JRDsKICAgICAgICAgaW50IG1TaXplOwpAQCAtNzIsMTIgKzc0LDYgQEAKIAogICAgIHB1YmxpYyBlbnVtIERhdGFLaW5kIHsKICAgICAgICAgVVNFUiAoMCksCi0gICAgICAgIENPTE9SICgxKSwKLSAgICAgICAgUE9TSVRJT04gKDIpLAotICAgICAgICBURVhUVVJFICgzKSwKLSAgICAgICAgTk9STUFMICg0KSwKLSAgICAgICAgSU5ERVggKDUpLAotICAgICAgICBQT0lOVF9TSVpFKDYpLAogCiAgICAgICAgIFBJWEVMX0wgKDcpLAogICAgICAgICBQSVhFTF9BICg4KSwKQEAgLTkxLDQxICs4NywxMzMgQEAKICAgICAgICAgfQogICAgIH0KIAotICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBVU0VSX1U4KFJlbmRlclNjcmlwdCBycykgewotICAgICAgICBpZihycy5tRWxlbWVudF9VU0VSX1U4ID09IG51bGwpIHsKLSAgICAgICAgICAgIHJzLm1FbGVtZW50X1VTRVJfVTggPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5VTlNJR05FRF84KTsKKyAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgQk9PTEVBTihSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgaWYocnMubUVsZW1lbnRfQk9PTEVBTiA9PSBudWxsKSB7CisgICAgICAgICAgICBycy5tRWxlbWVudF9CT09MRUFOID0gY3JlYXRlVXNlcihycywgRGF0YVR5cGUuQk9PTEVBTik7CiAgICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X1VTRVJfVTg7CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9CT09MRUFOOwogICAgIH0KIAotICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBVU0VSX0k4KFJlbmRlclNjcmlwdCBycykgewotICAgICAgICBpZihycy5tRWxlbWVudF9VU0VSX0k4ID09IG51bGwpIHsKLSAgICAgICAgICAgIHJzLm1FbGVtZW50X1VTRVJfSTggPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5TSUdORURfOCk7CisgICAgcHVibGljIHN0YXRpYyBFbGVtZW50IFU4KFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tRWxlbWVudF9VOCA9PSBudWxsKSB7CisgICAgICAgICAgICBycy5tRWxlbWVudF9VOCA9IGNyZWF0ZVVzZXIocnMsIERhdGFUeXBlLlVOU0lHTkVEXzgpOwogICAgICAgICB9Ci0gICAgICAgIHJldHVybiBycy5tRWxlbWVudF9VU0VSX0k4OworICAgICAgICByZXR1cm4gcnMubUVsZW1lbnRfVTg7CiAgICAgfQogCi0gICAgcHVibGljIHN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xlbWVudCBVU0VSX0YzMihSZW5kZXJTY3JpcHQgcnMpIHsKLSAgICAgICAgaWYocnMubUVsZW1lbnRfVVNFUl9GMzIgPT0gbnVsbCkgewotICAgICAgICAgICAgcnMubUVsZW1lbnRfVVNFUl9GMzIgPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5GTE9BVF8zMik7CisgICAgcHVibGljIHN0YXRpYyBFbGVtZW50IEkxNihSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgaWYocnMubUVsZW1lbnRfSTE2ID09IG51bGwpIHsKKyAgICAgICAgICAgIHJzLm1FbGVtZW50X0kxNiA9IGNyZWF0ZVVzZXIocnMsIERhdGFUeXBlLlNJR05FRF8xNik7CiAgICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X1VTRVJfRjMyOworICAgICAgICByZXR1cm4gcnMubUVsZW1lbnRfSTE2OwogICAgIH0KIAorICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBVMzIoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1FbGVtZW50X1UzMiA9PSBudWxsKSB7CisgICAgICAgICAgICBycy5tRWxlbWVudF9VMzIgPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5VTlNJR05FRF8zMik7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X1UzMjsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgSTMyKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tRWxlbWVudF9JMzIgPT0gbnVsbCkgeworICAgICAgICAgICAgcnMubUVsZW1lbnRfSTMyID0gY3JlYXRlVXNlcihycywgRGF0YVR5cGUuU0lHTkVEXzMyKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcnMubUVsZW1lbnRfSTMyOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBGMzIoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1FbGVtZW50X0YzMiA9PSBudWxsKSB7CisgICAgICAgICAgICBycy5tRWxlbWVudF9GMzIgPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5GTE9BVF8zMik7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X0YzMjsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgRUxFTUVOVChSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgaWYocnMubUVsZW1lbnRfRUxFTUVOVCA9PSBudWxsKSB7CisgICAgICAgICAgICBycy5tRWxlbWVudF9FTEVNRU5UID0gY3JlYXRlVXNlcihycywgRGF0YVR5cGUuUlNfRUxFTUVOVCk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X0VMRU1FTlQ7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBFbGVtZW50IFRZUEUoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1FbGVtZW50X1RZUEUgPT0gbnVsbCkgeworICAgICAgICAgICAgcnMubUVsZW1lbnRfVFlQRSA9IGNyZWF0ZVVzZXIocnMsIERhdGFUeXBlLlJTX1RZUEUpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9UWVBFOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBBTExPQ0FUSU9OKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tRWxlbWVudF9BTExPQ0FUSU9OID09IG51bGwpIHsKKyAgICAgICAgICAgIHJzLm1FbGVtZW50X0FMTE9DQVRJT04gPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5SU19BTExPQ0FUSU9OKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcnMubUVsZW1lbnRfQUxMT0NBVElPTjsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgU0FNUExFUihSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgaWYocnMubUVsZW1lbnRfU0FNUExFUiA9PSBudWxsKSB7CisgICAgICAgICAgICBycy5tRWxlbWVudF9TQU1QTEVSID0gY3JlYXRlVXNlcihycywgRGF0YVR5cGUuUlNfU0FNUExFUik7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X1NBTVBMRVI7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBFbGVtZW50IFNDUklQVChSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgaWYocnMubUVsZW1lbnRfU0NSSVBUID09IG51bGwpIHsKKyAgICAgICAgICAgIHJzLm1FbGVtZW50X1NDUklQVCA9IGNyZWF0ZVVzZXIocnMsIERhdGFUeXBlLlJTX1NDUklQVCk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X1NDUklQVDsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgTUVTSChSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgaWYocnMubUVsZW1lbnRfTUVTSCA9PSBudWxsKSB7CisgICAgICAgICAgICBycy5tRWxlbWVudF9NRVNIID0gY3JlYXRlVXNlcihycywgRGF0YVR5cGUuUlNfTUVTSCk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X01FU0g7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBFbGVtZW50IFBST0dSQU1fRlJBR01FTlQoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1FbGVtZW50X1BST0dSQU1fRlJBR01FTlQgPT0gbnVsbCkgeworICAgICAgICAgICAgcnMubUVsZW1lbnRfUFJPR1JBTV9GUkFHTUVOVCA9IGNyZWF0ZVVzZXIocnMsIERhdGFUeXBlLlJTX1BST0dSQU1fRlJBR01FTlQpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9QUk9HUkFNX0ZSQUdNRU5UOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBQUk9HUkFNX1ZFUlRFWChSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgaWYocnMubUVsZW1lbnRfUFJPR1JBTV9WRVJURVggPT0gbnVsbCkgeworICAgICAgICAgICAgcnMubUVsZW1lbnRfUFJPR1JBTV9WRVJURVggPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5SU19QUk9HUkFNX1ZFUlRFWCk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X1BST0dSQU1fVkVSVEVYOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBQUk9HUkFNX1JBU1RFUihSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgaWYocnMubUVsZW1lbnRfUFJPR1JBTV9SQVNURVIgPT0gbnVsbCkgeworICAgICAgICAgICAgcnMubUVsZW1lbnRfUFJPR1JBTV9SQVNURVIgPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5SU19QUk9HUkFNX1JBU1RFUik7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X1BST0dSQU1fUkFTVEVSOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBQUk9HUkFNX1NUT1JFKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tRWxlbWVudF9QUk9HUkFNX1NUT1JFID09IG51bGwpIHsKKyAgICAgICAgICAgIHJzLm1FbGVtZW50X1BST0dSQU1fU1RPUkUgPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5SU19QUk9HUkFNX1NUT1JFKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcnMubUVsZW1lbnRfUFJPR1JBTV9TVE9SRTsKKyAgICB9CisKKwogICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBBXzgoUmVuZGVyU2NyaXB0IHJzKSB7CiAgICAgICAgIGlmKHJzLm1FbGVtZW50X0FfOCA9PSBudWxsKSB7CiAgICAgICAgICAgICBycy5tRWxlbWVudF9BXzggPSBjcmVhdGVQaXhlbChycywgRGF0YVR5cGUuVU5TSUdORURfOCwgRGF0YUtpbmQuUElYRUxfQSk7CkBAIC0xNjgsNTQgKzI1NiwzNCBAQAogICAgICAgICByZXR1cm4gcnMubUVsZW1lbnRfUkdCQV84ODg4OwogICAgIH0KIAotICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBJTkRFWF8xNihSZW5kZXJTY3JpcHQgcnMpIHsKLSAgICAgICAgaWYocnMubUVsZW1lbnRfSU5ERVhfMTYgPT0gbnVsbCkgewotICAgICAgICAgICAgcnMubUVsZW1lbnRfSU5ERVhfMTYgPSBjcmVhdGVJbmRleChycyk7CisgICAgcHVibGljIHN0YXRpYyBFbGVtZW50IEYzMl8yKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tRWxlbWVudF9GTE9BVF8yID09IG51bGwpIHsKKyAgICAgICAgICAgIHJzLm1FbGVtZW50X0ZMT0FUXzIgPSBjcmVhdGVWZWN0b3IocnMsIERhdGFUeXBlLkZMT0FUXzMyLCAyKTsKICAgICAgICAgfQotICAgICAgICByZXR1cm4gcnMubUVsZW1lbnRfSU5ERVhfMTY7CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9GTE9BVF8yOwogICAgIH0KIAotICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBBVFRSSUJfUE9TSVRJT05fMihSZW5kZXJTY3JpcHQgcnMpIHsKLSAgICAgICAgaWYocnMubUVsZW1lbnRfUE9TSVRJT05fMiA9PSBudWxsKSB7Ci0gICAgICAgICAgICBycy5tRWxlbWVudF9QT1NJVElPTl8yID0gY3JlYXRlQXR0cmliKHJzLCBEYXRhVHlwZS5GTE9BVF8zM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HJzKSB7Ci0gICAgICAgIHJldHVybiBuZXcgRWxlbWVudChycywgRGF0YVR5cGUuVU5TSUdORURfMTYsIERhdGFLaW5kLklOREVYLCBmYWxzZSwgMSk7Ci0gICAgfQotCi0gICAgcHVibGljIHN0YXRpYyBFbGVtZW50IGNyZWF0ZUF0dHJpYihSZW5kZXJTY3JpcHQgcnMsIERhdGFUeXBlIGR0LCBEYXRhS2luZCBkaywgaW50IHNpemUpIHsKLSAgICAgICAgaWYgKCEoZHQgPT0gRGF0YVR5cGUuRkxPQVRfMzIgfHwKLSAgICAgICAgICAgICAgZHQgPT0gRGF0YVR5cGUuVU5TSUdORURfOCB8fAotICAgICAgICAgICAgICBkdCA9PSBEYXRhVHlwZS5VTlNJR05FRF8xNiB8fAotICAgICAgICAgICAgICBkdCA9PSBEYXRhVHlwZS5VTlNJR05FRF8zMiB8fAotICAgICAgICAgICAgICBkdCA9PSBEYXRhVHlwZS5TSUdORURfOCB8fAotICAgICAgICAgICAgICBkdCA9PSBEYXRhVHlwZS5TSUdORURfMTYgfHwKLSAgICAgICAgICAgICAgZHQgPT0gRGF0YVR5cGUuU0lHTkVEXzMyKSkgewotICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiVW5zdXBwb3J0ZWQgRGF0YVR5cGUiKTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmICghKGRrID09IERhdGFLaW5kLkNPTE9SIHx8Ci0gICAgICAgICAgICAgIGRrID09IERhdGFLaW5kLlBPU0lUSU9OIHx8Ci0gICAgICAgICAgICAgIGRrID09IERhdGFLaW5kLlRFWFRVUkUgfHwKLSAgICAgICAgICAgICAgZGsgPT0gRGF0YUtpbmQuTk9STUFMIHx8Ci0gICAgICAgICAgICAgIGRrID09IERhdGFLaW5kLlBPSU5UX1NJWkUgfHwKLSAgICAgICAgICAgICAgZGsgPT0gRGF0YUtpbmQuVVNFUikpIHsKLSAgICAgICAgICAgIHRocm93IG5ldyBJbGx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gIH0KKyAgICBwdWJsaWMgdm9pZCByZXNldChpbnQgaSkgeworICAgICAgICBtUG9zID0gaTsKKyAgICB9CiAKLSAgICB2b2lkIGFkZEk4KGJ5dGUgdikgeworICAgIHB1YmxpYyB2b2lkIHNraXAoaW50IGkpIHsKKyAgICAgICAgbVBvcyArPSBpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGFkZEk4KGJ5dGUgdikgewogICAgICAgICBtRGF0YVttUG9zKytdID0gdjsKICAgICB9CiAKLSAgICB2b2lkIGFkZEkxNihzaG9ydCB2KSB7CisgICAgcHVibGljIHZvaWQgYWRkSTE2KHNob3J0IHYpIHsKICAgICAgICAgYWxpZ24oMik7CiAgICAgICAgIG1EYXRhW21Qb3MrK10gPSAoYnl0ZSkodiAmIDB4ZmYpOwogICAgICAgICBtRGF0YVttUG9zKytdID0gKGJ5dGUpKHYgPj4gOCk7CiAgICAgfQogCi0gICAgdm9pZCBhZGRJMzIoaW50IHYpIHsKKyAgICBwdWJsaWMgdm9pZCBhZGRJMzIoaW50IHYpIHsKICAgICAgICAgYWxpZ24oNCk7CiAgICAgICAgIG1EYXRhW21Qb3MrK10gPSAoYnl0ZSkodiAmIDB4ZmYpOwogICAgICAgICBtRGF0YVttUG9zKytdID0gKGJ5dGUpKCh2ID4+IDgpICYgMHhmZik7CkBAIC01NSw3ICs2Miw3IEBACiAgICAgICAgIG1EYXRhW21Qb3MrK10gPSAoYnl0ZSkoKHYgPj4gMjQpICYgMHhmZik7CiAgICAgfQogCi0gICAgdm9pZCBhZGRJNjQobG9uZyB2KSB7CisgICAgcHVibGljIHZvaWQgYWRkSTY0KGxvbmcgdikgewogICAgICAgICBhbGlnbig4KTsKICAgICAgICAgbURhdGFbbVBvcysrXSA9IChieXRlKSh2ICYgMHhmZik7CiAgICAgICAgIG1EYXRhW21Qb3MrK10gPSAoYnl0ZSkoKHYgPj4gOCkgJiAweGZmKTsKQEAgLTY3LDE0ICs3NCwxNCBAQAogICAgICAgICBtRGF0Y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FkZFU2NChsb25nIHYpIHsKKyAgICBwdWJsaWMgdm9pZCBhZGRVNjQobG9uZyB2KSB7CiAgICAgICAgIGlmICh2IDwgMCkgewogICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiU2F2aW5nIHZhbHVlIG91dCBvZiByYW5nZSBmb3IgdHlwZSIpOwogICAgICAgICB9CkBAIC0xMDksMTUgKzExNiwxMzkgQEAKICAgICAgICAgbURhdGFbbVBvcysrXSA9IChieXRlKSgodiA+PiA1NikgJiAweGZmKTsKICAgICB9CiAKLSAgICB2b2lkIGFkZEYzMihmbG9hdCB2KSB7CisgICAgcHVibGljIHZvaWQgYWRkRjMyKGZsb2F0IHYpIHsKICAgICAgICAgYWRkSTMyKEZsb2F0LmZsb2F0VG9SYXdJbnRCaXRzKHYpKTsKICAgICB9CiAKLSAgICB2b2lkIGFkZEY2NChmbG9hdCB2KSB7CisgICAgcHVibGljIHZvaWQgYWRkRjY0KGZsb2F0IHYpIHsKICAgICAgICAgYWRkSTY0KERvdWJsZS5kb3VibGVUb1Jhd0xvbmdCaXRzKHYpKTsKICAgICB9CiAKLSAgICBmaW5hbCBieXRlW10gZ2V0RGF0YSgpIHsKKyAgICBwdWJsaWMgdm9pZCBhZGRPYmooQmFzZU9iaiBvYmopIHsKKyAgICAgICAgaWYgKG9iaiAhPSBudWxsKSB7CisgICAgICAgICAgICBhZGRJMzIob2JqLmdldElEKCkpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgYWRkSTMyKDApOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgYWRkRjMyKEZsb2F0MiB2KSB7CisgICAgICAgIGFkZEYzMih2LngpOworICAgICAgICBhZGRGMzIodi55KTsKKyAgICB9CisgICAgcHVibGljIHZvaWQgYWRkRjMyKEZsb2F0MyB2KSB7CisgICAgICAgIGFkZEYzMih2LngpOworICAgICAgICBhZGRGMzIodi55KTsKKyAgICAgICAgYWRkRjMyKHYueik7CisgICAgfQorICAgIHB1YmxpYyB2b2lkIGFkZEYzMihGbG9hdDQgdikgeworICAgICAgICBhZGRGMzIodi54KTsKKyAgICAgICAgYWRkRjMyKHYueSk7CisgICAgICAgIGFkZEYzMih2LnopOworICAgICAgICBhZGRGMzIodi53KTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBhZGRJOChCeXRlMiB2KSB7CisgICAgICAgIGFkZEk4KHYueCk7CisgICAgICAgIGFkZEk4KHYueSk7CisgICAgfQorICAgIHB1YmxpYyB2b2lkIGFkZEk4KEJ5dGUzIHYpIHsKKyAgICAgICAgYWRkSTgodi54KTsKKyAgICAgICAgYWRkSTgodi55KTsKKyAgICAgICAgYWRkSTgodi56KTsKKyAgICB9CisgICAgcHVibGljIHZvaWQgYWRkSTgoQnl0ZTQgdikgeworICAgICAgICBhZGRJOCh2LngpOworICAgICAgICBhZGRJOCh2LnkpOworICAgICAgICBhZGRJOCh2LnopOworICAgICAgICBhZGRJOCh2LncpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGFkZFU4KFNob3J0MiB2KSB7CisgICAgICAgIGFkZFU4KHYueCk7CisgICAgICAgIGFkZFU4KHYueSk7CisgICAgfQorICAgIHB1YmxpYyB2b2lkIGFkZFU4KFNob3J0MyB2KSB7CisgICAgICAgIGFkZFU4KHYueCk7CisgICAgICAgIGFkZFU4KHYueSk7CisgICAgICAgIGFkZFU4KHYueik7CisgICAgfQorICAgIHB1YmxpYyB2b2lkIGFkZFU4KFNob3J0NCB2KSB7CisgICAgICAgIGFkZFU4KHYueCk7CisgICAgICAgIGFkZFU4KHYueSk7CisgICAgICAgIGFkZFU4KHYueik7CisgICAgICAgIGFkZFU4KHYudyk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgYWRkSTE2KFNob3J0MiB2KSB7CisgICAgICAgIGFkZEkxNih2LngpOworICAgICAgICBhZGRJMTYodi55KTsKKyAgICB9CisgICAgcHVibGljIHZvaWQgYWRkSTE2KFNob3J0MyB2KSB7CisgICAgICAgIGFkZEkxNih2LngpOworICAgICAgICBhZGRJMTYodi55KTsKKyAgICAgICAgYWRkSTE2KHYueik7CisgICAgfQorICAgIHB1YmxpYyB2b2lkIGFkZEkxNihTaG9ydDQgdikgeworICAgICAgICBhZGRJMTYodi54KTsKKyAgICAgICAgYWRkSTE2KHYueSk7CisgICAgICAgIGFkZEkxNih2LnopOworICAgICAgICBhZGRJMTYodi53KTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBhZGRVMTYoSW50MiB2KSB7CisgICAgICAgIGFkZFUxNih2LngpOworICAgICAgICBhZGRVMTYodi55KTsKKyAgICB9CisgICAgcHVibGljIHZvaWQgYWRkVTE2KEludDMgdikgeworICAgICAgICBhZGRVMTYodi54KTsKKyAgICAgICAgYWRkVTE2KHYueSk7CisgICAgICAgIGFkZFUxNih2LnopOworICAgIH0KKyAgICBwdWJsaWMgdm9pZCBhZGRVMTYoSW50NCB2KSB7CisgICAgICAgIGFkZFUxNih2LngpOworICAgICAgICBhZGRVMTYodi55KTsKKyAgICAgICAgYWRkVTE2KHYueik7CisgICAgICAgIGFkZFUxNih2LncpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGFkZEkzMihJbnQyIHYpIHsKKyAgICAgICAgYWRkSTMyKHYueCk7CisgICAgICAgIGFkZEkzMih2LnkpOworICAgIH0KKyAgICBwdWJsaWMgdm9pZCBhZGRJMzIoSW50MyB2KSB7CisgICAgICAgIGFkZEkzMih2LngpOworICAgICAgICBhZGRJMzIodi55KTsKKyAgICAgICAgYWRkSTMyKHYueik7CisgICAgfQorICAgIHB1YmxpYyB2b2lkIGFkZEkzMihJbnQ0IHYpIHsKKyAgICAgICAgYWRkSTMyKHYueCk7CisgICAgICAgIGFkZEkzMih2LnkpOworICAgICAgICBhZGRJMzIodi56KTsKKyAgICAgICAgYWRkSTMyKHYudyk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgYWRkVTMyKEludDIgdikgeworICAgICAg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AqKi8KK3B1YmxpYyBjbGFzcyBGaWxlQTNEIGV4dGVuZHMgQmFzZU9iaiB7CisKKyAgICBwdWJsaWMgZW51bSBDbGFzc0lEIHsKKworICAgICAgICBVTktOT1dOLAorICAgICAgICBNRVNILAorICAgICAgICBTSU1QTEVfTUVTSCwKKyAgICAgICAgVFlQRSwKKyAgICAgICAgRUxFTUVOVCwKKyAgICAgICAgQUxMT0NBVElPTiwKKyAgICAgICAgUFJPR1JBTV9WRVJURVgsCisgICAgICAgIFBST0dSQU1fUkFTVEVSLAorICAgICAgICBQUk9HUkFNX0ZSQUdNRU5ULAorICAgICAgICBQUk9HUkFNX1NUT1JFLAorICAgICAgICBTQU1QTEVSLAorICAgICAgICBBTklNQVRJT04sCisgICAgICAgIExJR0hULAorICAgICAgICBBREFQVEVSXzFELAorICAgICAgICBBREFQVEVSXzJELAorICAgICAgICBTQ1JJUFRfQzsKKworICAgICAgICBwdWJsaWMgc3RhdGljIENsYXNzSUQgdG9DbGFzc0lEKGludCBpbnRJRCkgeworICAgICAgICAgICAgcmV0dXJuIENsYXNzSUQudmFsdWVzKClbaW50SURdOworICAgICAgICB9CisgICAgfQorCisgICAgLy8gUmVhZCBvbmx5IGNsYXNzIHdpdGggaW5kZXggZW50cmllcworICAgIHB1YmxpYyBjbGFzcyBJbmRleEVudHJ5IHsKKyAgICAgICAgUmVuZGVyU2NyaXB0IG1SUzsKKyAgICAgICAgaW50IG1JbmRleDsKKyAgICAgICAgaW50IG1JRDsKKyAgICAgICAgU3RyaW5nIG1OYW1lOworICAgICAgICBDbGFzc0lEIG1DbGFzc0lEOworICAgICAgICBCYXNlT2JqIG1Mb2FkZWRPYmo7CisKKyAgICAgICAgcHVibGljIFN0cmluZyBnZXROYW1lKCkgeworICAgICAgICAgICAgcmV0dXJuIG1OYW1lOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIENsYXNzSUQgZ2V0Q2xhc3NJRCgpIHsKKyAgICAgICAgICAgIHJldHVybiBtQ2xhc3NJRDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBCYXNlT2JqIGdldE9iamVjdCgpIHsKKyAgICAgICAgICAgIGlmKG1Mb2FkZWRPYmogIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHJldHVybiBtTG9hZGVkT2JqOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZihtQ2xhc3NJRCA9PSBDbGFzc0lELlVOS05PV04pIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaW50IG9iamVjdElEID0gbVJTLm5GaWxlQTNER2V0RW50cnlCeUluZGV4KG1JRCwgbUluZGV4KTsKKyAgICAgICAgICAgIGlmKG9iamVjdElEID09IDApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc3dpdGNoIChtQ2xhc3NJRCkgeworICAgICAgICAgICAgY2FzZSBNRVNIOgorICAgICAgICAgICAgICAgIG1Mb2FkZWRPYmogPSBudWxsOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTSU1QTEVfTUVTSDoKKyAgICAgICAgICAgICAgICBtTG9hZGVkT2JqID0gbmV3IFNpbXBsZU1lc2gob2JqZWN0SUQsIG1SUyk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFRZUEU6CisgICAgICAgICAgICAgICAgbUxvYWRlZE9iaiA9IG5ldyBUeXBlKG9iamVjdElELCBtUlMpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBFTEVNRU5UOgorICAgICAgICAgICAgICAgIG1Mb2FkZWRPYmogPSBudWxsOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBBTExPQ0FUSU9OOgorICAgICAgICAgICAgICAgIG1Mb2FkZWRPYmogPSBudWxsOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBQUk9HUkFNX1ZFUlRFWDoKKyAgICAgICAgICAgICAgICBtTG9hZGVkT2JqID0gbmV3IFByb2dyYW1WZXJ0ZXgob2JqZWN0SUQsIG1SUyk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFBST0dSQU1fUkFTVEVSOgorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBQUk9HUkFNX0ZSQUdNRU5UOgorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBQUk9HUkFNX1NUT1JFOgorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTQU1QTEVSOgorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBBTklNQVRJT046CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIExJR0hUOgorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBBREFQVEVSXzFEOgorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBBREFQVEVSXzJEOgorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTQ1JJUFRfQzoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIG1Mb2FkZWRPYmo7CisgICAgICAgIH0KKworICAgICAgICBJbmRleEVudHJ5KFJlbmRlclNjcmlwdCBycywgaW50IGluZGV4LCBpbnQgaWQsIFN0cmluZyBuYW1lLCBDbGFzc0lEIGNsYXNzSUQpIHsKKyAgICAgICAgICAgIG1SUyA9IHJzOworICAgICAgICAgICAgbUluZGV4ID0gaW5kZXg7CisgICAgICAgICAgICBtSUQgPSBpZDsKKyAgICAgICAgICAgIG1OYW1lID0gbmFtZTsKKyAgICAgICAgICAgIG1DbGFzc0lEID0gY2xhc3NJRDsKKyAgICAgICAgICAgIG1Mb2FkZWRPYmogPSBudWxsOworICAgICAgICB9CisgICAgfQorCisgICAgSW5kZXhFbnRyeVtdIG1GaWxlRW50cmllczsKKworICAgIEZpbGVBM0QoaW50IGlkLCBSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgc3VwZXIocnMpOworICAgICAgICBtSUQgPSBpZDsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgaW5pdEVudHJpZXMoKSB7CisgICAgICAgIGludCBudW1GaWxlRW50cmllcyA9IG1SUy5uRmlsZUEzREdldE51bUluZGV4RW50cmllcyhtSUQpOworICAgICAgICBpZihudW1GaWxlRW50cmllcyA8PSAwKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBtRmlsZUVudHJpZXMgPSBuZXcgSW5kZXhFbnRyeVtudW1GaWxlRW50cmllc107CisgICAgICAgIGludFtdIGlkcyA9IG5ldyBpbnRbbnVtRmlsZUVudHJpZXNdOworICAgICAgICBTdHJpbmdbXSBuYW1lcyA9IG5ldyBTdHJpbmdbbnVtRmlsZUVudHJpZXNdOworCisgICAgICAgIG1SUy5uRmlsZUEzREdldEluZGV4RW50cmllcyhtSUQsIG51bUZpbGVFbnRyaWVzLCBpZHMsIG5hbWVzKTsKKworICAgICAgICBmb3IoaW50IGkgPSAwOyBpIDwgbnVtRmlsZUVudHJpZXM7IGkgKyspIHsKKyAgICAgICAgICAgIG1GaWxlRW50cmllc1tpXSA9IG5ldyBJbmRleEVudHJ5KG1SUywgaSwgbUlELCBuYW1lc1tpXSwgQ2xhc3NJRC50b0NsYXNzSUQoaWRzW2ldKSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldE51bUluZGV4RW50cmllcygpIHsKKyAgICAgICAgaWYobUZpbGVFbnRyaWVzID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9CisgICAgICAgIHJldHVybiBtRmlsZUVudHJpZXMubGVuZ3RoOworICAgIH0KKworICAgIHB1YmxpYyBJbmRleEVudHJ5IGdldEluZGV4RW50cnkoaW50IGluZGV4KSB7CisgICAgICAgIGlmKGdldE51bUluZGV4RW50cmllcygpID09IDAgfHwgaW5kZXggPCAwIHx8IGluZGV4ID49IG1GaWxlRW50cmllcy5sZW5ndGgpIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIHJldHVybiBtRmlsZUVudHJpZXNbaW5kZXhdOworICAgIH0KKworICAgIHN0YXRpYyBwdWJsaWMgRmlsZUEzRCBjcmVhdGVGcm9tUmVzb3VyY2UoUmVuZGVyU2NyaXB0IHJzLCBSZXNvdXJjZXMgcmVzLCBpbnQgaWQpCisgICAgICAgIHRocm93cyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24geworCisgICAgICAgIHJzLnZhbGlkYXRlKCk7CisgICAgICAgIElucHV0U3RyZWFtIGlzID0gbnVsbDsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGZpbmFsIFR5cGVkVmFsdWUgdmFsdWUgPSBuZXcgVHlwZWRWYWx1ZSgpOworICAgICAgICAgICAgaXMgPSByZXMub3BlblJhd1Jlc291cmNlKGlkLCB2YWx1ZSk7CisKKyAgICAgICAgICAgIGludCBhc3NldCA9ICgoQXNzZXRNYW5hZ2VyLkFzc2V0SW5wdXRTdHJlYW0pIGlzKS5nZXRBc3NldEludCgpOworCisgICAgICAgICAgICBpbnQgZmlsZUlkID0gcnMubkZpbGVBM0RDcmVhdGVGcm9tQXNzZXRTdHJlYW0oYXNzZXQpOworCisgICAgICAgICAgICBpZihmaWxlSWQgPT0gMCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIkxvYWQgZmFpbGVkLiIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRmlsZUEzRCBmYTNkID0gbmV3IEZpbGVBM0QoZmlsZUlkLCBycyk7CisgICAgICAgICAgICBmY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RnVuYyhiLm1EZXB0aEZ1bmMubUlEKTsKLSAgICAgICAgICAgIHJzLm5Qcm9ncmFtRnJhZ21lbnRTdG9yZURlcHRoTWFzayhiLm1EZXB0aE1hc2spOwotICAgICAgICAgICAgcnMublByb2dyYW1GcmFnbWVudFN0b3JlQ29sb3JNYXNrKGIubUNvbG9yTWFza1IsCisgICAgICAgICAgICBycy5uUHJvZ3JhbVN0b3JlQmVnaW4oaW5JRCwgb3V0SUQpOworICAgICAgICAgICAgcnMublByb2dyYW1TdG9yZURlcHRoRnVuYyhiLm1EZXB0aEZ1bmMubUlEKTsKKyAgICAgICAgICAgIHJzLm5Qcm9ncmFtU3RvcmVEZXB0aE1hc2soYi5tRGVwdGhNYXNrKTsKKyAgICAgICAgICAgIHJzLm5Qcm9ncmFtU3RvcmVDb2xvck1hc2soYi5tQ29sb3JNYXNrUiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiLm1Db2xvck1hc2tHLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIubUNvbG9yTWFza0IsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYi5tQ29sb3JNYXNrQSk7Ci0gICAgICAgICAgICBycy5uUHJvZ3JhbUZyYWdtZW50U3RvcmVCbGVuZEZ1bmMoYi5tQmxlbmRTcmMubUlELCBiLm1CbGVuZERzdC5tSUQpOwotICAgICAgICAgICAgcnMublByb2dyYW1GcmFnbWVudFN0b3JlRGl0aGVyKGIubURpdGhlcik7CisgICAgICAgICAgICBycy5uUHJvZ3JhbVN0b3JlQmxlbmRGdW5jKGIubUJsZW5kU3JjLm1JRCwgYi5tQmxlbmREc3QubUlEKTsKKyAgICAgICAgICAgIHJzLm5Qcm9ncmFtU3RvcmVEaXRoZXIoYi5tRGl0aGVyKTsKIAotICAgICAgICAgICAgaW50IGlkID0gcnMublByb2dyYW1GcmFnbWVudFN0b3JlQ3JlYX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uQ0xBTVApOworICAgICAgICAgICAgYi5zZXRXcmFwVChWYWx1ZS5DTEFNUCk7CisgICAgICAgICAgICBycy5tU2FtcGxlcl9DTEFNUF9MSU5FQVIgPSBiLmNyZWF0ZSgpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBycy5tU2FtcGxlcl9DTEFNUF9MSU5FQVI7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBTYW1wbGVyIENMQU1QX0xJTkVBUl9NSVBfTElORUFSKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tU2FtcGxlcl9DTEFNUF9MSU5FQVJfTUlQX0xJTkVBUiA9PSBudWxsKSB7CisgICAgICAgICAgICBCdWlsZGVyIGIgPSBuZXcgQnVpbGRlcihycyk7CisgICAgICAgICAgICBiLnNldE1pbihWYWx1ZS5MSU5FQVJfTUlQX0xJTkVBUik7CisgICAgICAgICAgICBiLnNldE1hZyhWYWx1ZS5MSU5FQVJfTUlQX0xJTkVBUik7CisgICAgICAgICAgICBiLnNldFdyYXBTKFZhbHVlLkNMQU1QKTsKKyAgICAgICAgICAgIGIuc2V0V3JhcFQoVmFsdWUuQ0xBTVApOworICAgICAgICAgICAgcnMubVNhbXBsZXJfQ0xBTVBfTElORUFSX01JUF9MSU5FQVIgPSBiLmNyZWF0ZSgpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBycy5tU2FtcGxlcl9DTEFNUF9MSU5FQVJfTUlQX0xJTkVBUjsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIFNhbXBsZXIgV1JBUF9ORUFSRVNUKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tU2FtcGxlcl9XUkFQX05FQVJFU1QgPT0gbnVsbCkgeworICAgICAgICAgICAgQnVpbGRlciBiID0gbmV3IEJ1aWxkZXIocnMpOworICAgICAgICAgICAgYi5zZXRNaW4oVmFsdWUuTkVBUkVTVCk7CisgICAgICAgICAgICBiLnNldE1hZyhWYWx1ZS5ORUFSRVNUKTsKKyAgICAgICAgICAgIGIuc2V0V3JhcFMoVmFsdWUuV1JBUCk7CisgICAgICAgICAgICBiLnNldFdyYXBUKFZhbHVlLldSQVApOworICAgICAgICAgICAgcnMubVNhbXBsZXJfV1JBUF9ORUFSRVNUID0gYi5jcmVhdGUoKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcnMubVNhbXBsZXJfV1JBUF9ORUFSRVNUOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgU2FtcGxlciBXUkFQX0xJTkVBUihSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgaWYocnMubVNhbXBsZXJfV1JBUF9MSU5FQVIgPT0gbnVsbCkgeworICAgICAgICAgICAgQnVpbGRlciBiID0gbmV3IEJ1aWxkZXIocnMpOworICAgICAgICAgICAgYi5zZXRNaW4oVmFsdWUuTElORUFSKTsKKyAgICAgICAgICAgIGIuc2V0TWFnKFZhbHVlLkxJTkVBUik7CisgICAgICAgICAgICBiLnNldFdyYXBTKFZhbHVlLldSQVApOworICAgICAgICAgICAgYi5zZXRXcmFwVChWYWx1ZS5XUkFQKTsKKyAgICAgICAgICAgIHJzLm1TYW1wbGVyX1dSQVBfTElORUFSID0gYi5jcmVhdGUoKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcnMubVNhbXBsZXJfV1JBUF9MSU5FQVI7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBTYW1wbGVyIFdSQVBfTElORUFSX01JUF9MSU5FQVIoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1TYW1wbGVyX1dSQVBfTElORUFSX01JUF9MSU5FQVIgPT0gbnVsbCkgeworICAgICAgICAgICAgQnVpbGRlciBiID0gbmV3IEJ1aWxkZXIocnMpOworICAgICAgICAgICAgYi5zZXRNaW4oVmFsdWUuTElORUFSX01JUF9MSU5FQVIpOworICAgICAgICAgICAgYi5zZXRNYWcoVmFsdWUuTElORUFSX01JUF9MSU5FQVIpOworICAg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cihpbnQgaW5kZXgsIGludCB2KSB7CisgICAgICAgIG1SUy5uU2NyaXB0U2V0VmFySShtSUQsIGluZGV4LCB2KTsKICAgICB9CiAKLSAgICBwdWJsaWMgdm9pZCBzZXRDbGVhclN0ZW5jaWwoaW50IHN0ZW5jaWwpIHsKLSAgICAgICAgbVJTLnZhbGlkYXRlKCk7Ci0gICAgICAgIG1SUy5uU2NyaXB0U2V0Q2xlYXJTdGVuY2lsKG1JRCwgc3RlbmNpbCk7CisgICAgcHVibGljIHZvaWQgc2V0VmFyKGludCBpbmRleCwgRmllbGRQYWNrZXIgdikgeworICAgICAgICBtUlMublNjcmlwdFNldFZhclYobUlELCBpbmRleCwgdi5nZXREYXRhKCkpOwogICAgIH0KIAogICAgIHB1YmxpYyB2b2lkIHNldFRpbWVab25lKFN0cmluZyB0aW1lWm9uZSkgewpAQCAtNzgsNzIgKzkyLDU0IEBACiAKICAgICBwdWJsaWMgc3RhdGljIGNsYXNzIEJ1aWxkZXIgewogICAgICAgICBSZW5kZXJTY3JpcHQgbVJTOwotICAgICAgICBib29sZWFuIG1Jc1Jvb3QgPSBmYWxzZTsKLSAgICAgICAgVHlwZVtdIG1UeXBlczsKLSAgICAgICAgU3RyaW5nW10gbU5hbWVzOwotICAgICAgICBib29sZWFuW10gbVdyaXRhYmxlOwotICAgICAgICBpbnQgbUludm9rYWJsZUNvdW50ID0gMDsKLSAgICAgICAgSW52b2thYmxlW10gbUludm9rYWJsZXM7CiAKICAgICAgICAgQnVpbGRlcihSZW5kZXJTY3JpcHQgcnMpIHsKICAgICAgICAgICAgIG1SUyA9IHJzOwotICAgICAgICAgICAgbVR5cGVzID0gbmV3IFR5cGVbTUFYX1NMT1RdOwotICAgICAgICAgICAgbU5hbWVzID0gbmV3IFN0cmluZ1tNQVhfU0xPVF07Ci0gICAgICAgICAgICBtV3JpdGFibGUgPSBuZXcgYm9vbGVhbltNQVhfU0xPVF07Ci0gICAgICAgICAgICBtSW52b2thYmxlcyA9IG5ldyBJbnZva2FibGVbTUFYX1NMT1RdOwogICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHZvaWQgc2V0VHlwZShUeXBlIHQsIGludCBzbG90KSB7Ci0gICAgICAgICAgICBtVHlwZXNbc2xvdF0gPSB0OwotICAgICAgICAgICAgbU5hbWVzW3Nsb3RdID0gbnVsbDsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyB2b2lkIHNldFR5cGUoVHlwZSB0LCBTdHJpbmcgbmFtZSwgaW50IHNsb3QpIHsKLSAgICAgICAgICAgIG1UeXBlc1tzbG90XSA9IHQ7Ci0gICAgICAgICAgICBtTmFtZXNbc2xvdF0gPSBuYW1lOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIEludm9rYWJsZSBhZGRJbnZva2FibGUoU3RyaW5nIGZ1bmMpIHsKLSAgICAgICAgICAgIEludm9rYWJsZSBpID0gbmV3IEludm9rYWJsZSgpOwotICAgICAgICAgICAgaS5tTmFtZSA9IGZ1bmM7Ci0gICAgICAgICAgICBpLm1SUyA9IG1SUzsKLSAgICAgICAgICAgIGkubVNsb3QgPSBtSW52b2thYmxlQ291bnQ7Ci0gICAgICAgICAgICBtSW52b2thYmxlc1ttSW52b2thYmxlQ291bnQrK10gPSBpOwotICAgICAgICAgICAgcmV0dXJuIGk7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCBzZXRUeXBlKGJvb2xlYW4gd3JpdGFibGUsIGludCBzbG90KSB7Ci0gICAgICAgICAgICBtV3JpdGFibGVbc2xvdF0gPSB3cml0YWJsZTsKLSAgICAgICAgfQotCi0gICAgICAgIHZvaWQgdHJhbnNmZXJDcmVhdGUoKSB7Ci0gICAgICAgICAgICBtUlMublNjcmlwdFNldFJvb3QobUlzUm9vdCk7Ci0gICAgICAgICAgICBmb3IoaW50IGN0PTA7IGN0IDwgbVR5cGVzLmxlbmd0aDsgY3QrKykgewotICAgICAgICAgICAgICAgIGlmKG1UeXBlc1tjdF0gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBtUlMublNjcmlwdFNldFR5cGUobVR5cGVzW2N0XS5tSUQsIG1Xcml0YWJsZVtjdF0sIG1OYW1lc1tjdF0sIGN0KTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBmb3IoaW50IGN0PTA7IGN0IDwgbUludm9rYWJsZUNvdW50OyBjdCsrKSB7Ci0gICAgICAgICAgICAgICAgbVJTLm5TY3JpcHRTZXRJbnZva2FibGUobUludm9rYWJsZXNbY3RdLm1OYW1lLCBjdCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICB2b2lkIHRyYW5zZmVyT2JqZWN0KFNjcmlwdCBzKSB7Ci0gICAgICAgICAgICBzLm1Jc1Jvb3QgPSBtSXNSb290OwotICAgICAgICAgICAgcy5tVHlwZXMgPSBtVHlwZXM7Ci0gICAgICAgICAgICBzLm1JbnZva2FibGVzID0gbmV3IEludm9rYWJsZVttSW52b2thYmxlQ291bnRdOwotICAgICAgICAgICAgZm9yKGludCBjdD0wOyBjdCA8IG1JbnZva2FibGVDb3VudDsgY3QrKykgewotICAgICAgICAgICAgICAgIHMubUludm9rYWJsZXNbY3RdID0gbUludm9rYWJsZXNbY3RdOwotICAgICAgICAgICAgICAgIHMubUludm9rYWJsZXNbY3RdLm1TY3JpcHQgPSBzOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcy5tSW52b2thYmxlcyA9IG51bGw7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCBzZXRSb290KGJvb2xlYW4gcikgewotICAgICAgICAgICAgbUlzUm9vdCA9IHI7Ci0gICAgICAgIH0KLQogICAgIH0KIAorCisgICAgcHVibGljIHN0YXRpYyBjbGFzcyBGaWVsZEJhc2UgeworICAgICAgICBwcm90ZWN0ZWQgRWxlbWVudCBtRWxlbWVudDsKKyAgICAgICAgcHJvdGVjdGVkIFR5cGUgbVR5cGU7CisgICAgICAgIHByb3RlY3RlZCBBbGxvY2F0aW9uIG1BbGxvY2F0aW9uOworCisgICAgICAgIHByb3RlY3RlZCB2b2lkIGluaXQoUmVuZGVyU2NyaXB0IHJzLCBpbnQgZGlteCkgeworICAgICAgICAgICAgbUFsbG9jYXRpb24gPSBBbGxvY2F0aW9uLmNyZWF0ZVNpemVkKHJzLCBtRWxlbWVudCwgZGlteCk7CisgICAgICAgICAgICBtVHlwZSA9IG1BbGxvY2F0aW9uLmdldFR5cGUoKTsKKyAgICAgICAgfQorCisgICAgICAgIHByb3RlY3RlZCBGaWVsZEJhc2UoKSB7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgRWxlbWVudCBnZXRFbGVtZW50KCkgeworICAgICAgICAgICAgcmV0dXJuIG1FbGVtZW50OworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIFR5cGUgZ2V0VHlwZSgpIHsKKyAgICAgICAgICAgIHJldHVybiBtVHlwZTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBBbGxvY2F0aW9uIGdldEFsbG9jYXRpb24oKSB7CisgICAgICAgICAgICByZXR1cm4gbUFsbG9jYXRpb247CisgICAgICAgIH0KKworICAgICAgICAvL0BPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCB1cGRhdGVBbGxvY2F0aW9uKCkgeworICAgICAgICB9CisKKworICAgICAgICAvLworICAgICAgICAvKgorICAgICAgICBwdWJsaWMgY2xhc3MgU2NyaXB0RmllbGRfVXNlckZpZWxkCisgICAgICAgICAgICBleHRlbmRzIGFuZHJvaWQucmVuZGVyc2NyaXB0LlNjcmlwdC5GaWVsZEJhc2UgeworCisgICAgICAgICAgICBwcm90ZWN0ZWQKKworICAgICAgICB9CisKKyAgICAgICAgKi8KKworICAgIH0KIH0KIApkaWZmIC0tZ2l0IGEvZ3JhcGhpY3MvamF2YS9hbmRyb2lkL3JlbmRlcnNjcmlwdC9TY3JpcHRDLmphdmEgYi9ncmFwaGljcy9qYXZhL2FuZHJv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gICAgaWYgKGJ5dGVzTGVmdCA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBieXRlW10gYnVmMiA9IG5ldyBieXRlW3BnbS5sZW5ndGggKiAyXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkocGdtLCAwLCBidWYyLCAwLCBwZ20ubGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBnbSA9IGJ1ZjI7CisgICAgICAgICAgICAgICAgICAgICAgICBieXRlc0xlZnQgPSBwZ20ubGVuZ3RoIC0gcGdtTGVuZ3RoOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGludCBieXRlc1JlYWQgPSBpcy5yZWFkKHBnbSwgcGdtTGVuZ3RoLCBieXRlc0xlZnQpOworICAgICAgICAgICAgICAgICAgICBpZiAoYnl0ZXNSZWFkIDw9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHBnbUxlbmd0aCArPSBieXRlc1JlYWQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICBpcy5jbG9zZSgpOworICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSZXNvdXJjZXMuTm90Rm91bmRFeGNlcHRpb24oKTsKKyAgICAgICAgfQorCisgICAgICAgIHJzLm5TY3JpcHRDQmVnaW4oKTsKKyAgICAgICAgcnMublNjcmlwdENTZXRTY3JpcHQocGdtLCAwLCBwZ21MZW5ndGgpOworICAgICAgICByZXR1cm4gcnMublNjcmlwdENDcmVhdGUoKTsKKyAgICB9CisKICAgICBwdWJsaWMgc3RhdGljIGNsYXNzIEJ1aWxkZXIgZXh0ZW5kcyBTY3JpcHQuQnVpbGRlciB7CiAgICAgICA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ZmllbGRzIGZvciBhbiBvYmplY3QsIGFuZCBhZGRzIGRlZmluZXMKLSAgICAgICAgICogZm9yIHRoZW0sIHVzaW5nIHRoZSBuYW1lIG9mIHRoZSBmaWVsZCBhcyB0aGUgbmFtZSBvZiB0aGUgZGVmaW5lLgotICAgICAgICAgKi8KLSAgICAgICAgcHVibGljIHZvaWQgYWRkRGVmaW5lcyhPYmplY3QgbykgewotICAgICAgICAgICAgYWRkRGVmaW5lcyhvLmdldENsYXNzKCkuZ2V0RmllbGRzKCksIE1vZGlmaWVyLlBVQkxJQywgbyk7Ci0gICAgICAgIH0KLQotICAgICAgICB2b2lkIGFkZERlZmluZXMoRmllbGRbXSBmaWVsZHMsIGludCBtYXNrLCBPYmplY3QgbykgewotICAgICAgICAgICAgZm9yIChGaWVsZCBmOiBmaWVsZHMpIHsKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICBpZiAoKGYuZ2V0TW9kaWZpZXJzKCkgJiBtYXNrKSA9PSBtYXNrKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBDbGFzcyB0ID0gZi5nZXRUeXBlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAodCA9PSBpbnQuY2xhc3MpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSW50RGVmaW5lcy5wdXQoZi5nZXROYW1lKCksIGYuZ2V0SW50KG8pKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHQgPT0gZmxvYXQuY2xhc3MpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRmxvYXREZWZpbmVzLnB1dChmLmdldE5hbWUoKSwgZi5nZXRGbG9hdChvKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGNhdGNoIChJbGxlZ2FsQWNjZXNzRXhjZXB0aW9uIGV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zaG9ydCB3OwogfQogCiAKIAotCmRpZmYgLS1naXQgYS9ncmFwaGljcy9qYXZhL2FuZHJvaWQvcmVuZGVyc2NyaXB0L1NpbXBsZU1lc2guamF2YSBiL2dyYXBoaWNzL2phdmEvYW5kcm9pZC9yZW5kZXJzY3JpcHQvU2ltcGxlTWVzaC5qYXZhCmluZGV4IDRhMjE3YTkuLjM4ZDA3MzYgMTAwNjQ0Ci0tLSBhL2dyYXBoaWNzL2phdmEvYW5kcm9pZC9yZW5kZXJzY3JpcHQvU2ltcGxlTWVzaC5qYXZhCisrKyBiL2dyYXBoaWNzL2phdmEvYW5kcm9pZC9yZW5kZXJzY3JpcHQvU2ltcGxlTWVzaC5qYXZhCkBAIC0zMTMsMzYgKzMxMywyNiBAQAogICAgICAgICBwdWJsaWMgU2ltcGxlTWVzaCBjcmVhdGUoKSB7CiAgICAgICAgICAgICBFbGVtZW50LkJ1aWxkZXIgYiA9IG5ldyBFbGVtZW50LkJ1aWxkZXIobVJTKTsKICAgICAgICAgICAgIGludCBmbG9hdENvdW50ID0gbVZ0eFNpemU7Ci0gICAgICAgICAgICBiLmFkZChFbGVtZW50LmNyZWF0ZUF0dHJpYihtUlMsCisgICAgICAgICAgICBiLmFkZChFbGVtZW50LmNyZWF0ZVZlY3RvcihtUlMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbGVtZW50LkRhdGFUeXBlLkZMT0FUXzMyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRWxlbWVudC5EYXRhS2luZC5QT1NJVElPTiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1WdHhTaXplKSwgInBvc2l0aW9uIik7CiAgICAgICAgICAgICBpZiAoKG1GbGFncyAmIENPTE9SKSAhPSAwKSB7CiAgICAgICAgICAgICAgICAgZmxvYXRDb3VudCArPSA0OwotICAgICAgICAgICAgICAgIGIuYWRkKEVsZW1lbnQuY3JlYXRlQXR0cmliKG1SUywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbGVtZW50LkRhdGFUeXBlLkZMT0FUXzMyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVsZW1lbnQuRGF0YUtpbmQuQ09MT1IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCksICJjb2xvciIpOworICAgICAgICAgICAgICAgIGIuYWRkKEVsZW1lbnQuRjMyXzQobVJTKSwgImNvbG9yIik7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAoKG1GbGFncyAmIFRFWFRVUkVfMCkgIT0gMCkgewogICAgICAgICAgICAgICAgIGZsb2F0Q291bnQgKz0gMjsKLSAgICAgICAgICAgICAgICBiLmFkZChFbGVtZW50LmNyZWF0ZUF0dHJpYihtUlMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRWxlbWVudC5EYXRhVHlwZS5GTE9BVF8zMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbGVtZW50LkRhdGFLaW5kLlRFWFRVUkUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiksICJ0ZXh0dXJlIik7CisgICAgICAgICAgICAgICAgYi5hZGQoRWxlbWVudC5GMzJfMihtUlMpLCAidGV4dHVyZTAiKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmICgobUZsYWdzICYgTk9STUFMKSAhPSAwKSB7CiAgICAgICAgICAgICAgICAgZmxvYXRDb3VudCArPSAzOwotICAgICAgICAgICAgICAgIGIuYWRkKEVsZW1lbnQuY3JlYXRlQXR0cmliKG1SUywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbGVtZW50LkRhdGFUeXBlLkZMT0FUXzMyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE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ICAgICAgICAgICAgICAgICAgIGFyQml0c1tjdF0gPSAxNjsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYoZmMgPT0gYnl0ZS5jbGFzcykgewotICAgICAgICAgICAgICAgICAgICBhclR5cGVzW2N0XSA9IEVsZW1lbnQuRGF0YVR5cGUuU0lHTkVEXzgubUlEOwotICAgICAgICAgICAgICAgICAgICBhckJpdHNbY3RdID0gODsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYoZmMgPT0gZmxvYXQuY2xhc3MpIHsKLSAgICAgICAgICAgICAgICAgICAgYXJUeXBlc1tjdF0gPSBFbGVtZW50LkRhdGFUeXBlLkZMT0FUXzMyLm1JRDsKLSAgICAgICAgICAgICAgICAgICAgYXJCaXRzW2N0XSA9IDMyOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlVua293biBmaWVsZCB0eXBlIik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgcnMublR5cGVTZXR1cEZpZWxkcyh0LCBhclR5cGVzLCBhckJpdHMsIGZpZWxkcyk7Ci0gICAgICAgIH0KLSAgICAgICAgdC5tSmF2YUNsYXNzID0gYzsKLSAgICAgICAgcmV0dXJuIHQ7Ci0gICAgfQotCiAgICAgcHVibGljIHN0YXRpYyBUeXBlIGNyZWF0ZUZyb21DbGFzcyhSZW5kZXJTY3JpcHQgcnMsIENsYXNzIGMsIGludCBzaXplLCBTdHJpbmcgc2NyaXB0TmFtZSkgewotICAgICAgICBUeXBlIHQgPSBjcmVhdGVGcm9tQ2xhc3MocnMsIGMsIHNpemUpOwotICAgICAgICB0LnNldE5hbWUoc2NyaXB0TmFtZSk7Ci0gICAgICAgIHJldHVybiB0OworICAgICAgICBhbmRyb2lkLnV0aWwuTG9nLmUoIlJlbmRlclNjcmlwdCIsICJDYWxsaW5nIGRlcHJpY2F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ICAgcmV0dXJuIG51bUVudHJpZXM7Cit9CisKK3N0YXRpYyB2b2lkCituRmlsZUEzREdldEluZGV4RW50cmllcyhKTklFbnYgKl9lbnYsIGpvYmplY3QgX3RoaXMsIGppbnQgZmlsZUEzRCwgamludCBudW1FbnRyaWVzLCBqaW50QXJyYXkgX2lkcywgam9iamVjdEFycmF5IF9lbnRyaWVzKQoreworICAgIExPR1YoIl9fX19fX25GaWxlQTNEICV1IiwgKHVpbnQzMl90KSBmaWxlQTNEKTsKKyAgICBSc0NvbnRleHQgY29uID0gKFJzQ29udGV4dCkoX2Vudi0+R2V0SW50RmllbGQoX3RoaXMsIGdDb250ZXh0SWQpKTsKKworICAgIFJzRmlsZUluZGV4RW50cnkgKmZpbGVFbnRyaWVzID0gKFJzRmlsZUluZGV4RW50cnkqKW1hbGxvYygodWludDMyX3QpbnVtRW50cmllcyAqIHNpemVvZihSc0ZpbGVJbmRleEVudHJ5KSk7CisKKyAgICByc0ZpbGVBM0RHZXRJbmRleEVudHJpZXMoY29uLCBmaWxlRW50cmllcywgKHVpbnQzMl90KW51bUVudHJpZXMsIChSc0ZpbGUpZmlsZUEzRCk7CisKKyAgICBmb3IoamludCBpID0gMDsgaSA8IG51bUVudHJpZXM7IGkgKyspIHsKKyAgICAgICAgX2Vudi0+U2V0T2JqZWN0QXJyYXlFbGVtZW50KF9lbnRyaWVzLCBpLCBfZW52LT5OZXdTdHJpbmdVVEYoZmlsZUVudHJpZXNbaV0ub2JqZWN0TmFtZSkpOworICAgICAgICBfZW52LT5TZXRJbnRBcnJheVJlZ2lvbihfaWRzLCBpLCAxLCAoY29uc3QgamludCopJmZpbGVFbnRyaWVzW2ldLmNsYXNzSUQpOworICAgIH0KKworICAgIGZyZWUoZmlsZUVudHJpZXMpOworfQorCitzdGF0aWMgaW50CituRmlsZUEzREdldEVudHJ5QnlJbmRleChKTklFbnYgKl9lbnYsIGpvYmplY3QgX3RoaXMsIGppbnQgZmlsZUEzRCwgamludCBpbmRleCkKK3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yJuQ29udGV4dENyZWF0ZSIsICAgICAgICAgICAgICAgICAiKElJKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Db250ZXh0Q3JlYXRlIH0sCiB7Im5Db250ZXh0Q3JlYXRlR0wiLCAgICAgICAgICAgICAgICIoSUlaKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkNvbnRleHRDcmVhdGVHTCB9LAoreyJuQ29udGV4dEZpbmlzaCIsICAgICAgICAgICAgICAgICAiKClWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Db250ZXh0RmluaXNoIH0sCiB7Im5Db250ZXh0U2V0UHJpb3JpdHkiLCAgICAgICAgICAgICIoSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkNvbnRleHRTZXRQcmlvcml0eSB9LAogeyJuQ29udGV4dFNldFN1cmZhY2UiLCAgICAgICAgICAgICAiKElJTGFuZHJvaWQvdmlldy9TdXJmYWNlOylWIiwgICAgICAgICAgKHZvaWQqKW5Db250ZXh0U2V0U3VyZmFjZSB9LAogeyJuQ29udGV4dERlc3Ryb3kiLCAgICAgICAgICAgICAgICAiKEkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Db250ZXh0RGVzdHJveSB9LApAQCAtMTM3NSw2ICsxNDA4LDEyIEBACiB7Im5Db250ZXh0RGVpbml0VG9DbGllbnQiLCAgICAgICAgICIoKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkNvbnRleHREZWluaXRUb0NsaWVudCB9LAogCiB7Im5GaWxlT3BlbiIsICAgICAgICAgICAgICAgICAgICAgICIoW0IpSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkZpbGVPcGVuIH0sCit7Im5GaWxlQTNEQ3JlYXRlRnJvbUFzc2V0U3RyZWFtIiwgIihJKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluRmlsZUEzRENyZWF0ZUZyb21Bc3NldFN0cmVhbSB9LAoreyJuRmlsZUEzREdldE51bUluZGV4RW50cmllcyIsICAgICAiKEkpSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5GaWxlQTNER2V0TnVtSW5kZXhFbnRyaWVzIH0sCit7Im5GaWxlQTNER2V0SW5kZXhFbnRyaWVzIiwgICAgICAgICIoSUlbSVtMamF2YS9sYW5nL1N0cmluZzspViIsICAgICAgICAgICh2b2lkKiluRmlsZUEzREdldEluZGV4RW50cmllcyB9LAoreyJuRmlsZUEzREdldEVudHJ5QnlJbmRleCIsICAgICAgICAiKElJKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5GaWxlQTNER2V0RW50cnlCeUluZGV4IH0sCisKK3sibkZvbnRDcmVhdGVGcm9tRmlsZSIsICAgICAgICAgICAiKExqYXZhL2xhbmcvU3RyaW5nO0lJKUkiLCAgICAgICAgICAgICAodm9pZCopbkZvbnRDcmVhdGVGcm9tRmlsZSB9LAogCiB7Im5FbGVtZW50Q3JlYXRlIiwgICAgICAgICAgICAgICAgICIoSUlaSSlJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkVsZW1lbnRDcmVhdGUgfSwKIHsibkVsZW1lbnRDcmVhdGUyIiwgICAgICAgICAgICAgICAgIihbSVtMamF2YS9sYW5nL1N0cmluZzspSSIsICAgICAgICAgICAgICh2b2lkKiluRWxlbWVudENyZWF0ZTIgfSwKQEAgLTE0MjAsMjggKzE0NTksMjQgQEAKIHsibkFkYXB0ZXIyRENyZWF0ZSIsICAgICAgICAgICAgICAgIigpSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQWRhcHRlcjJEQ3JlYXRlIH0sCiAKIHsiblNjcmlwdEJpbmRBbGxvY2F0aW9uIiwgICAgICAgICAgIihJSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0QmluZEFsbG9jYXRpb24gfSwKLXsiblNjcmlwdFNldENsZWFyQ29sb3IiLCAgICAgICAgICAgIihJRkZGRilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0U2V0Q2xlYXJDb2xvciB9LAoteyJuU2NyaXB0U2V0Q2xlYXJEZXB0aCIsICAgICAgICAgICAiKElGKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRTZXRDbGVhckRlcHRoIH0sCi17Im5TY3JpcHRTZXRDbGVhclN0ZW5jaWwiLCAgICAgICAgICIoSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblNjcmlwdFNldENsZWFyU3RlbmNpbCB9LAogeyJuU2NyaXB0U2V0VGltZVpvbmUiLCAgICAgICAgICAgICAiKElbQilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRTZXRUaW1lWm9uZSB9LAoteyJuU2NyaXB0U2V0VHlwZSIsICAgICAgICAgICAgICAgICAiKElaTGphdmEvbGFuZy9TdHJpbmc7SSlWIiwgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRTZXRUeXBlIH0sCi17Im5TY3JpcHRTZXRSb290IiwgICAgICAgICAgICAgICAgICIoWilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblNjcmlwdFNldFJvb3QgfSwKLXsiblNjcmlwdFNldEludm9rYWJsZSIsICAgICAgICAgICAgIihMamF2YS9sYW5nL1N0cmluZztJKVYiLCAgICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0U2V0SW52b2tlIH0sCiB7Im5TY3JpcHRJbnZva2UiLCAgICAgICAgICAgICAgICAgICIoSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblNjcmlwdEludm9rZSB9LAoreyJuU2NyaXB0SW52b2tlViIsICAgICAgICAgICAgICAgICAiKElJW0IpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRJbnZva2VWIH0sCit7Im5TY3JpcHRTZXRWYXJJIiwgICAgICAgICAgICAgICAgICIoSUlJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblNjcmlwdFNldFZhckkgfSwKK3siblNjcmlwdFNldFZhckYiLCAgICAgICAgICAgICAgICAgIihJSUYpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0U2V0VmFyRiB9LAoreyJuU2NyaXB0U2V0VmFyViIsICAgICAgICAgICAgICAgICAiKElJW0IpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRTZXRWYXJWIH0sCiAKIHsiblNjcmlwdENCZWdpbiIsICAgICAgICAgICAgICAgICAgIigpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0Q0JlZ2luIH0sCiB7Im5TY3JpcHRDU2V0U2NyaXB0IiwgICAgICAgICAgICAgICIoW0JJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblNjcmlwdENTZXRTY3JpcHQgfSwKIHsiblNjcmlwdENDcmVhdGUiLCAgICAgICAgICAgICAgICAgIigpSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0Q0NyZWF0ZSB9LAoteyJuU2NyaXB0Q0FkZERlZmluZUkzMiIsICAgICAgICAgICAiKExqYXZhL2xhbmcvU3RyaW5nO0kpViIsICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRDQWRkRGVmaW5lSTMyIH0sCi17Im5TY3JpcHRDQWRkRGVmaW5lRiIsICAgICAgICAgICAgICIoTGphdmEvbGFuZy9TdHJpbmc7RilWIiwgICAgICAgICAgICAgICAodm9pZCopblNjcmlwdENBZGREZWZpbmVGIH0sCiAKLXsiblByb2dyYW1GcmFnbWVudFN0b3JlQmVnaW4iLCAgICAgIihJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbUZyYWdtZW50U3RvcmVCZWdpbiB9LAoteyJuUHJvZ3JhbUZyYWdtZW50U3RvcmVEZXB0aEZ1bmMiLCAiKEkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtRnJhZ21lbnRTdG9yZURlcHRoRnVuYyB9LAoteyJuUHJvZ3JhbUZyYWdtZW50U3RvcmVEZXB0aE1hc2siLCAiKFopViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtRnJhZ21lbnRTdG9yZURlcHRoTWFzayB9LAoteyJuUHJvZ3JhbUZyYWdtZW50U3RvcmVDb2xvck1hc2siLCAiKFpaWlopViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtRnJhZ21lbnRTdG9yZUNvbG9yTWFzayB9LAoteyJuUHJvZ3JhbUZyYWdtZW50U3RvcmVCbGVuZEZ1bmMiLCAiKElJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtRnJhZ21lbnRTdG9yZUJsZW5kRnVuYyB9LAoteyJuUHJvZ3JhbUZyYWdtZW50U3RvcmVEaXRoZXIiLCAgICAiKFopViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtRnJhZ21lbnRTdG9yZURpdGhlciB9LAoteyJuUHJvZ3JhbUZyYWdtZW50U3RvcmVDcmVhdGUiLCAgICAiKClJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtRnJhZ21lbnRTdG9yZUNyZWF0ZSB9LAoreyJuUHJvZ3JhbVN0b3JlQmVnaW4iLCAgICAgICAgICAgICAiKElJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtU3RvcmVCZWdpbiB9LAoreyJuUHJvZ3JhbVN0b3JlRGVwdGhGdW5jIiwgICAgICAgICAiKEkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtU3RvcmVEZXB0aEZ1bmMgfSwKK3siblByb2dyYW1TdG9yZURlcHRoTWFzayIsICAgICAgICAgIihaKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbVN0b3JlRGVwdGhNYXNrIH0sCit7Im5Qcm9ncmFtU3RvcmVDb2xvck1hc2siLCAgICAgICAgICIoWlpaWilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1TdG9yZUNvbG9yTWFzayB9LAoreyJuUHJvZ3JhbVN0b3JlQmxlbmRGdW5jIiwgICAgICAgICAiKElJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtU3RvcmVCbGVuZEZ1bmMgfSwKK3siblByb2dyYW1TdG9yZURpdGhlciIsICAgICAgICAgICAgIihaKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbVN0b3JlRGl0aGVyIH0sCit7Im5Qcm9ncmFtU3RvcmVDcmVhdGUiLCAgICAgICAgICAgICIoKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1TdG9yZUNyZWF0ZSB9LAogCiB7Im5Qcm9ncmFtQmluZENvbnN0YW50cyIsICAgICAgICAgICIoSUlJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1CaW5kQ29uc3RhbnRzIH0sCiB7Im5Qcm9ncmFtQmluZFRleHR1cmUiLCAgICAgICAgICAgICIoSUlJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1CaW5kVGV4dHVyZSB9LApAQCAtMTQ2NSw3ICsxNTAwLDcgQEAKIHsibkxpZ2h0U2V0UG9zaXRpb24iLCAgICAgICAgICAgICAgIihJRkZGKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluTGlnaHRTZXRQb3NpdGlvbiB9LAogCiB7Im5Db250ZXh0QmluZFJvb3RTY3JpcHQiLCAgICAgICAgICIoSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkNvbnRleHRCaW5kUm9vdFNjcmlwdCB9LAoteyJuQ29udGV4dEJpbmRQcm9ncmFtRnJhZ21lbnRTdG9yZSIsIihJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Db250ZXh0QmluZFByb2dyYW1GcmFnbWVudFN0b3JlIH0sCit7Im5Db250ZXh0QmluZFByb2dyYW1TdG9yZSIsICAgICAgICIoSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQ29udGV4dEJpbmRQcm9ncmFtU3RvcmUgfSwKIHsibkNvbnRleHRCaW5kUHJvZ3JhbUZyYWdtZW50IiwgICAgIihJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQ29udGV4dEJpbmRQcm9ncmFtRnJhZ21lbnQgfSwKIHsibkNvbnRleHRCaW5kUHJvZ3JhbVZlcnRleCIsICAgICAgIihJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQ29udGV4dEJpbmRQcm9ncmFtVmVydGV4IH0sCiB7Im5Db250ZXh0QmluZFByb2dyYW1SYXN0ZXIiLCAgICAgICIoSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkNvbnRleHRCaW5kUHJvZ3JhbVJhc3RlciB9LApkaWZmIC0tZ2l0IGEvaWN1NGovamF2YS9hbmRyb2lkL2ljdS90ZXh0L0FyYWJpY1NoYXBpbmcuamF2YSBiL2ljdTRqL2phdmEvYW5kcm9pZC9pY3UvdGV4dC9BcmFiaWNTaGFwaW5nLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMTNlMjE3NQotLS0gL2Rldi9udWxsCisrKyBiL2ljdTRqL2phdmEvYW5kcm9pZC9pY3UvdGV4dC9BcmFiaWNTaGFwaW5nLmphdmEKQEAgLTAsMCArMSwxOTQ3IEBACisvKgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgIENvcHlyaWdodCAoQykgMjAwMS0yMDA5LCBJbnRlcm5hdGlvbmFsIEJ1c2luZXNzIE1hY2hpbmVzCisqICAgQ29ycG9yYXRpb24gYW5kIG90aGVycy4gIEFsbCBSaWdodHMgUmVzZXJ2ZWQuCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqLworCisvKgorICogUG9ydGVkIHdpdGggbWlub3IgbW9kaWZpY2F0aW9ucyBmcm9tIElDVTRKIDQuMidzCisgKiBjb20uaWJtLmljdS50ZXh0LkFyYWJpY1NoYXBpbmcgY2xhc3MuCisgKi8KKworcGFja2FnZSBhbmRyb2lkLmljdS50ZXh0OworCisKKy8qKgorICogU2hhcGUgQXJhYmljIHRleHQgb24gYSBjaGFyYWN0ZXIgYmFzaXMuCisgKgorICogPHA+QXJhYmljU2hhcGluZyBwZXJmb3JtcyBiYXNpYyBvcGVyYXRpb25zIGZvciAic2hhcGluZyIgQXJhYmljIHRleHQuIEl0IGlzIG1vc3QKKyAqIHVzZWZ1bCBmb3IgdXNlIHdpdGggbGVnYWN5I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sZW5ndGgpOworICAgICAgICB9CisgICAgICAgIGlmIChkZXN0ID09IG51bGwgJiYgZGVzdFNpemUgIT0gMCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigibnVsbCBkZXN0IHJlcXVpcmVzIGRlc3RTaXplID09IDAiKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoKGRlc3RTaXplICE9IDApICYmCisgICAgICAgICAgICAoZGVzdFN0YXJ0IDwgMCB8fCBkZXN0U2l6ZSA8IDAgfHwgZGVzdFN0YXJ0ICsgZGVzdFNpemUgPiBkZXN0Lmxlbmd0aCkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oImJhZCBkZXN0IHN0YXJ0ICgiICsgZGVzdFN0YXJ0ICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIikgb3Igc2l6ZSAoIiArIGRlc3RTaXplICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIikgZm9yIGJ1ZmZlciBvZiBsZW5ndGggIiArIGRlc3QubGVuZ3RoKTsKKyAgICAgICAgfQorICAgICAgICAvKiBWYWxpZGF0ZSBpbnB1dCBvcHRpb25zICovCisgICAgICAgIGlmICggKChvcHRpb25zJlRBU0hLRUVMX01BU0spID4gMCkgJiYKKyAgICAgICAgICAgICAhKCgob3B0aW9ucyAmIFRBU0hLRUVMX01BU0spPT1UQVNIS0VFTF9CRUdJTikgIHx8CisgICAgICAgICAgICAgICAoKG9wdGlvbnMgJiBUQVNIS0VFTF9NQVNLKT09VEFTSEtFRUxfRU5EICkgICB8fAorICAgICAgICAgICAgICAgKChvcHRpb25zICYgVEFTSEtFRUxfTUFTSyk9PVRBU0hLRUVMX1JFU0laRSApfHwKKyAgICAgICAgICAgICAgICgob3B0aW9ucyAmIFRBU0hLRUVMX01BU0spPT1UQVNIS0VFTF9SRVBMQUNFX0JZX1RBVFdFRUwpKSApeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiV3JvbmcgVGFzaGtlZWwgYXJndW1lbnQiKTsKKyAgICAgICAgfQorCisgICAgICAgLy8vQ0xPVkVSOk9GRgorICAgICAgIC8vQWNjb3JkaW5nIHRvIFN0ZXZlbiBMb29taXMsIHRoZSBjb2RlIGlzIHVucmVhY2hhYmxlIHdoZW4geW91IE9SIGFsbCB0aGUgY29uc3RhbnRzIHdpdGhpbiB0aGUgaWYgc3RhdGVtZW50cworICAgICAgIGlmKCgob3B0aW9ucyZMQU1BTEVGX01BU0spID4gMCkmJgorICAgICAgICAgICAgICAhKCgob3B0aW9ucyAmIExBTUFMRUZfTUFTSyk9PUxBTUFMRUZfQkVHSU4pICB8fAorICAgICAgICAgICAgICAgICgob3B0aW9ucyAmIExBTUFMRUZfTUFTSyk9PUxBTUFMRUZfRU5EICkgICB8fAorICAgICAgICAgICAgICAgICgob3B0aW9ucyAmIExBTUFMRUZfTUFTSyk9PUxBTUFMRUZfUkVTSVpFICl8fAorICAgICAgICAgICAgICAgICAoKG9wdGlvbnMgJiBMQU1BTEVGX01BU0spPT1MQU1BTEVGX0FVVE8pICB8fAorICAgICAgICAgICAgICAgICAoKG9wdGlvbnMgJiBMQU1BTEVGX01BU0spPT1MQU1BTEVGX05FQVIpKSl7CisgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIldyb25nIExhbSBBbGVmIGFyZ3VtZW50Iik7CisgICAgICAgfQorICAgICAgIC8vL0NMT1ZFUjpPTgorCisgICAgICAgLyogVmFsaWRhdGUgVGFzaGtlZWwgKFRhc2hrZWVsIHJlcGxhY2VtZW50IG9wdGlvbnMgc2hvdWxkIGJlIGVuYWJsZWQgaW4gc2hhcGluZyBtb2RlIG9ubHkpKi8KKyAgICAgICBpZigoKG9wdGlvbnMmVEFTSEtFRUxfT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ioKKyAgICAgKiBCaXQgbWFzayBmb3IgZGlyZWN0aW9uIGluZGljYXRvcnMuCisgICAgICogQHN0YWJsZSBJQ1UgMi4wCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgVEVYVF9ESVJFQ1RJT05fTUFTSyA9IDQ7CisKKworICAgIC8qKgorICAgICAqIExldHRlciBzaGFwaW5nIG9wdGlvbjogZG8gbm90IHBlcmZvcm0gbGV0dGVyIHNoYXBpbmcuCisgICAgICogQHN0YWJsZSBJQ1UgMi4wCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgTEVUVEVSU19OT09QID0gMDsKKworICAgIC8qKgorICAgICAqIExldHRlciBzaGFwaW5nIG9wdGlvbjogcmVwbGFjZSBub3JtYXRpdmUgbGV0dGVyIGNoYXJhY3RlcnMgaW4gdGhlIFUrMDYwMCAoQXJhYmljKSBibG9jaywKKyAgICAgKiBieSBzaGFwZWQgb25lcyBpbiB0aGUgVStGRTcwIChQcmVzZW50YXRpb24gRm9ybXMgQikgYmxvY2suIFBlcmZvcm1zIExhbS1BbGVmIGxpZ2F0dXJlCisgICAgICogc3Vic3RpdHV0aW9uLgorICAgICAqIEBzdGFibGUgSUNVIDIuMAorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IExFVFRFUlNfU0hBUEUgPSA4OworCisgICAgLyoqCisgICAgICogTGV0dGVyIHNoYXBpbmcgb3B0aW9uOiByZXBsYWNlIHNoYXBlZCBsZXR0ZXIgY2hhcmFjdGVycyBpbiB0aGUgVStGRTcwIChQcmVzZW50YXRpb24gRm9ybXMgQikgYmxvY2sKKyAgICAgKiBieSBub3JtYXRpdmUgb25lcyBpbiB0aGUgVSswNjAwIChBcmFiaWMpIGJsb2NrLiAgQ29udmVydHMgTGFtLUFsZWYgbGlnYXR1cmVzIHRvIHBhaXJzIG9mIExhbSBhbmQKKyAgICAgKiBBbGVmIGNoYXJhY3RlcnMsIGNvbnN1bW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ib29sZWFuIGVxdWFscyhPYmplY3QgcmhzKSB7CisgICAgICAgIHJldHVybiByaHMgIT0gbnVsbCAmJgorICAgICAgICAgICAgcmhzLmdldENsYXNzKCkgPT0gQXJhYmljU2hhcGluZy5jbGFzcyAmJgorICAgICAgICAgICAgb3B0aW9ucyA9PSAoKEFyYWJpY1NoYXBpbmcpcmhzKS5vcHRpb25zOworICAgIH0KKworICAgIC8qKgorICAgICAqIEBzdGFibGUgSUNVIDIuMAorICAgICAqLworICAgICAvLy9DTE9WRVI6T0ZGCisgICAgcHVibGljIGludCBoYXNoQ29kZSgpIHsKKyAgICAgICAgcmV0dXJuIG9wdGlvbnM7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHN0YWJsZSBJQ1UgMi4wCisgICAgICovCisgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKKyAgICAgICAgU3RyaW5nQnVmZmVyIGJ1ZiA9IG5ldyBTdHJpbmdCdWZmZXIoc3VwZXIudG9TdHJpbmcoKSk7CisgICAgICAgIGJ1Zi5hcHBlbmQoJ1snKTsKKworICAgICAgICBzd2l0Y2ggKG9wdGlvbnMgJiBMQU1BTEVGX01BU0spIHsKKyAgICAgICAgY2FzZSBMQU1BTEVGX1JFU0laRTogYnVmLmFwcGVuZCgiTGFtQWxlZiByZXNpemUiKTsgYnJlYWs7CisgICAgICAgIGNhc2UgTEFNQUxFRl9ORUFSOiBidWYuYXBwZW5kKCJMYW1BbGVmIHNwYWNlcyBhdCBuZWFyIik7IGJyZWFrOworICAgICAgICBjYXNlIExBTUFMRUZfQkVHSU46IGJ1Zi5hcHBlbmQoIkxhbUFsZWYgc3BhY2VzIGF0IGJlZ2luIik7IGJyZWFrOworICAgICAgICBjYXNlIExBTUFMRUZfRU5EOiBidWYuYXBwZW5kKCJMYW1BbGVmIHNwYWNlcyBhdCBlbmQiKTsgYnJlYWs7CisgICAgICAgIGNhc2UgTEFNQUxFRl9BVVRPOiBidWYuYXBwZW5kKCJsYW1BbGVmIGF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ICAgICAnXHUwNjIyJywgLy8gRkVGNgorICAgICAgICAnXHUwNjIzJywgLy8gRkVGNworICAgICAgICAnXHUwNjIzJywgLy8gRkVGOAorICAgICAgICAnXHUwNjI1JywgLy8gRkVGOQorICAgICAgICAnXHUwNjI1JywgLy8gRkVGQQorICAgICAgICAnXHUwNjI3JywgLy8gRkVGQgorICAgICAgICAnXHUwNjI3JyAgLy8gRkVGQworICAgIH07CisqLworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IHRhaWxGYW1pbHlJc29sYXRlZEZpbmFsW10gPSB7CisgICAgICAgIC8qIEZFQjEgKi8gMSwKKyAgICAgICAgLyogRkVCMiAqLyAxLAorICAgICAgICAvKiBGRUIzICovIDAsCisgICAgICAgIC8qIEZFQjQgKi8gMCwKKyAgICAgICAgLyogRkVCNSAqLyAxLAorICAgICAgICAvKiBGRUI2ICovIDEsCisgICAgICAgIC8qIEZFQjcgKi8gMCwKKyAgICAgICAgLyogRkVCOCAqLyAwLAorICAgICAgICAvKiBGRUI5ICovIDEsCisgICAgICAgIC8qIEZFQkEgKi8gMSwKKyAgICAgICAgLyogRkVCQiAqLyAwLAorICAgICAgICAvKiBGRUJDICovIDAsCisgICAgICAgIC8qIEZFQkQgKi8gMSwKKyAgICAgICAgLyogRkVCRSAqLyAxCisgICAgfTsKKworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCB0YXNoa2VlbE1lZGlhbFtdID0geworICAgICAgICAvKiBGRTcwICovIDAsCisgICAgICAgIC8qIEZFNzEgKi8gMSwKKyAgICAgICAgLyogRkU3MiAqLyAwLAorICAgICAgICAvKiBGRTczICovIDAsCisgICAgICAgIC8qIEZFNzQgKi8gMCwKKyAgICAgICAgLyogRkU3NSAqLyAwLAorICAgICAgICAvKiBGRTc2ICovIDAsCisgICAgICAgIC8qIEZFNzcgKi8gMSwKKyAgICAgICAgLyogRkU3OCAqLyAwLAorICAgICAgICAvKiBGRTc5ICovIDEsCisgICAgICAgIC8qIEZFN0EgKi8gMCwKKyAgICAgICAgLyogRkU3QiAqLyAxLAorICAgICAgICAvKiBGRTdDICovIDAsCisgICAgICAgIC8qIEZFN0QgKi8gMSwKKyAgICAgICAgLyogRkU3RSAqLyAwLAorICAgICAgICAvKiBGRTdGICovIDEKKyAgICB9OworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgY2hhciB5ZWhIYW16YVRvWWVoW10gPQorICAgIHsKKyAgICAvKiBpc29sYXRlZCovIDB4RkVFRiwKKyAgICAvKiBmaW5hbCAgICovIDB4RkVGMAorICAgIH07CisKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBjaGFyIGNvbnZlcnROb3JtYWxpemVkTGFtQWxlZltdID0geworICAgICAgICAnXHUwNjIyJywgLy8gMDY1QworICAgICAgICAnXHUwNjIzJywgLy8gMDY1RAorICAgICAgICAnXHUwNjI1JywgLy8gMDY1RQorICAgICAgICAnXHUwNjI3JywgLy8gMDY1RgorICAgIH07CisKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnRbXSBhcmFMaW5rID0geworICAgICAgICAxICAgICAgICAgICArIDMyICsgMjU2ICogMHgxMSwgIC8qMHgwNjIyKi8KKyAgICAgICAgMSAgICAgICAgICAgKyAzMiArIDI1NiAqIDB4MTMsICAvKjB4MDYyMyovCisgICAgICAgIDEgICAgICAgICAgICAgICAgKyAyNTYgKiAweDE1LCAgLyoweDA2MjQqLworICAgICAgICAxICAgICAgICAgICArIDMyICsgMjU2ICogMHgxNywgIC8qMHgwNjI1Ki8KKyAgICAgICAgMSArIDIgICAgICAgICAgICArIDI1NiAqIDB4MTksICAvKjB4MDYyNiovCisgICAgICAgIDEgICAgICAgICAgICsgMzIgKyAyNTYgKiAweDFELCAgLyoweDA2MjcqLworICAgICAgICAxICsgMiAgICAgICAgICAgICsgMjU2ICogMHgxRiwgIC8qMHgwNjI4Ki8KKyAgICAgICAgMSAgICAgICAgICAgICAgICArIDI1NiAqIDB4MjMsICAvKjB4MDYyOSovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDI1LCAgLyoweDA2MkEqLworICAgICAgICAxICsgMiAgICAgICAgICAgICsgMjU2ICogMHgyOSwgIC8qMHgwNjJCKi8KKyAgICAgICAgMSArIDIgICAgICAgICAgICArIDI1NiAqIDB4MkQsICAvKjB4MDYyQyovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDMxLCAgLyoweDA2MkQqLworICAgICAgICAxICsgMiAgICAgICAgICAgICsgMjU2ICogMHgzNSwgIC8qMHgwNjJFKi8KKyAgICAgICAgMSAgICAgICAgICAgICAgICArIDI1NiAqIDB4MzksICAvKjB4MDYyRiovCisgICAgICAgIDEgICAgICAgICAgICAgICAgKyAyNTYgKiAweDNCLCAgLyoweDA2MzAqLworICAgICAgICAxICAgICAgICAgICAgICAgICsgMjU2ICogMHgzRCwgIC8qMHgwNjMxKi8KKyAgICAgICAgMSAgICAgICAgICAgICAgICArIDI1NiAqIDB4M0YsICAvKjB4MDYzMiovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDQxLCAgLyoweDA2MzMqLworICAgICAgICAxICsgMiAgICAgICAgICAgICsgMjU2ICogMHg0NSwgIC8qMHgwNjM0Ki8KKyAgICAgICAgMSArIDIgICAgICAgICAgICArIDI1NiAqIDB4NDksICAvKjB4MDYzNSovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDRELCAgLyoweDA2MzYqLworICAgICAgICAxICsgMiAgICAgICAgICAgICsgMjU2ICogMHg1MSwgIC8qMHgwNjM3Ki8KKyAgICAgICAgMSArIDIgICAgICAgICAgICArIDI1NiAqIDB4NTUsICAvKjB4MDYzOCovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDU5LCAgLyoweDA2MzkqLworICAgICAgICAxICsgMiAgICAgICAgICAgICsgMjU2ICogMHg1RCwgIC8qMHgwNjNBKi8KKyAgICAgICAgMCwgMCwgMCwgMCwgMCwgICAgICAgICAgICAgICAgICAvKjB4MDYzQi0weDA2M0YqLworICAgICAgICAxICsgMiwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qMHgwNjQwKi8KKyAgICAgICAgMSArIDIgICAgICAgICAgICArIDI1NiAqIDB4NjEsICAvKjB4MDY0MSovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDY1LCAgLyoweDA2NDIqLworICAgICAgICAxICsgMiAgICAgICAgICAgICsgMjU2ICogMHg2OSwgIC8qMHgwNjQzKi8KKyAgICAgICAgMSArIDIgICAgICAgKyAxNiArIDI1NiAqIDB4NkQsICAvKjB4MDY0NCovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDcxLCAgLyoweDA2NDUqLworICAgICAgICAxICsgMiAgICAgICAgICAgICsgMjU2ICogMHg3NSwgIC8qMHgwNjQ2Ki8KKyAgICAgICAgMSArIDIgICAgICAgICAgICArIDI1NiAqIDB4NzksICAvKjB4MDY0NyovCisgICAgICAgIDEgICAgICAgICAgICAgICAgKyAyNTYgKiAweDdELCAgLyoweDA2NDgqLworICAgICAgICAxICAgICAgICAgICAgICAgICsgMjU2ICogMHg3RiwgIC8qMHgwNjQ5Ki8KKyAgICAgICAgMSArIDIgICAgICAgICAgICArIDI1NiAqIDB4ODEsICAvKjB4MDY0QSovCisgICAgICAgIDQsIDQsIDQsIDQsICAgICAgICAgICAgICAgICAgICAgLyoweDA2NEItMHgwNjRFKi8KKyAgICAgICAgNCwgNCwgNCwgNCwgICAgICAgICAgICAgICAgICAgICAvKjB4MDY0Ri0weDA2NTIqLworICAgICAgICA0LCA0LCA0LCAwLCAwLCAgICAgICAgICAgICAgICAgIC8qMHgwNjUzLTB4MDY1NyovCisgICAgICAgIDAsIDAsIDAsIDAsICAgICAgICAgICAgICAgICAgICAgLyoweDA2NTgtMHgwNjVCKi8KKyAgICAgICAgMSAgICAgICAgICAgICAgICArIDI1NiAqIDB4ODUsICAvKjB4MDY1QyovCisgICAgICAgIDEgICAgICAgICAgICAgICAgKyAyNTYgKiAweDg3LCAgLyoweDA2NUQqLworICAgICAgICAxICAgICAgICAgICAgICAgICsgMjU2ICogMHg4OSwgIC8qMHgwNjVFKi8KKyAgICAgICAgMSAgICAgICAgICAgICAgICArIDI1NiAqIDB4OEIsICAvKjB4MDY1RiovCisgICAgICAgIDAsIDAsIDAsIDAsIDAsICAgICAgICAgICAgICAgICAgLyoweDA2NjAtMHgwNjY0Ki8KKyAgICAgICAgMCwgMCwgMCwgMCwgMCwgICAgICAgICAgICAgICAgICAvKjB4MDY2NS0weDA2NjkqLworICAgICAgICAwLCAwLCAwLCAwLCAwLCAwLCAgICAgICAgICAgICAgIC8qMHgwNjZBLTB4MDY2RiovCisgICAgICAgIDQsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoweDA2NzAqLworICAgICAgICAwLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qMHgwNjcxKi8KKyAgICAgICAgMSAgICAgICAgICAgKyAzMiwgICAgICAgICAgICAgICAvKjB4MDY3MiovCisgICAgICAgIDEgICAgICAgICAgICsgMzIsICAgICAgICAgICAgICAgLyoweDA2NzMqLworICAgICAgICAwLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qMHgwNjc0Ki8KKyAgICAgICAgMSAgICAgICAgICAgKyAzMiwgICAgICAgICAgICAgICAvKjB4MDY3NSovCisgICAgICAgIDEsIDEsICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoweDA2NzYtMHgwNjc3Ki8KKyAgICAgICAgMSsyLCAxKzIsIDErMiwgMSsyLCAxKzIsIDErMiwgICAvKjB4MDY3OC0weDA2N0QqLworICAgICAgICAxKzIsIDErMiwgMSsyLCAxKzIsIDErMiwgMSsyLCAgIC8qMHgwNjdFLTB4MDY4MyovCisgICAgICAgIDErMiwgMSsyLCAxKzIsIDErMiwgICAgICAgICAgICAgLyoweDA2ODQtMHgwNjg3Ki8KKyAgICAgICAgMSwgMSwgMSwgMSwgMSwgMSwgMSwgMSwgMSwgMSwgICAvKjB4MDY4OC0weDA2OTEqLworICAgICAgICAxLCAxLCAxLCAxLCAxLCAxLCAxLCAxLCAgICAgICAgIC8qMHgwNjkyLTB4MDY5OSovCisgICAgICAgIDErMiwgMSsyLCAxKzIsIDErMiwgMSsyLCAxKzIsICAgLyoweDA2OUEtMHgwNkEzKi8KKyAgICAgICAgMSsyLCAxKzIsIDErMiwgMSsyLCAgICAgICAgICAgICAvKjB4MDY5QS0weDA2QTMqLworICAgICAgICAxKzIsIDErMiwgMSsyLCAxKzIsIDErMiwgMSsyLCAgIC8qMHgwNkE0LTB4MDZBRCovCisgICAgICAgIDErMiwgMSsyLCAxKzIsIDErMiwgICAgICAgICAgICAgLyoweDA2QTQtMHgwNkFEKi8KKyAgICAgICAgMSsyLCAxKzIsIDErMiwgMSsyLCAxKzIsIDErMiwgICAvKjB4MDZBRS0weDA2QjcqLworICAgICAgICAxKzIsIDErMiwgMSsyLCAxKzIsICAgICAgICAgICAgIC8qMHgwNkFFLTB4MDZCNyovCisgICAgICAgIDErMiwgMSsyLCAxKzIsIDErMiwgMSsyLCAxKzIsICAgLyoweDA2QjgtMHgwNkJGKi8KKyAgICAgICAgMSsyLCAxKzIsICAgICAgICAgICAgICAgICAgICAgICAvKjB4MDZCOC0weDA2QkYqLworICAgICAgICAxLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qMHgwNkMwKi8KKyAgICAgICAgMSsyLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKjB4MDZDMSovCisgICAgICAgIDEsIDEsIDEsIDEsIDEsIDEsIDEsIDEsIDEsIDEsICAgLyoweDA2QzItMHgwNkNCKi8KKyAgICAgICAgMSsyLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKjB4MDZDQyovCisgICAgICAgIDEsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoweDA2Q0QqLworICAgICAgICAxKzIsIDErMiwgMSsyLCAxKzIsICAgICAgICAgICAgIC8qMHgwNkNFLTB4MDZEMSovCisgICAgICAgIDEsIDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoweDA2RDItMHgwNkQzKi8KKyAgICB9OworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50W10gcHJlc0xpbmsgPSB7CisgICAgICAgIDEgKyAyLCAgICAgICAgICAgICAgICAgICAgICAgIC8qMHhGRTcwKi8KKyAgICAgICAgMSArIDIsICAgICAgICAgICAgICAgICAgICAgICAgLyoweEZFNzEqLworICAgICAgICAxICsgMiwgMCwgMSsgMiwgMCwgMSsgMiwgICAgICAvKjB4RkU3Mi0weEZFNzYqLworICAgICAgICAxICsgMiwgICAgICAgICAgICAgICAgICAgICAgICAvKjB4RkU3NyovCisgICAgICAgIDErIDIsIDEgKyAyLCAxKzIsIDEgKyAyLCAgICAgIC8qMHhGRTc4LTB4RkU4MSovCisgICAgICAgIDErIDIsIDEgKyAyLCAxKzIsIDEgKyAyLCAgICAgIC8qMHhGRTgyLTB4RkU4NSovCisgICAgICAgIDAsIDAgKyAzMiwgMSArIDMyLCAwICsgMzIsICAgIC8qMHhGRTg2LTB4RkU4OSovCisgICAgICAgIDEgKyAzMiwgMCwgMSwgIDAgKyAzMiwgICAgICAgIC8qMHhGRThBLTB4RkU4RCovCisgICAgICAgIDEgKyAzMiwgMCwgMiwgIDEgKyAyLCAgICAgICAgIC8qMHhGRThFLTB4RkU5MSovCisgICAgICAgIDEsIDAgKyAzMiwgMSArIDMyLCAwLCAgICAgICAgIC8qMHhGRTkyLTB4RkU5NSovCisgICAgICAgIDIsIDEgKyAyLCAxLCAwLCAgICAgICAgICAgICAgIC8qMHhGRTk2LTB4RkU5OSovCisgICAgICAgIDEsIDAsIDIsIDEgKyAyLCAgICAgICAgICAgICAgIC8qMHhGRTlBLTB4RkU5RCovCisgICAgICAgIDEsIDAsIDIsIDEgKyAyLCAgICAgICAgICAgICAgIC8qMHhGRTlFLTB4RkVBMSovCisgICAgICAgIDEsIDAsIDIsIDEgKyAyLCAgICAgICAgICAgICAgIC8qMHhGRUEyLTB4RkVBNSovCisgICAgICAgIDEsIDAsIDIsIDEgKyAyLCAgICAgICAgICAgICAgIC8qMHhGRUE2LTB4RkVBOSovCisgICAgICAgIDEsIDAsIDIsIDEgKyAyLCAgICAgICAgICAgICAgIC8qMHhGRUFBLTB4RkVBRCovCisgICAgICAgIDEsIDAsIDEsIDAsICAgICAgICAgICAgICAgICAgIC8qMHhGRUFFLTB4RkVCMSovCisgICAgICAgIDEsIDAsIDEsIDAsICAgICAgICAgICAgICAgICAgIC8qMHhGRUIyLTB4RkVCNSovCisgICAgICAgIDEsIDAsIDIsIDErMiwgICAgICAgICAgICAgICAgIC8qMHhGRUI2LTB4RkVCOSovCisgICAgICAgIDEsIDAsIDIsIDErMiwgICAgICAgICAgICAgICAgIC8qMHhGRUJBLTB4RkVCRCovCisgICAgICAgIDEsIDAsIDIsIDErMiwgICAgICAgICAgICAgICAgIC8qMHhGRUJFLTB4RkVDMSovCisgICAgICAgIDEsIDAsIDIsIDErMiwgICAgICAgICAgICAgICAgIC8qMHhGRUMyLTB4RkVDNSovCisgICAgICAgIDEsIDAsIDIsIDErMiwgICAgICAgICAgICAgICAgIC8qMHhGRUM2LTB4RkVDOSovCisgICAgICAgIDEsIDAsIDIsIDErMiwgICAgICAgICAgICAgICAgIC8qMHhGRUNBLTB4RkVDRCovCisgICAgICAgIDEsIDAsIDIsIDErMiwgICAgICAgICAgICAgICAgIC8qMHhGRUNFLTB4RkVEMSovCisgICAgICAgIDEsIDAsIDIsIDErMiwgICAgICAgICAgICAgICAgIC8qMHhGRUQyLTB4RkVENSovCisgICAgICAgIDEsIDAsIDIsIDErMiwgICAgICAgICAgICAgICAgIC8qMHhGRUQ2LTB4RkVEOSovCisgICAgICAgIDEsIDAsIDIsIDErMiwgICAgICAgICAgICAgICAgIC8qMHhGRURBLTB4RkVERCovCisgICAgICAgIDEsIDAsIDIsIDErMiwgICAgICAgICAgICAgICAgIC8qMHhGRURFLTB4RkVFMSovCisgICAgICAgIDEsIDAgKyAxNiwgMiArIDE2LCAxICsgMiArMTYsIC8qMHhGRUUyLTB4RkVFNSovCisgICAgICAgIDEgKyAxNiwgMCwgMiwgMSsyLCAgICAgICAgICAgIC8qMHhGRUU2LTB4RkVFOSovCisgICAgICAgIDEsIDAsIDIsIDErMiwgICAgICAgICAgICAgICAgIC8qMHhGRUVBLTB4RkVFRCovCisgICAgICAgIDEsIDAsIDIsIDErMiwgICAgICAgICAgICAgICAgIC8qMHhGRUVFLTB4RkVGMSovCisgICAgICAgIDEsIDAsIDEsIDAsICAgICAgICAgICAgICAgICAgIC8qMHhGRUYyLTB4RkVGNSovCisgICAgICAgIDEsIDAsIDIsIDErMiwgICAgICAgICAgICAgICAgIC8qMHhGRUY2LTB4RkVGOSovCisgICAgICAgIDEsIDAsIDEsIDAsICAgICAgICAgICAgICAgICAgIC8qMHhGRUZBLTB4RkVGRCovCisgICAgICAgIDEsIDAsIDEsIDAsCisgICAgICAgIDEKKyAgICB9OworCisgICAgcHJpdmF0ZSBzdGF0aWMgaW50W10gY29udmVydEZFdG8wNiA9IHsKKyAgICAgICAgLyoqKioqKioqKioqMCoqKioqKjEqKioqKioyKioqKioqMyoqKioqKjQqKioqKio1KioqKioqNioqKioqKjcqKioqKio4KioqKioqOSoqKioqKkEqKioqKipCKioqKioqQyoqKioqKkQqKioqKipFKioqKioqRioqKi8KKyAgICAgICAgLypGRTcqLyAgIDB4NjRCLCAweDY0QiwgMHg2NEMsIDB4NjRDLCAweDY0RCwgMHg2NEQsIDB4NjRFLCAweDY0RSwgMHg2NEYsIDB4NjRGLCAweDY1MCwgMHg2NTAsIDB4NjUxLCAweDY1MSwgMHg2NTIsIDB4NjUyLAorICAgICAgICAvKkZFOCovICAgMHg2MjEsIDB4NjIyLCAweDYyMiwgMHg2MjMsIDB4NjIzLCAweDYyNCwgMHg2MjQsIDB4NjI1LCAweDYyNSwgMHg2Mj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4LCAweDY0OCwgMHg2NDksCisgICAgICAgIC8qRkVGKi8gICAweDY0OSwgMHg2NEEsIDB4NjRBLCAweDY0QSwgMHg2NEEsIDB4NjVDLCAweDY1QywgMHg2NUQsIDB4NjVELCAweDY1RSwgMHg2NUUsIDB4NjVGLCAweDY1RgorICAgIH07CisKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgc2hhcGVUYWJsZVtdW11bXSA9IHsKKyAgICAgICAgeyB7MCwwLDAsMH0sIHswLDAsMCwwfSwgezAsMSwwLDN9LCB7MCwxLDAsMX0gfSwKKyAgICAgICAgeyB7MCwwLDIsMn0sIHswLDAsMSwyfSwgezAsMSwxLDJ9LCB7MCwxLDEsM30gfSwKKyAgICAgICAgeyB7MCwwLDAsMH0sIHswLDAsMCwwfSwgezAsMSwwLDN9LCB7MCwxLDAsM30gfSwKKyAgICAgICAgeyB7MCwwLDEsMn0sIHswLDAsMSwyfSwgezAsMSwxLDJ9LCB7MCwxLDEsM30gfQorICAgIH07CisKKyAgICAvKgorICAgICAqIFRoaXMgZnVuY3Rpb24gc2hhcGVzIEV1cm9wZWFuIGRpZ2l0cyB0byBBcmFiaWMtSW5kaWMgZGlnaXRzCisgICAgICogaW4tcGxhY2UsIHdyaXRpbmcgb3ZlciB0aGUgaW5wdXQgY2hhcmFjdGVycy4gIERhdGEgaXMgaW4gdmlzdWFsCisgICAgICogb3JkZXIuCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIHNoYXBlVG9BcmFiaWNEaWdpdHNXaXRoQ29udGV4dChjaGFyW10gZGVzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBsZW5ndGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyIGRpZ2l0QmFzZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gbGFzdFN0cm9uZ1dhc0FMKSB7CisgICAgICAgIGRpZ2l0QmFzZSAtPSAnMCc7IC8vIG1vdmUgY29tbW9uIGFkanVzdG1lbnQgb3V0IG9mIGxvb3AKKworICAgICAgICBmb3IoaW50IGkgPSBzdGFydCArIGxlbmd0aDsgLS1pID49IHN0YXJ0OykgeworICAgICAgICAgICAgY2hhciBjaCA9IGRlc3RbaV07CisgICAgICAgICAgICBzd2l0Y2ggKENoYXJhY3Rlci5nZXREaXJlY3Rpb25hbGl0eShjaCkpIHsKKyAgICAgICAgICAgIGNhc2UgQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0xFRlRfVE9fUklHSFQ6CisgICAgICAgICAgICBjYXNlIENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9SSUdIVF9UT19MRUZUOgorICAgICAgICAgICAgICAgIGxhc3RTdHJvbmdXYXNBTCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfUklHSFRfVE9fTEVGVF9BUkFCSUM6CisgICAgICAgICAgICAgICAgbGFzdFN0cm9uZ1dhc0FMID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0VVUk9QRUFOX05VTUJFUjoKKyAgICAgICAgICAgICAgICBpZiAobGFzdFN0cm9uZ1dhc0FMICYmIGNoIDw9ICdcdTAwMzknKSB7CisgICAgICAgICAgICAgICAgICAgIGRlc3RbaV0gPSAoY2hhcikoY2ggKyBkaWdpdEJhc2UpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKgorICAgICAqIE5hbWUgICAgOiBpbnZlcnRCdWZmZXIKKyAgICAgKiBGdW5jdGlvbjogVGhpcyBmdW5jdGlvbiBpbnZlcnRzIHRoZSBidWZmZXIsIGl0J3MgdXNlZAorICAgICAqICAgICAgICAgICBpbiBjYXNlIHRoZSB1c2VyIHNwZWNpZmllcyB0aGUgYnVmZmVyIHRvIGJlCisgICAgICogICAgICAgICAgIFRFWFRfRElSRUNUSU9OX0xPR0lDQUwKKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyB2b2lkIGludmVydEJ1ZmZlcihjaGFyW10gYnVmZmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbGVuZ3RoKSB7CisKKyAgICAgICAgZm9yKGludCBpID0gc3RhcnQsIGogPSBzdGFydCArIGxlbmd0aCAtIDE7IGkgPCBqOyBpKyssIC0taikgeworICAgICAgICAgICAgY2hhciB0ZW1wID0gYnVmZmVyW2ldOworICAgICAgICAgICAgYnVmZmVyW2ldID0gYnVmZmVyW2pdOworICAgICAgICAgICAgYnVmZmVyW2pdID0gdGVtcDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qCisgICAgICogTmFtZSAgICA6IGNoYW5nZUxhbUFsZWYKKyAgICAgKiBGdW5jdGlvbjogQ29udmVydHMgdGhlIEFsZWYgY2hhcmFjdGVycyBpbnRvIGFuIGVxdWl2YWxlbnQKKyAgICAgKiAgICAgICAgICAgTGFtQWxlZiBsb2NhdGlvbiBpbiB0aGUgMHgwNnh4IFJhbmdlLCB0aGlzIGlzIGFuCisgICAgICogICAgICAgICAgIGludGVybWVkaWF0ZSBzdGFnZSBpbiB0aGUgb3BlcmF0aW9uIG9mIHRoZSBwcm9ncmFtCisgICAgICogICAgICAgICAgIGxhdGVyIGl0J2xsIGJlIGNvbnZlcnRlZCBp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ICAgICAgICAgIChjaCA9PSAnXHUwNjI5JykpIHsKKyAgICAgICAgICAgIHJldHVybiAxOworICAgICAgICB9IGVsc2UgaWYgKGNoID49ICdcdTA2NEInICYmIGNoPD0gJ1x1MDY1MicpIHsKKyAgICAgICAgICAgIHJldHVybiAyOworICAgICAgICB9IGVsc2UgaWYgKGNoID49IDB4MDY1MyAmJiBjaCA8PSAweDA2NTUgfHwKKyAgICAgICAgICAgICAgICAgICBjaCA9PSAweDA2NzAgfHwKKyAgICAgICAgICAgICAgICAgICBjaCA+PSAweEZFNzAgJiYgY2ggPD0gMHhGRTdGKSB7CisgICAgICAgICAgICByZXR1cm4gMzsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9CisgICAgfQorCisgICAgLyoKKyAgICAgKiBOYW1lICAgIDogZ2V0TGluaworICAgICAqIEZ1bmN0aW9uOiBSZXNvbHZlcyB0aGUgbGluayBiZXR3ZWVuIHRoZSBjaGFyYWN0ZXJzIGFzCisgICAgICogICAgICAgICAgIEFyYWJpYyBjaGFyYWN0ZXJzIGhhdmUgZm91ciBmb3JtcyA6CisgICAgICogICAgICAgICAgIElzb2xhdGVkLCBJbml0aWFsLCBNaWRkbGUgYW5kIEZpbmFsIEZvcm0KKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBpbnQgZ2V0TGluayhjaGFyIGNoKSB7CisgICAgICAgIGlmIChjaCA+PSAnXHUwNjIyJyAmJiBjaCA8PSAnXHUwNkQzJykgeworICAgICAgICAgICAgcmV0dXJuIGFyYUxpbmtbY2ggLSAnXHUwNjIyJ107CisgICAgICAgIH0gZWxzZSBpZiAoY2ggPT0gJ1x1MjAwRCcpIHsKKyAgICAgICAgICAgIHJldHVybiAzOworICAgICAgICB9IGVsc2UgaWYgKGNoID49ICdcdTIwNkQnICYmIGNoIDw9ICdcdTIwNkYnKSB7CisgICAgICAgICAgICByZXR1cm4gNDsKKyAgICAgICAgfSBlbHNlIGlmIChjaCA+PSAnXHVGRTcwJyAmJiBjaCA8PSAnXHVGRUZDJykgeworICAgICAgICAgICAgcmV0dXJuIHByZXNMaW5rW2NoIC0gJ1x1RkU3MCddOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKgorICAgICAqIE5hbWUgICAgOiBjb3VudFNwYWNlcworICAgICAqIEZ1bmN0aW9uOiBDb3VudHMgdGhlIG51bWJlciBvZiBzcGFjZXMKKyAgICAgKiAgICAgICAgICAgYXQgZWFjaCBlbmQgb2YgdGhlIGxvZ2ljYWwgYnVmZmVyCisgICAgICovCisgICAgcHJpdmF0ZSBzdGF0aWMgaW50IGNvdW50U3BhY2VzTGVmdChjaGFyW10gZGVzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjb3VudCkgeworICAgICAgICBmb3IgKGludCBpID0gc3RhcnQsIGUgPSBzdGFydCArIGNvdW50OyBpIDwgZTsgKytpKSB7CisgICAgICAgICAgICBpZiAoZGVzdFtpXSAhPSBTUEFDRV9DSEFSKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGkgLSBzdGFydDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gY291bnQ7CisgICAgfQorCisgICAgcHJpdmF0ZSBzdGF0aWMgaW50IGNvdW50U3BhY2VzUmlnaHQoY2hhcltdIGRlc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjb3VudCkgeworCisgICAgICAgIGZvciAoaW50IGkgPSBzdGFydCArIGNvdW50OyAtLWkgPj0gc3RhcnQ7KSB7CisgICAgICAgICAgICBpZiAoZGVzdFtpXSAhPSBTUEFD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jaGFyYWN0ZXIgaXMgYSBzZWVuIGZhbWlseSBjaGFyYWN0ZXIgaW4gdGhlIFVuaWNvZGUKKyAgICAgICogICAgICAgICAgICAwNiByYW5nZSBvdGhlcndpc2UgcmV0dXJucyAwCisgICAgICovCisKKyAgICBwcml2YXRlIHN0YXRpYyBpbnQgaXNTZWVuRmFtaWx5Q2hhcihjaGFyICBjaCl7CisgICAgICAgIGlmIChjaCA+PSAweDYzMyAmJiBjaCA8PSAweDYzNil7CisgICAgICAgICAgICByZXR1cm4gMTsKKyAgICAgICAgfWVsc2UgeworICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKgorICAgICAqTmFtZSAgICAgOiBpc1RhaWxDaGFyCisgICAgICpGdW5jdGlvbiA6IHJldHVybnMgdHJ1ZSBpZiB0aGUgY2hhcmFjdGVyIG1hdGNoZXMgb25lIG9mIHRoZSB0YWlsIGNoYXJhY3RlcnMKKyAgICAgKiAgICAgICAgICAgKDB4ZmU3MyBvciAweDIwMGIpIG90aGVyd2lzZSByZXR1cm5zIGZhbHNlCisgICAgICovCisKKyAgICBwcml2YXRlIHN0YXRpYyBib29sZWFuIGlzVGFpbENoYXIoY2hhciBjaCkgeworICAgICAgICBpZihjaCA9PSBPTERfVEFJTF9DSEFSIHx8IGNoID09IE5FV19UQUlMX0NIQVIpeworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKgorICAgICAqTmFtZSAgICAgOiBpc0FsZWZNYWtzb3VyYUNoYXIKKyAgICAgKkZ1bmN0aW9uIDogcmV0dXJucyB0cnVlIGlmIHRoZSBjaGFyYWN0ZXIgaXMgYSBBbGVmIE1ha3NvdXJhIEZpbmFsIG9yIGlzb2xhdGVkCisgICAgICogICAgICAgICAgIG90aGVyd2lzZSByZXR1cm5zIGZhbHNlCisgICAgICovCisgICAgcHJpdmF0ZSBzdGF0aWMgYm9vbGVhbiBpc0FsZWZNYWtzb3VyYUNoYXIoY2hhciBjaCkgeworICAgICAgICByZXR1cm4gKCAoY2ggPT0gMHhGRUVGKSB8fCAoIGNoID09IDB4RkVGMCkgfHwgKGNoID09IDB4MDY0OSkpOworICAgIH0KKworICAgIC8qCisgICAgICogTmFtZSAgICAgOiBpc1llaEhhbXphQ2hhcgorICAgICAqIEZ1bmN0aW9uIDogcmV0dXJucyB0cnVlIGlmIHRoZSBjaGFyYWN0ZXIgaXMgYSB5ZWhIYW16YSBpc29sYXRlZCBvciB5ZWhoYW16YQorICAgICAqICAgICAgICAgICAgZmluYWwgaXMgZm91bmQgb3RoZXJ3aXNlIHJldHVybnMgZmFsc2UKKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBib29sZWFuIGlzWWVoSGFtemFDaGFyKGNoYXIgY2gpIHsKKyAgICAgICAgaWYoKGNoPT0weEZFODkpfHwoY2g9PTB4RkU4QSkpeworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH1lbHNleworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgLyoKKyAgICAgKk5hbWUgICAgIDogaXNUYXNoa2VlbENoYXJGRQorICAgICAqRnVuY3Rpb24gOiBSZXR1cm5zIHRydWUgZm9yIFRhc2hrZWVsIGNoYXJhY3RlcnMgaW4gRkUgcmFuZ2UgZWxzZSByZXR1cm4gZmFsc2UKKyAgICAgKi8KKworICAgIHByaXZhdGUgc3RhdGljIGJvb2xlYW4gaXNUYXNoa2VlbENoYXJGRShjaGFyIGNoKSB7CisgICAgICAgIHJldHVybiAoIGNoIT0weEZFNzUgJiYoY2g+PTB4RkU3MCAmJiBjaDw9IDB4RkU3RikgKTsKKyAgICB9CisKKyAgICAvKgorICAgICAqIE5hbWU6IGlzVGFzaGtlZWxPblRhdHdlZWxDaGFyCisgICAgICogRnVuY3Rpb246I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2VlbAorICAgICAqICAgICAgICAgICB3aXRoIHNoYWRkYSBpcyBpbiB0aGUgaXNvbGF0ZWQgZm9ybSAoaS5lLiBVbmljb2RlIEZDIHJhbmdlKQorICAgICAqICAgICAgICAgICByZXR1cm5zIDEgb3RoZXJ3aXNlIHJldHVybnMgMAorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIGludCBpc0lzb2xhdGVkVGFzaGtlZWxDaGFyKGNoYXIgY2gpeworICAgICAgICBpZiAoY2ggPj0gMHhmZTcwICYmIGNoIDw9IDB4ZmU3ZiAmJiBjaCAhPSBORVdfVEFJTF9DSEFSICYmIGNoICE9IDB4RkU3NSl7CisgICAgICAgICAgICByZXR1cm4gKDEgLSB0YXNoa2VlbE1lZGlhbCBbY2ggLSAweEZFNzBdKTsKKyAgICAgICAgfSBlbHNlIGlmKGNoID49IDB4ZmM1ZSAmJiBjaCA8PSAweGZjNjMpeworICAgICAgICAgICAgcmV0dXJuIDE7CisgICAgICAgIH0gZWxzZXsKKyAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9CisgICAgfQorCisgICAgLyoKKyAgICAgKiBOYW1lICAgIDogaXNBbGVmQ2hhcgorICAgICAqIEZ1bmN0aW9uOiBSZXR1cm5zIDEgZm9yIEFsZWYgY2hhcmFjdGVycyBlbHNlIHJldHVybiAwCisgICAgICovCisgICAgcHJpdmF0ZSBzdGF0aWMgYm9vbGVhbiBpc0FsZWZDaGFyKGNoYXIgY2gpIHsKKyAgICAgICAgcmV0dXJuIGNoID09ICdcdTA2MjInIHx8IGNoID09ICdcdTA2MjMnIHx8IGNoID09ICdcdTA2MjUnIHx8IGNoID09ICdcdTA2MjcnOworICAgIH0KKworICAgIC8qCisgICAgICogTmFtZSAgICA6IGlzTGFtQWxlZkNoYXIKKyAgICAgKiBGdW5jdGlvbjogUmV0dXJucyB0cnVlIGZvciBMYW1BbGVmIGNoYXJhY3RlcnMgZWxzZSByZXR1cm4gZmFsc2UKKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBib29sZWFuIGlzTGFtQWxlZkNoYXIoY2hhciBjaCkgeworICAgICAgICByZXR1cm4gY2ggPj0gJ1x1RkVGNScgJiYgY2ggPD0gJ1x1RkVGQyc7CisgICAgfQorCisgICAgcHJpdmF0ZSBzdGF0aWMgYm9vbGVhbiBpc05vcm1hbGl6ZWRMYW1BbGVmQ2hhcihjaGFyIGNoKSB7CisgICAgICAgIHJldHVybiBjaCA+PSAnXHUwNjVDJyAmJiBjaCA8PSAnXHUwNjVGJzsKKyAgICB9CisKKyAgICAvKgorICAgICAqIE5hbWUgICAgOiBjYWxjdWxhdGVTaXplCisgICAgICogRnVuY3Rpb246IFRoaXMgZnVuY3Rpb24gY2FsY3VsYXRlcyB0aGUgZGVzdFNpemUgdG8gYmUgdXNlZCBpbiBwcmVmbGlnaHRpbmcKKyAgICAgKiAgICAgICAgICAgd2hlbiB0aGUgZGVzdFNpemUgaXMgZXF1YWwgdG8gMAorICAgICAqLworICAgIHByaXZhdGUgaW50IGNhbGN1bGF0ZVNpemUoY2hhcltdIHNvdXJjZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzb3VyY2VTdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzb3VyY2VMZW5ndGgpIHsKKworICAgICAgICBpbnQgZGVzdFNpemUgPSBzb3VyY2VMZW5ndGg7CisKKyAgICAgICAgc3dpdGNoIChvcHRpb25zICYgTEVUVEVSU19NQVNLKSB7CisgICAgICAgIGNhc2UgTEVUVEVSU19TSEFQRToKKyAgICAgICAgY2FzZSBMRVRURVJTX1NIQVBFX1RBU0hLRUVMX0lTT0xBVEVEOgorICAgICAgICAgICAgaWYgKGlzTG9naWNhbCkgeworICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSBzb3VyY2VTdGFydCwgZSA9IHNvdXJjZVN0YXJ0ICsgc291cmNlTGVuZ3RoIC0gMTsgaSA8IGU7ICsraSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoKHNvdXJjZVtpXSA9PSBMQU1fQ0hBUiAmJiBpc0FsZWZDaGFyKHNvdXJjZVtpKzFdKSkgfHwgaXNUYXNoa2VlbENoYXJGRShzb3VyY2VbaV0pKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIC0tZGVzdFNpemU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeyAvLyB2aXN1YWwKKyAgICAgICAgICAgICAgICBmb3IoaW50IGkgPSBzb3VyY2VTdGFydCArIDEsIGUgPSBzb3VyY2VTdGFydCArIHNvdXJjZUxlbmd0aDsgaSA8IGU7ICsraSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoKHNvdXJjZVtpXSA9PSBMQU1fQ0hBUiAmJiBpc0FsZWZDaGFyKHNvdXJjZVtpLTFdKSkgfHwgaXNUYXNoa2VlbENoYXJGRShzb3VyY2VbaV0pKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAtLWRlc3RTaXplOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBMRVRURVJTX1VOU0hBUEU6CisgICAgICAgICAgICBmb3IoaW50IGkgPSBzb3VyY2VTdGFydCwgZSA9IHNvdXJjZVN0YXJ0ICsgc291cmNlTGVuZ3RoOyBpIDwgZTsgKytpKSB7CisgICAgICAgICAgICAgICAgaWYgKGlzTGFtQWxlZkNoYXIoc291cmNlW2ldKSkgeworICAgICAgICAgICAgICAgICAgICBkZXN0U2l6ZSsrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBkZXN0U2l6ZTsKKyAgICB9CisKKworICAgIC8qCisgICAgICogTmFtZSAgICA6IGNvdW50U3BhY2VTdWIKKyAgICAgKiBGdW5jdGlvbjogQ291bnRzIG51bWJlciBvZiB0aW1lcyB0aGUgc3ViQ2hhciBhcHBlYXJzIGluIHRoZSBhcnJheQorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgaW50IGNvdW50U3BhY2VTdWIoY2hhciBbXSBkZXN0LGludCBsZW5ndGgsIGNoYXIgc3ViQ2hhcil7CisgICAgICAgIGludCBpID0gMDsKKyAgICAgICAgaW50IGNvdW50ID0gMDsKKyAgICAgICAgd2hpbGUgKGkgPCBsZW5ndGgpIHsKKyAgICAgICAgICBpZiAoZGVzdFtpXSA9PSBzdWJDaGFyKSB7CisgICAgICAgICAgICAgIGNvdW50Kys7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICBpKys7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGNvdW50OworICAgIH0KKworICAgIC8qCisgICAgICogTmFtZSAgICA6IHNoaWZ0QXJyYXkKKyAgICAgKiBGdW5jdGlvbjogU2hpZnRzIGNoYXJhY3RlcnMgdG8gcmVwbGFjZSBzcGFjZSBzdWIgY2hhcmFjdGVycworICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBzaGlmdEFycmF5KGNoYXIgW10gZGVzdCxpbnQgc3RhcnQsIGludCBlLCBjaGFyIHN1YkNoYXIpeworICAgICAgICBpbnQgdyA9IGU7CisgICAgICAgIGludCByID0gZTsKKyAgICAgICAgd2hpbGUgKC0tciA+PSBzdGFydCkgeworICAgICAgICAgIGNoYXIgY2ggPSBkZXN0W3JdOworICAgICAgICAgIGlmIChjaCAhPSBzdWJDaGFyKSB7CisgICAgICAgICAgICAtLXc7CisgICAgICAgICAgICBpZiAodyAhPSByKSB7CisgICAgICAgICAgICAgIGRlc3Rbd10gPSBjaDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgIH0KKworICAgIC8qCisgICAgICogTmFtZSAgICA6IGZsaXBBcnJheQorICAgICAqIEZ1bmN0aW9uOiBpbnZlcnRzIGFycmF5LCBzbyB0aGF0IHN0YXJ0IGJlY29tZXMgZW5kIGFuZCB2aWNlIHZlcnNhCisgICAgICovCisgICAgICBwdWJsaWMgc3RhdGljIGludCBmbGlwQXJyYXkoY2hhciBbXSBkZXN0LCBpbnQgc3RhcnQsIGludCBlLCBpbnQgdyl7CisgICAgICAgIGludCByOworICAgICAgICBpZiAodyA+IHN0YXJ0KSB7CisgICAgICAgIC8vIHNoaWZ0LCBhc3N1bWUgc21hbGwgYnVmZmVyIHNpemUgc28gZG9uJ3QgdXNlIGFycmF5Y29weQorICAgICAgICAgIHIgPSB3OworICAgICAgICAgIHcgPSBzdGFydDsKKyAgICAgICAgICB3aGlsZSAociA8IGUpIHsKKyAgICAgICAgICAgIGRlc3RbdysrXSA9IGRlc3RbcisrXTsKKyAgICAgICAgICAgfQorICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICB3ID0gZTsKKyAgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHc7CisgICAgICB9CisKKyAgICAvKgorICAgICAqIE5hbWUgICAgIDogaGFuZGxlVGFzaGtlZWxXaXRoVGF0d2VlbAorICAgICAqIEZ1bmN0aW9uIDogUmVwbGFjZXMgVGFzaGtlZWwgYXMgZm9sbG93aW5nOgorICAgICAqICAgICAgICAgICAgQ2FzZSAxIDppZiB0aGUgVGFzaGtlZWwgb24gdGF0d2VlbCwgcmVwbGFjZSBpdCB3aXRoIFRhdHdlZWwuCisgICAgICogICAgICAgICAgICBDYXNlIDIgOmlmIHRoZSBUYXNoa2VlbCBhZ2dyZWdhdGVkIHdpdGggU2hhZGRhIG9uIFRhdHdlZWwsIHJlcGxhY2UKKyAgICAgKiAgICAgICAgICAgICAgICAgICBpdCB3aXRoIFNoYWRkYSBvbiBUYXR3ZWVsLgorICAgICAqICAgICAgICAgICAgQ2FzZSAzOiBpZiB0aGUgVGFzaGtlZWwgaXMgaXNvbGF0ZWQgcmVwbGFjZSBpdCB3aXRoIFNwYWNlLgorICAgICAqCisgICAgICovCisgICAgcHJpdmF0ZSBzdGF0aWMgaW50IGhhbmRsZVRhc2hrZWVsV2l0aFRhdHdlZWwoY2hhcltdIGRlc3QsIGludCBzb3VyY2VMZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgIGludCBpOworICAgICAgICAgICAgICAgICAgICAgZm9yKGkgPSAwOyBpIDwgc291cmNlTGVuZ3RoOyBpKyspeworICAgICAgICAgICAgICAgICAgICAgICAgIGlmKChpc1Rhc2hrZWVsT25UYXR3ZWVsQ2hhcihkZXN0W2ldKSA9PSAxKSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc3RbaV0gPSBUQVRXRUVMX0NIQVI7CisgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZigoaXNUYXNoa2VlbE9uVGF0d2VlbENoYXIoZGVzdFtpXSkgPT0gMikpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXN0W2ldID0gU0hBRERBX1RBVFdFRUxfQ0hBUjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKChpc0lzb2xhdGVkVGFzaGtlZWxDaGFyKGRlc3RbaV0pPT0xKSAmJiBkZXN0W2ldICE9IFNIQUREQV9DSEFSKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzdFtpXSA9IFNQQUNFX0NIQVI7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc291cmNlTGVuZ3RoOworICAgIH0KKworICAgIC8qCisgICAgICpOYW1lICAgICA6IGhhbmRsZUdlbmVyYXRlZFNwYWNlcworICAgICAqRnVuY3Rpb24gOiBUaGUgc2hhcGVVbmljb2RlIGZ1bmN0aW9uIGNvbnZlcnRzIExhbSArIEFsZWYgaW50byBMYW1BbGVmICsgc3BhY2UsCisgICAgICogICAgICAgICAgIGFuZC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QUxFRl9ORUFSKSB7CisgICAgICAgICAgZm9yIChpbnQgaSA9IHN0YXJ0LCBlID0gaSArIGxlbmd0aDsgaSA8IGU7ICsraSkgeworICAgICAgICAgICAgICBpZiAoZGVzdFtpXSA9PSBMQU1BTEVGX1NQQUNFX1NVQikgeworICAgICAgICAgICAgICAgICAgZGVzdFtpXSA9IFNQQUNFX0NIQVJfRk9SX0xBTUFMRUY7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisKKyAgICAgIH0gZWxzZSB7CisKKyAgICAgICAgICBmaW5hbCBpbnQgZSA9IHN0YXJ0ICsgbGVuZ3RoOworICAgICAgICAgIGludCB3TCA9IGNvdW50U3BhY2VTdWIoZGVzdCwgbGVuZ3RoLCBMQU1BTEVGX1NQQUNFX1NVQik7CisgICAgICAgICAgaW50IHdUID0gY291bnRTcGFjZVN1YihkZXN0LCBsZW5ndGgsIFRBU0hLRUVMX1NQQUNFX1NVQik7CisKKyAgICAgICAgICBpZiAobGVuT3B0aW9uc0xhbUFsZWYgPT0gTEFNQUxFRl9FTkQpeworICAgICAgICAgICAgbGFtQWxlZk9uID0gdHJ1ZTsKKyAgICAgICAgICB9CisgICAgICAgICAgaWYgKGxlbk9wdGlvbnNUYXNoa2VlbCA9PSBUQVNIS0VFTF9FTkQpeworICAgICAgICAgICAgdGFzaGtlZWxPbiA9IHRydWU7CisgICAgICAgICAgfQorCisKKyAgICAgICAgICBpZiAobGFtQWxlZk9uICYmIChsZW5PcHRpb25zTGFtQWxlZiA9PSBMQU1BTEVGX0VORCkpIHsKKyAgICAgICAgICAgIHNoaWZ0QXJyYXkoZGVzdCwgc3RhcnQsIGUsIExBTUFMRUZfU1BBQ0VfU1VCKTsKKyAgICAgICAgICAgIHdoaWxlICh3TCA+IHN0YXJ0KSB7CisgICAgICAgICAgICAgICAgZGVzdFstLXdMXSA9IFNQQUNFX0NIQVI7CisgICAgICAgICAgICB9CisgICAgICAgICAgfQorCisgICAgICAgICAgaWYgKHRhc2hrZ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gICAgICAgICAgIHdUID0gZmxpcEFycmF5KGRlc3Qsc3RhcnQsZSwgd1QpOworICAgICAgICAgICAgICBsZW5ndGggPSB3VCAtIHN0YXJ0OworICAgICAgICAgIH0KKworICAgICAgICAgIGxhbUFsZWZPbiA9IGZhbHNlOworICAgICAgICAgIHRhc2hrZWVsT24gPSBmYWxzZTsKKworICAgICAgICAgIGlmICgobGVuT3B0aW9uc0xhbUFsZWYgPT0gTEFNQUxFRl9CRUdJTikgfHwKKyAgICAgICAgICAgICAgKGxlbk9wdGlvbnNMYW1BbGVmID09IExBTUFMRUZfQVVUTykpeworICAgICAgICAgICAgICAgIGxhbUFsZWZPbiA9IHRydWU7CisgICAgICAgICAgfQorICAgICAgICAgIGlmIChsZW5PcHRpb25zVGFzaGtlZWwgPT0gVEFTSEtFRUxfQkVHSU4peworICAgICAgICAgICAgICAgIHRhc2hrZWVsT24gPSB0cnVlOworICAgICAgICAgIH0KKworICAgICAgICAgIGlmIChsYW1BbGVmT24gJiYgKChsZW5PcHRpb25zTGFtQWxlZiA9PSBMQU1BTEVGX0JFR0lOKXx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGxlbk9wdGlvbnNMYW1BbGVmID09IExBTUFMRUZfQVVUTykpKSB7IC8vIHNwYWNlcyBhdCBiZWdpbm5pbmcKKyAgICAgICAgICAgICAgc2hpZnRBcnJheShkZXN0LCBzdGFydCwgZSwgTEFNQUxFRl9TUEFDRV9TVUIpOworICAgICAgICAgICAgICAgd0wgPSBmbGlwQXJyYXkoZGVzdCxzdGFydCxlLCB3TCk7CisgICAgICAgICAgICAgICAgICB3aGlsZSAod0wgPCBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgZGVzdFt3TCsrXSA9IFNQQUNFX0NIQVI7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgaWYodGFzaGtlZWxPbiAmJiAobGVuT3B0aW9uc1Rhc2hrZWVsID09IFRBU0hLRUVMX0JFR0lOKSl7CisgICAgICAgICAgICAgICBzaGlmdEFycmF5KGRlc3QsIHN0YXJ0LCBlLCBUQVNIS0VFTF9TUEFDRV9TVUIpOworICAgICAgICAgICAgICAgd1QgPSBmbGlwQXJyYXkoZGVzdCxzdGFydCxlLCB3VCk7CisgICAgICAgICAgICAgICAgICB3aGlsZSAod1QgPCBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgZGVzdFt3VCsrXSA9IFNQQUNFX0NIQVI7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgfQorCisgICAgICByZXR1cm4gbGVuZ3RoOworICB9CisKKworICAvKgorICAgKk5hbWUgICAgIDpleHBhbmRDb21wb3NpdENoYXJBdEJlZ2luCisgICAqRnVuY3Rpb24gOkV4cGFuZHMgdGhlIExhbUFsZWYgY2hhcmFjdGVyIHRvIExhbSBhbmQgQWxlZiBjb25zdW1pbmcgdGhlIHJlcXVpcmVkCisgICAqICAgICAgICAgc3BhY2UgZnJvbSBiZWdpbm5pbmcgb2YgdGhlIGJ1ZmZlci4gSWYgdGhlIHRleHQgdHlwZSB3YXMgdmlzdWFsX0xUUgorICAgKiAgICAgICAgIGFuZCB0aGUgb3B0aW9uIFNQQUNFU19SRUxBVElWRV9UT19URVhUX0JFR0lOX0VORCB3YXMgc2VsZWN0ZWQKKyAgICogICAgICAgICB0aGUgc3BhY2VzIHdpbGwgYmUgbG9jYXRlZCBhdCBlbmQgb2YgYnVmZmVyLgorICAgKiAgICAgICAgIElmIHRoZXJlIGFyZSBubyBzcGFjZXMgdG8gZXhwYW5kIHRoZSBMYW1BbGVmLCBhbiBleGNlcHRpb24gaXMgdGhyb3duLgorKi8KKyBwcml2YXRlIGJvb2xlYW4gZXhwYW5kQ29tcG9zaXRDaGFyQXRCZWdpbihjaGFyW10gZGVzdCxpbnQgc3RhcnQsIGludCBsZW5ndGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGxhY291bnQpIHsKKyAgICAgYm9vbGVhbiBzcGFjZU5vdEZvdW5kID0gZmFsc2U7CisKKyAgICAgaWYgKGxhY291bnQgPiBjb3VudFNwYWNlc1JpZ2h0KGRlc3QsIHN0YXJ0LCBsZW5ndGgpKSB7CisgICAgICAgICBzcGFjZU5vdEZvdW5kID0gdHJ1ZTsKKyAgICAgICAgIHJldHVybiBzcGFjZU5vdEZvdW5kOworICAgICB9CisgICAgIGZvciAoaW50IHIgPSBzdGFydCArIGxlbmd0aCAtIGxhY291bnQsIHcgPSBzdGFydCArIGxlbmd0aDsgLS1yID49IHN0YXJ0OykgeworICAgICAgICAgY2hhciBjaCA9IGRlc3Rbcl07CisgICAgICAgICBpZiAoaXNOb3JtYWxpemVkTGFtQWxlZkNoYXIoY2gpKSB7CisgICAgICAgICAgICAgZGVzdFstLXddID0gTEFNX0NIQVI7CisgICAgICAgICAgICAgZGVzdFstLXddID0gY29udmVydE5vcm1hbGl6ZWRMYW1BbGVmW2NoIC0gJ1x1MDY1QyddOworICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICBkZXN0Wy0td10gPSBjaDsKKyAgICAgICAgIH0KKyAgICAgfQorICAgICByZXR1cm4gc3BhY2VOb3RGb3VuZDsKKworICB9CisKKyAgLyoKKyAgICpOYW1lICAgICA6IGV4cGFuZENvbXBvc2l0Q2hhckF0RW5kCisgICAqRnVuY3Rpb24gOiBFeHBhbmRzIHRoZSBMYW1BbGVmIGNoYXJhY3RlciB0byBMYW0gYW5kIEFsZWYgY29uc3VtaW5nIHRoZQorICAgKiAgICAgICAgICAgcmVxdWlyZWQgc3BhY2UgZnJvbSBlbmQgb2YgdGhlIGJ1ZmZlci4gSWYgdGhlIHRleHQgdHlwZSB3YXMKKyAgICogICAgICAgICAgIFZpc3VhbCBMVFIgYW5kIHRoZSBvcHRpb24gU1BBQ0VTX1JFTEFUSVZFX1RPX1RFWFRfQkVHSU5fRU5ECisgICAqICAgICAgICAgICB3YXMgdXNlZCwgdGhlIHNwYWNlcyB3aWxsIGJlIGNvbnN1bWVkIGZyb20gYmVnaW4gb2YgYnVmZmVyLiBJZgorICAgKiAgICAgICAgICAgdGhlcmUgYXJlIG5vIHNwYWNlcyB0byBleHBhbmQgdGhlIExhbUFsZWYsIGFuIGV4Y2VwdGlvbiBpcyB0aHJvd24uCisgICAqLworCisgIHByaXZhdGUgYm9vbGVhbiAgZXhwYW5kQ29tcG9zaXRDaGFyQXRFbmQoY2hhcltdIGRlc3QsaW50IHN0YXJ0LCBpbnQgbGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbGFjb3VudCl7CisgICAgICBib29sZWFuIHNwYWNlTm90Rm91bmQgPSBmYWxzZTsKKworICAgICAgaWYgKGxhY291bnQgPiBjb3VudFNwYWNlc0xlZnQoZGVzdCwgc3RhcnQsIGxlbmd0aCkpIHsKKyAgICAgICAgICBzcGFjZU5vdEZvdW5kID0gdHJ1ZTsKKyAgICAgICAgICByZXR1cm4gc3BhY2VOb3RGb3VuZDsKKyAgICAgIH0KKyAgICAgIGZvciAoaW50IHIgPSBzdGFydCArIGxhY291bnQsIHcgPSBzdGFydCwgZSA9IHN0YXJ0ICsgbGVuZ3RoOyByIDwgZTsgKytyKSB7CisgICAgICAgICAgY2hhciBjaCA9IGRlc3Rbcl07CisgICAgICAgICAgaWYgKGlzTm9ybWFsaXplZExhbUFsZWZDaGFyKGNoKSkgeworICAgICAgICAgICAgICBkZXN0W3crK10gPSBjb252ZXJ0Tm9ybWFsaXplZExhbUFsZWZbY2ggLSAnXHUwNjVDJ107CisgICAgICAgICAgICAgIGRlc3RbdysrXSA9IExBTV9DSEFSOworICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgIGRlc3RbdysrXSA9IGNoOworICAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIHJldHVybiBzcGFjZU5vdEZvdW5kOworICB9CisKKyAgLyoKKyAgICpOYW1lICAgICA6IGV4cGFuZENvbXBvc2l0Q2hhckF0TmVhcgorICAgKkZ1bmN0aW9uIDogRXhwYW5kcyB0aGUgTGFtQWxlZiBjaGFyYWN0ZXIgaW50byBMYW0gKyBBbGVmLCBZZWhIYW16YSBjaGFyYWN0ZXIKKyAgICogICAgICAgICAgIGludG8gWWVoICsgSGFtemEsIFNlZW5GYW1pbHkgY2hhcmFjdGVyIGludG8gU2VlbkZhbWlseSBjaGFyYWN0ZXIKKyAgICogICAgICAgICAgICsgVGFpbCwgd2hpbGUgY29uc3VtaW5nIHRoZSBzcGFjZSBuZXh0IHRvIHRoZSBjaGFyYWN0ZXIuCisgICAqLworCisgIHByaXZhdGUgYm9vbGVhbiBleHBhbmRDb21wb3NpdENoYXJBdE5lYXIoY2hhcltdIGRlc3QsaW50IHN0YXJ0LCBpbnQgbGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHllaEhhbXphT3B0aW9uLCBpbnQgc2VlblRhaWxPcHRpb24sIGludCBsYW1BbGVmT3B0aW9uKXsKKworICAgICAgYm9vbGVhbiBzcGFjZU5vdEZvdW5kID0gZmFsc2U7CisKKworCisgICAgICBpZiAoaXNOb3JtYWxpemVkTGFtQWxlZkNoYXIoZGVzdFtzdGFydF0pKSB7CisgICAgICAgICAgc3BhY2VOb3RGb3VuZCA9IHRydWU7CisgICAgICAgICAgcmV0dXJuIHNwYWNlTm90Rm91bmQ7CisgICAgICB9CisgICAgICBmb3IgKGludCBpID0gc3RhcnQgKyBsZW5ndGg7IC0taSA+PXN0YXJ0OykgeworICAgICAgICAgIGNoYXIgY2ggPSBkZXN0W2ldOworICAgICAgICAgIGlmIChsYW1BbGVmT3B0aW9uID09IDEgJiYgaXNOb3JtYWxpemVkTGFtQWxlZkNoYXIoY2gpKSB7CisgICAgICAgICAgICAgIGlmIChpPnN0YXJ0ICYmZGVzdFtpLTFdID09IFNQQUNFX0NIQVIpIHsKKyAgICAgICAgICAgICAgICAgIGRlc3RbaV0gPSBMQU1fQ0hBUjsKKyAgICAgICAgICAgICAgICAgIGRlc3RbLS1pXSA9IGNvbnZlcnROb3JtYWxpemVkTGFtQWxlZltjaCAtICdcdTA2NUMnXTsKKyAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgIHNwYWNlTm90Rm91bmQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgcmV0dXJuIHNwYWNlTm90Rm91bmQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICB9ZWxzZSBpZihzZWVuVGFpbE9wdGlvbiA9PSAxICYmIGlzU2VlblRhaWxGYW1pbHlDaGFyKGNoKSA9PSAxKXsKKyAgICAgICAgICAgICAgaWYoaT5zdGFydCAmJmRlc3RbaS0xXSA9PSBTUEFDRV9DSEFSKXsKKyAgICAgICAgICAgICAgICAgIGRlc3RbaS0xXSA9IHRhaWxDaGFyOworICAgICAgICAgICAgICB9IGVsc2V7CisgICAgICAgICAgICAgICAgICBzcGFjZU5vdEZvdW5kID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgIHJldHVybiBzcGFjZU5vdEZvdW5kOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfWVsc2UgaWYoeWVoSGFtemFPcHRpb24gPT0gMSAmJiBpc1llaEhhbXphQ2hhcihjaCkpeworCisgICAgICAgICAgICAgICBpZihpPnN0YXJ0ICYmZGVzdFtpLTFdID09IFNQQUNFX0NIQVIpeworICAgICAgICAgICAgICAgICAgZGVzdFtpXSA9IHllaEhhbXphVG9ZZWhbY2ggLSBZRUhfSEFNWkFGRV9DSEFSXTsKKyAgICAgICAgICAgICAgICAgIGRlc3RbaS0xXSA9IEhBTVpBRkVfQ0hBUjsKKyAgICAgICAgICAgICAgfWVsc2V7CisgICAgICAgICAgICAgICAgICBzcGFjZU5vdEZvdW5kID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgIHJldHVybiBzcGFjZU5vdEZvdW5kOworICAgICAgICAgICAgICAgIH0KKworCisgICAgICAgICAgfQorICAgICAgfQorICAgICAgcmV0dXJuIGZhbHNlOworCisgIH0KKworICAgIC8qCisgICAgICogTmFtZSAgICA6IGV4cGFuZENvbXBvc2l0Q2hhcgorICAgICAqIEZ1bmN0aW9uOiBMYW1BbGVmIG5lZWRzIHNwZWNpYWwgaGFuZGxpbmcgYXMgdGhlIExhbUFsZWYgaXMKKyAgICAgKiAgICAgICAgICAgb25lIGNoYXJhY3RlciB3aGlsZSBleHBhbmRpbmcgaXQgd2lsbCBnaXZlIHR3bworICAgICAqICAgICAgICAgICBjaGFyYWN0ZXJzIExhbSArIEFsZWYsIHNvIHdlIG5lZWQgdG8gZXhwYW5kIHRoZSBMYW1BbGVmCisgICAgICogICAgICAgICAgIGluIG5lYXIgb3IgZmFyIHNwYWNlcyBhY2NvcmRpbmcgdG8gdGhlIG9wdGlvbnMgdGhlIHVzZXIKKyAgICAgKiAgICAgICAgICAgc3BlY2lmaWVzIG9yIGluY3JlYXNlIHRoZSBidWZmZXIgc2l6ZS4KKyAgICAgKiAgICAgICAgICAgRGVzdCBoYXMgZW5vdWdoIHJvb20gZm9yIHRoZSBleHBhbnNpb24gaWYgd2UgYXJlIGdyb3dpbmcuCisgICAgICogICAgICAgICAgIGxhbWFsZWYgYXJlIG5vcm1hbGl6ZWQgdG8gdGhlICdzcGVjaWFsIGNoYXJhY3RlcnMnCisgICAgICovCisgICAgcHJpdmF0ZSBpbnQgZXhwYW5kQ29tcG9zaXRDaGFyKGNoYXJbXSBkZXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGxlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBsYWNvdW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNoYXBpbmdNb2RlKSB0aHJvd3MgQXJhYmljU2hhcGluZ0V4Y2VwdGlvbiB7CisKKyAgICAgICAgaW50IGxlbk9wdGlvbnNMYW1BbGVmID0gb3B0aW9ucyAmIExBTUFMRUZfTUFTSzsKKyAgICAgICAgaW50IGxlbk9wdGlvbnNTZWVuID0gb3B0aW9ucyAmIFNFRU5fTUFTSzsKKyAgICAgICAgaW50IGxlbk9wdGlvbnNZZWhIYW16YSA9IG9wdGlvbnMgJiBZRUhIQU1aQV9NQVNLOworICAgICAgICBib29sZWFuIHNwYWNlTm90Rm91bmQgPSBmYWxzZTsKKworICAgICAgICBpZiAoIWlzTG9naWNhbCAmJiAhc3BhY2VzUmVsYXRpdmVUb1RleHRCZWdpbkVuZCkgeworICAgICAgICAgICAgc3dpdGNoIChsZW5PcHRpb25zTGFtQWxlZikgeworICAgICAgICAgICAgY2FzZSBMQU1BTEVGX0JFR0lOOiBsZW5PcHRpb25zTGFtQWxlZiA9IExBTUFMRUZfRU5EOyBicmVhazsKKyAgICAgICAgICAgIGNhc2UgTEFNQUxFRl9FTkQ6IGxlbk9wdGlvbnNMYW1BbGVmID0gTEFNQUxFRl9CRUdJTjsgYnJlYWs7CisgICAgICAgICAgICBkZWZhdWx0OiBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmKHNoYXBpbmdNb2RlID09IDEpeworICAgICAgICAgICAgaWYobGVuT3B0aW9uc0xhbUFsZWYgPT0gTEFNQUxFRl9BVVRPKXsKKyAgICAgICAgICAgICAgICBpZihpc0xvZ2ljYWwpeworICAgICAgICAgICAgICAgICAgICBzcGFjZU5vdEZvdW5kID0gZXhwYW5kQ29tcG9zaXRDaGFyQXRFbmQoZGVzdCwgc3RhcnQsIGxlbmd0aCwgbGFjb3VudCk7CisgICAgICAgICAgICAgICAgICAgIGlmKHNwYWNlTm90Rm91bmQpeworICAgICAgICAgICAgICAgICAgICAgICAgc3BhY2VOb3RGb3VuZCA9IGV4cGFuZENvbXBvc2l0Q2hhckF0QmVnaW4oZGVzdCwgc3RhcnQsIGxlbmd0aCwgbGFjb3VudCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYoc3BhY2VOb3RGb3VuZCl7CisgICAgICAgICAgICAgICAgICAgICAgICBzcGFjZU5vdEZvdW5kID0gZXhwYW5kQ29tcG9zaXRDaGFyQXROZWFyKGRlc3QsIHN0YXJ0LCBsZW5ndGgsMCwwLDEpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmKHNwYWNlTm90Rm91bmQpeworICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEFyYWJpY1NoYXBpbmdFeGNlcHRpb24oIk5vIHNwYWNlZm9yIGxhbWFsZWYiKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgICAgICBzcGFjZU5vdEZvdW5kID0gZXhwYW5kQ29tcG9zaXRDaGFyQXRCZWdpbihkZXN0LCBzdGFydCwgbGVuZ3RoLCBsYWNvdW50KTsKKyAgICAgICAgICAgICAgICAgICAgaWYoc3BhY2VOb3RGb3VuZCl7CisgICAgICAgICAgICAgICAgICAgICAgICBzcGFjZU5vdEZvdW5kID0gZXhwYW5kQ29tcG9zaXRDaGFyQXRFbmQoZGVzdCwgc3RhcnQsIGxlbmd0aCwgbGFjb3VudCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYoc3BhY2VOb3RGb3VuZCl7CisgICAgICAgICAgICAgICAgICAgICAgICBzcGFjZU5vdEZvdW5kID0gZXhwYW5kQ29tcG9zaXRDaGFyQXROZWFyKGRlc3QsIHN0YXJ0LCBsZW5ndGgsMCwwLDEpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmKHNwYWNlTm90Rm91bmQpeworICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEFyYWJpY1NoYXBpbmdFeGNlcHRpb24oIk5vIHNwYWNlZm9yIGxhbWFsZWYiKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH1lbHNlIGlmKGxlbk9wdGlvbnNMYW1BbGVmID09IExBTUFMRUZfRU5EKXsKKyAgICAgICAgICAgICAgICBzcGFjZU5vdEZvdW5kID0gZXhwYW5kQ29tcG9zaXRDaGFyQXRFbmQoZGVzdCwgc3RhcnQsIGxlbmd0aCwgbGFjb3VudCk7CisgICAgICAgICAgICAgICAgaWYoc3BhY2VOb3RGb3VuZCl7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBcmFiaWNTaGFwaW5nRXhjZXB0aW9uKCJObyBzcGFjZWZvciBsYW1hbGVmIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfWVsc2UgaWYobGVuT3B0aW9uc0xhbUFsZWYgPT0gTEFNQUxFRl9CRUdJTil7CisgICAgICAgICAgICAgICAgc3BhY2VOb3RGb3VuZCA9IGV4cGFuZENvbXBvc2l0Q2hhckF0QmVnaW4oZGVzdCwgc3RhcnQsIGxlbmd0aCwgbGFjb3VudCk7CisgICAgICAgICAgICAgICAgaWYoc3BhY2VOb3RGb3VuZCl7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBcmFiaWNTaGFwaW5nRXhjZXB0aW9uKCJObyBzcGFjZWZvciBsYW1hbGVmIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfWVsc2UgaWYobGVuT3B0aW9uc0xhbUFsZWYgPT0gTEFNQUxFRl9ORUFSKXsKKyAgICAgICAgICAgICAgICBzcGFjZU5vdEZvdW5kID0gZXhwYW5kQ29tcG9zaXRDaGFyQXROZWFyKGRlc3QsIHN0YXJ0LCBsZW5ndGgsMCwwLDEpOworICAgICAgICAgICAgICAgIGlmKHNwYWNlTm90Rm91bmQpeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXJhYmljU2hhcGluZ0V4Y2VwdGlvbigiTm8gc3BhY2Vmb3IgbGFtYWxlZiIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgfWVsc2UgaWYobGVuT3B0aW9uc0xhbUFsZWYgPT0gTEFNQUxFRl9SRVNJWkUpeworICAgICAgICAgICAgICAgIGZvciAoaW50IHIgPSBzdGFydCArIGxlbmd0aCwgdyA9IHIgKyBsYWNvdW50OyAtLXIgPj0gc3RhcnQ7KSB7CisgICAgICAgICAgICAgICAgICAgIGNoYXIgY2ggPSBkZXN0W3JdOworICAgICAgICAgICAgICAgICAgICBpZiAoaXNOb3JtYWxpemVkTGFtQWxlZkNoYXIoY2gpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkZXN0Wy0td10gPSAnXHUwNjQ0JzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlc3RbLS13XSA9IGNvbnZlcnROb3JtYWxpemVkTGFtQWxlZltjaCAtICdcdTA2NUMnXTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlc3RbLS13XSA9IGNoOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGxlbmd0aCArPSBsYWNvdW50OworICAgICAgICAgICAgfQorICAgICAgICAgICAgfWVsc2V7CisgICAgICAgICAgICAgICAgaWYobGVuT3B0aW9uc1NlZW4gPT0gU0VFTl9UV09DRUxMX05FQVIpeworICAgICAgICAgICAgICAgIHNwYWNlTm90Rm91bmQgPSBleHBhbmRDb21wb3NpdENoYXJBdE5lYXIoZGVzdCwgc3RhcnQsIGxlbmd0aCwwLDEsMCk7CisgICAgICAgICAgICAgICAgaWYoc3BhY2VOb3RGb3VuZCl7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBcmFiaWNTaGFwaW5nRXhjZXB0aW9uKCJObyBzcGFjZSBmb3IgU2VlbiB0YWlsIGV4cGFuc2lvbiIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmKGxlbk9wdGlvbnNZZWhIYW16YSA9PSBZRUhIQU1aQV9UV09DRUxMX05FQVIpeworICAgICAgICAgICAgICAgIHNwYWNlTm90Rm91bmQgPSBleHBhbmRDb21wb3NpdENoYXJBdE5lYXIoZGVzdCwgc3RhcnQsIGxlbmd0aCwxLDAsMCk7CisgICAgICAgICAgICAgICAgaWYoc3BhY2VOb3RGb3VuZCl7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBcmFiaWNTaGFwaW5nRXhjZXB0aW9uKCJObyBzcGFjZSBmb3IgWWVoSGFtemEgZXhwYW5zaW9uIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICByZXR1cm4gbGVuZ3RoOworICAgIH0KKworCisgICAgLyogQ29udmVydCB0aGUgaW5wdXQgYnVmZmVyIGZyb20gRkV4eCBSYW5nZSBpbnRvIDA2eHggUmFuZ2UKKyAgICAgKiB0byBwdXQgYWxsIGNoYXJhY3RlcnMgaW50byB0aGUgMDZ4eCByYW5nZQorICAgICAqIGV2ZW4gdGhlIGxhbWFsZWYgaXMgY29udmVydGVkIHRvIHRoZSBzcGVjaWFsIHJlZ2lvbiBpbgorICAgICAqIHRoZSAwNnh4IHJhbmdlLiAgUmV0dXJuIHRoZSBudW1iZXIgb2YgbGFtYWxlZiBjaGFycyBmb3VuZC4KKyAgICAgKi8KKyAgICBwcml2YXRlIGludCBub3JtYWxpemUoY2hhcltdIGRlc3QsIGludCBzdGFydCwgaW50IGxlbmd0aCkgeworICAgICAgICBpbnQgbGFjb3VudCA9IDA7CisgICAgICAgIGZvciAoaW50IGkgPSBzdGFydCwgZSA9IGkgKyBsZW5ndGg7IGkgPCBlOyArK2kpIHsKKyAgICAgICAgICAgIGNoYXIgY2ggPSBkZXN0W2ldOworICAgICAgICAgICAgaWYgKGNoID49ICdcdUZFNzAnICYmIGNoIDw9ICdcdUZFRkMnKSB7CisgICAgICAgICAgICAgICAgaWYgKGlzTGFtQWxlZkNoYXIoY2gpKSB7CisgICAgICAgICAgICAgICAgICAgICsrbGFjb3VudDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZGVzdFtpXSA9IChjaGFyKWNvbnZlcnRGRXRvMDZbY2ggLSAnXHVGRTcwJ107CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGxhY291bnQ7CisgICAgfQorCisgICAgLyoKKyAgICAgKiBOYW1lICAgIDogZGVzaGFwZU5vcm1hbGl6ZQorICAgICAqIEZ1bmN0aW9uOiBDb252ZXJ0IHRoZSBpbnB1dCBidWZmZXIgZnJvbSBGRXh4IFJhbmdlIGludG8gMDZ4eCBSYW5nZQorICAgICAqICAgICAgICAgICBldmVuIHRoZSBsYW1hbGVmIGlzIGNvbnZlcnRlZCB0byB0aGUgc3BlY2lhbCByZWdpb24gaW4gdGhlIDA2eHggcmFuZ2UuCisgICAgICogICAgICAgICAgIEFjY29yZGluZyB0byB0aGUgb3B0aW9ucyB0aGUgdXNlciBlbnRlcnMsIGFsbCBzZWVuIGZhbWlseSBjaGFyYWN0ZXJzCisgICAgICogICAgICAgICAgIGZvbGxvd2VkIGJ5IGEgdGFpbCBjaGFyYWN0ZXIgYXJlIG1lcmdlZCB0byBzZWVuIHRhaWwgZmFtaWx5IGNoYXJhY3RlciBhbmQKKyAgICAgKiAgICAgICAgICAgYW55IHllaCBmb2xsb3dlZCBieSBhIGhhbXphIGNoYXJhY3RlciBhcmUgbWVyZ2VkIHRvIHllaGhhbXphIGNoYXJhY3Rlci4KKyAgICAgKiAgICAgICAgICAgTWV0aG9kIHJldHVybnMgdGhlIG51bWJlciBvZiBsYW1hbGVmIGNoYXJzIGZvdW5kLgorICAgICAqLworICAgIHByaXZhdGUgaW50IGRlc2hhcGVOb3JtYWxpemUoY2hhcltdIGRlc3QsIGludCBzdGFydCwgaW50IGxlbmd0aCkgeworICAgICAgICBpbnQgbGFjb3VudCA9IDA7CisgICAgICAgIGludCB5ZWhIYW16YUNvbXBvc2VFbmFibGVkID0gMDsKKyA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lZkNoYXIoY2gpKSB7CisgICAgICAgICAgICAgICAgICAgICsrbGFjb3VudDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZGVzdFtpXSA9IChjaGFyKWNvbnZlcnRGRXRvMDZbY2ggLSAnXHVGRTcwJ107CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGxhY291bnQ7CisgICAgfQorCisgICAgLyoKKyAgICAgKiBOYW1lICAgIDogc2hhcGVVbmljb2RlCisgICAgICogRnVuY3Rpb246IENvbnZlcnRzIGFuIEFyYWJpYyBVbmljb2RlIGJ1ZmZlciBpbiAwNnh4IFJhbmdlIGludG8gYSBzaGFwZWQKKyAgICAgKiAgICAgICAgICAgYXJhYmljIFVuaWNvZGUgYnVmZmVyIGluIEZFeHggUmFuZ2UKKyAgICAgKi8KKyAgICBwcml2YXRlIGludCBzaGFwZVVuaWNvZGUoY2hhcltdIGRlc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGxlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGRlc3RTaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdGFzaGtlZWxGbGFnKXRocm93cyBBcmFiaWNTaGFwaW5nRXhjZXB0aW9uIHsKKworICAgICAgICBpbnQgbGFtYWxlZl9jb3VudCA9IG5vcm1hbGl6ZShkZXN0LCBzdGFydCwgbGVuZ3RoKTsKKworICAgICAgICAvLyByZXNvbHZlIHRoZSBsaW5rIGJldHdlZW4gdGhlIGNoYXJhY3RlcnMuCisgICAgICAgIC8vIEFyYWJpYyBjaGFyYWN0ZXJzIGhhdmUgZm91ciBmb3JtczogSXNvbGF0ZWQsIEluaXRpYWwsIE1lZGlhbCBhbmQgRmluYWwuCisgICAgICAgIC8vIFRhc2hrZWVsIGNoYXJhY3RlcnMgaGF2ZSB0d28sIGlzb2xhdGVkIG9yIG1lZGlhbCwgYW5kIHNvbWV0aW1lcyBvbmx5IGlzb2xhdGVkLgorICAgICAgICAvLyB0YXNoa2VlbEZsYWcgPT0gMDogc2hhcGUgbm9ybWFsbHksIDE6IHNoYXBlIGlzb2xhdGVkLCAyOiBkb24ndCBzaGFwZQorCisgICAgICAgIGJvb2xlYW4gbGFtYWxlZl9mb3VuZCA9IGZhbHNlLCBzZWVuZmFtX2ZvdW5kID0gZmFsc2U7CisgICAgICAgIGJvb2xlYW4geWVoaGFtemFfZm91bmQgPSBmYWxzZSwgdGFzaGtlZWxfZm91bmQgPSBmYWxzZTsKKyAgICAgICAgaW50IGkgPSBzdGFydCArIGxlbmd0aCAtIDE7CisgICAgICAgIGludCBjdXJyTGluayA9IGdldExpbmsoZGVzdFtpXSk7CisgICAgICAgIGludCBuZXh0TGluayA9IDA7CisgICAgICAgIGludCBwcmV2TGluayA9IDA7CisgICAgICAgIGludCBsYXN0TGluayA9IDA7CisgICAgICAgIC8vaW50IHByZXZQb3MgPSBpOworICAgICAgICBpbnQgbGFzdFBvcyA9IGk7CisgICAgICAgIGludCBueCA9IC0yOworICAgICAgICBpbnQgbncgPSAwOworCisgICAgICAgIHdoaWxlIChpID49IDApIHsKKyAgICAgICAgICAgIC8vIElmIGhpZ2ggYnl0ZSBvZiBjdXJyTGluayA+IDAgdGhlbiB0aGVyZSBtaWdodCBiZSBtb3JlIHRoYW4gb25lIHNoYXBlCisgICAgICAgICAgICBpZiAoKGN1cnJMaW5rICYgJ1x1RkYwMCcpID4gMCB8fCBpc1Rhc2hrZWVsQ2hhcihkZXN0W2ldKSkgeworICAgICAgICAgICAgICAgIG53ID0gaSAtIDE7CisgICAgICAgICAgICAgICAgbnggPSAtMjsKKyAgICAgICAgICAgICAgICB3aGlsZSAobnggPCAwKSB7IC8vIHdlIG5lZWQgdG8ga25vdyBhYm91dCBuZXh0IGNoYXIKKyAgICAgICAgICAgICAgICAgICAgaWYgKG53ID09IC0xKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBuZXh0TGluayA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICBueCA9IEludGVnZXIuTUFYX1ZBTFVFOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgbmV4dExpbmsgPSBnZXRMaW5rKGRlc3RbbnddKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobmV4dExpbmsgJiBJUlJFTEVWQU5UKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnggPSBudzsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLS1udzsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmICgoKGN1cnJMaW5rICYgQUxFRlRZUEUpID4gMCkgJiYgKChsYXN0TGluayAmIExBTVRZUEUpID4gMCkpIHsKKyAgICAgICAgICAgICAgICAgICAgbGFtYWxlZl9mb3VuZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIGNoYXIgd0xhbWFsZWYgPSBjaGFuZ2VMYW1BbGVmKGRlc3RbaV0pOyAvLyBnZXQgZnJvbSAweDA2NUMtMHgwNjVmCisgICAgICAgICAgICAgICAgICAgIGlmICh3TGFtYWxlZiAhPSAnXHUwMDAwJykgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmVwbGFjZSBhbGVmIGJ5IG1hcmtlciwgaXQgd2lsbCBiZSByZW1vdmVkIGxhdGVyCisgICAgICAgICAgICAgICAgICAgICAgICBkZXN0W2ldID0gJ1x1ZmZmZic7CisgICAgICAgICAgICAgICAgICAgICAgICBkZXN0W2xhc3RQb3NdID0gd0xhbWFsZWY7CisgICAgICAgICAgICAgICAgICAgICAgICBpID0gbGFzdFBvczsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGxhc3RMaW5rID0gcHJldkxpbms7CisgICAgICAgICAgICAgICAgICAgIGN1cnJMaW5rID0gZ2V0TGluayh3TGFtYWxlZik7IC8vIHJlcXVpcmVzICdcdTAwMDAnLCB1bmZvcnR1bmF0ZWx5CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICgoaSA+IDApICYmIChkZXN0W2ktMV0gPT0gU1BBQ0VfQ0hBUikpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAoIGlzU2VlbkZhbWlseUNoYXIoZGVzdFtpXSkgPT0gMSl7CisgICAgICAgICAgICAgICAgICAgICAgICBzZWVuZmFtX2ZvdW5kID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChkZXN0W2ldID09IFlFSF9IQU1aQV9DSEFSKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB5ZWhoYW16YV9mb3VuZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZihpPT0wKXsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCBpc1NlZW5GYW1pbHlDaGFyKGRlc3RbaV0pID09IDEpeworICAgICAgICAgICAgICAgICAgICAgICAgc2VlbmZhbV9mb3VuZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZGVzdFtpXSA9PSBZRUhfSEFNWkFfQ0hBUikgeworICAgICAgICAgICAgICAgICAgICAgICAgeWVoaGFtemFfZm91bmQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisKKyAgICAgICAgICAgICAgICAvLyBnZXQgdGhlIHByb3BlciBzaGFwZSBhY2NvcmRpbmcgdG8gbGluayBhYmlsaXR5IG9mIG5laWdoYm9ycworICAgICAgICAgICAgICAgIC8vIGFuZCBvZiBjaGFyYWN0ZXI7IGRlcGVuZHMgb24gdGhlIG9yZGVyIG9mIHRoZSBzaGFwZXMKKyAgICAgICAgICAgICAgICAvLyAoaXNvbGF0ZWQsIGluaXRpYWwsIG1pZGRsZSwgZmluYWwpIGluIHRoZSBjb21wYXRpYmlsaXR5IGFyZWEKKworICAgICAgICAgICAgICAgIGludCBmbGFnID0gc3BlY2lhbENoYXIoZGVzdFtpXSk7CisKKyAgICAgICAgICAgICAgICBpbnQgc2hhcGUgPSBzaGFwZVRhYmxlW25leHRMaW5rICYgTElOS19NQVNLXQorICAgICAgICAgICAgICAgICAgICBbbGFzdExpbmsgJiBMSU5LX01BU0tdCisgICAgICAgICAgICAgICAgICAgIFtjdXJyTGluayAmIExJTktfTUFTS107CisKKyAgICAgICAgICAgICAgICBpZiAoZmxhZyA9PSAxKSB7CisgICAgICAgICAgICAgICAgICAgIHNoYXBlICY9IDB4MTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGZsYWcgPT0gMikgeworICAgICAgICAgICAgICAgICAgICBpZiAodGFzaGtlZWxGbGFnID09IDAgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICgobGFzdExpbmsgJiBMSU5LTCkgIT0gMCkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICgobmV4dExpbmsgJiBMSU5LUikgIT0gMCkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlc3RbaV0gIT0gJ1x1MDY0QycgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlc3RbaV0gIT0gJ1x1MDY0RCcgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICEoKG5leHRMaW5rICYgQUxFRlRZUEUpID09IEFMRUZUWVBFICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgIChsYXN0TGluayAmIExBTVRZUEUpID09IExBTVRZUEUpKSB7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHNoYXBlID0gMTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNoYXBlID0gMDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoZmxhZyA9PSAyKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICh0YXNoa2VlbEZsYWcgPT0gMikgeworICAgICAgICAgICAgICAgICAgICAgICAgZGVzdFtpXSA9IFRBU0hLRUVMX1NQQUNFX1NVQjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRhc2hrZWVsX2ZvdW5kID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgZGVzdFtpXSA9IChjaGFyKSgnXHVGRTcwJyArIGlycmVsZXZhbnRQb3NbZGVzdFtpXSAtICdcdTA2NEInXSArIHNoYXBlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvLyBlbHNlIGxlYXZlIHRhc2hrZWVsIGFsb25lCisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgZGVzdFtpXSA9IChjaGFyKSgnXHVGRTcwJyArIChjdXJyTGluayA+PiA4KSArIHNoYXBlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIG1vdmUgb25lIG5vdGNoIGZvcndhcmQKKyAgICAgICAgICAgIGlmICgoY3VyckxpbmsgJiBJUlJFTEVWQU5UKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgcHJldkxpbmsgPSBsYXN0TGluazsKKyAgICAgICAgICAgICAgICBsYXN0TGluayA9IGN1cnJMaW5rOworICAgICAgICAgICAgICAgIC8vcHJldlBvcyA9IGxhc3RQb3M7CisgICAgICAgICAgICAgICAgbGFzdFBvcyA9IGk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC0taTsKKyAgICAgICAgICAgIGlmIChpID09IG54KSB7CisgICAgICAg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FwZVVuaWNvZGUoY2hhcltdIGRlc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBsZW5ndGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGRlc3RTaXplKSB0aHJvd3MgQXJhYmljU2hhcGluZ0V4Y2VwdGlvbiB7CisKKyAgICAgICAgaW50IGxhbWFsZWZfY291bnQgPSBkZXNoYXBlTm9ybWFsaXplKGRlc3QsIHN0YXJ0LCBsZW5ndGgpOworCisgICAgICAgIC8vIElmIHRoZXJlIHdhcyBhIGxhbWFsZWYgaW4gdGhlIGJ1ZmZlciBjYWxsIGV4cGFuZExhbUFsZWYKKyAgICAgICAgaWYgKGxhbWFsZWZfY291bnQgIT0gMCkgeworICAgICAgICAgICAgLy8gbmVlZCB0byBhZGp1c3QgZGVzdCB0byBmaXQgZXhwYW5kZWQgYnVmZmVyLi4uICEhIQorICAgICAgICAgICAgZGVzdFNpemUgPSBleHBhbmRDb21wb3NpdENoYXIoZGVzdCwgc3RhcnQsIGxlbmd0aCwgbGFtYWxlZl9jb3VudCxERVNIQVBFX01PREUpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZGVzdFNpemUgPSBsZW5ndGg7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gZGVzdFNpemU7CisgICAgfQorCisgICAgcHJpdmF0ZSBpbnQgaW50ZXJuYWxTaGFwZShjaGFyW10gc291cmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNvdXJjZVN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNvdXJjZUxlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJbXSBkZXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGRlc3RTdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBkZXN0U2l6ZSkgdGhyb3dzIEFyYWJpY1NoYXBpbmdFeGNlcHRpb24geworCisgICAgICAgIGlmIChzb3VyY2VMZW5ndGggPT0gMCkgeworICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIH0KKworICAgICAgICBpZiAoZGVzdFNpemUgPT0gMCkgeworICAgICAgICAgICAgaWYgKCgob3B0aW9ucyAmIExFVFRFUlNfTUFTSykgIT0gTEVUVEVSU19OT09QKSAmJgorICAgICAgICAgICAgICAgICgob3B0aW9ucyAmIExBTUFMRUZfTUFTSykgPT0gTEFNQUxFRl9SRVNJWkUpKSB7CisKKyAgICAgICAgICAgICAgICByZXR1cm4gY2FsY3VsYXRlU2l6ZShzb3VyY2UsIHNvdXJjZVN0YXJ0LCBzb3VyY2VMZW5ndGgpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gc291cmNlTGVuZ3RoOyAvLyBieSBkZWZpbml0aW9uCisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBhbHdheXMgdXNlIHRlbXAgYnVmZmVyCisgICAgICAgIGNoYXJbXSB0ZW1wID0gbmV3IGNoYXJbc291cmNlTGVuZ3RoICogMl07IC8vIGFsbCBsYW1hbGVmcyByZXF1aXJpbmcgZXhwYW5zaW9uCisgICAgICAgIFN5c3RlbS5hcnJheWNvcHkoc291cmNlLCBzb3VyY2VTdGFydCwgdGVtcCwgMCwgc291cmNlTGVuZ3RoKTsKKworICAgICAgICBpZiAoaXNMb2dpY2FsKSB7CisgICAgICAgICAgICBpbnZlcnRCdWZmZXIodGVtcCwgMCwgc291cmNlTGVuZ3RoKTsKKyAgICAgICAgfQorCisgICAgICAgIGludCBvdXRwdXRTaXplID0gc291cmNlTGVuZ3RoOworCisgICAgICAgIHN3aXRjaCAob3B0aW9ucyAmIExFVFRFUlNfTUFTSykgeworICAgICAgICBjYXNlIExFVFRFUlNfU0hBUEVfVEFTSEtFRUxfSVNPTEFURUQ6CisgICAgICAgICAgICBvdXRwdXRTaXplID0gc2hhcGVVbmljb2RlKHRlbXAsIDAsIHNvdXJjZUxlbmd0aCwgZGVzdFNpemUsIDEpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBMRVRURVJTX1NIQVBFOgorICAgICAgICAgICAgaWYoICgob3B0aW9ucyZUQVNIS0VFTF9NQVNLKT4gMCkgJiYKKyAgICAgICAgICAgICAgICAoKG9wdGlvbnMmVEFTSEtFRUxfTUFTSykgIT1UQVNIS0VFTF9SRVBMQUNFX0JZX1RBVFdFRUwpKSB7CisgICAgICAgICAgICAgICAgICAgLyogQ2FsbCB0aGUgc2hhcGluZyBmdW5jdGlvbiB3aXRoIHRhc2hrZWVsIGZsYWcgPT0gMiBmb3IgcmVtb3ZhbCBvZiB0YXNoa2VlbCAqLworICAgICAgICAgICAgICAgIG91dHB1dFNpemUgPSBzaGFwZVVuaWNvZGUodGVtcCwgMCwgc291cmNlTGVuZ3RoLCBkZXN0U2l6ZSwgMik7CisgICAgICAgICAgICAgICAgfWVsc2UgeworICAgICAgICAgICAgICAgICAgIC8vZGVmYXVsdCBDYWxsIHRoZSBzaGFwaW5nIGZ1bmN0aW9uIHdpdGggdGFzaGtlZWwgZmxhZyA9PSAxICovCisgICAgICAgICAgICAgICAgICAgIG91dHB1dFNpemUgPSBzaGFwZVVuaWNvZGUodGVtcCwgMCwgc291cmNlTGVuZ3RoLCBkZXN0U2l6ZSwgMCk7CisKKyAgICAgICAgICAgICAgICAgICAvKkFmdGVyIHNoYXBpbmcgdGV4dCBjaGVjayBpZiB1c2VyIHdhbnRzIHRvIHJlbW92ZSB0YXNoa2VlbCBhbmQgcmVwbGFjZSBpdCB3aXRoIHRhdHdlZWwqLworICAgICAgICAgICAgICAgICAgIGlmKCAob3B0aW9ucyZUQVNIS0VFTF9NQVNLKSA9PSBUQVNIS0VFTF9SRVBMQUNFX0JZX1RBVFdFRUwpeworICAgICAgICAgICAgICAgICAgICAgICBvdXRwdXRTaXplID0gaGFuZGxlVGFzaGtlZWxXaXRoVGF0d2VlbCh0ZW1wLHNvdXJjZUxlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBMRVRURVJTX1VOU0hBUEU6CisgICAgICAgICAgICBvdXRwdXRTaXplID0gZGVTaGFwZVVuaWNvZGUodGVtcCwgMCwgc291cmNlTGVuZ3RoLCBkZXN0U2l6ZSk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBpZiAob3V0cHV0U2l6ZSA+IGRlc3RTaXplKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgQXJhYmljU2hhcGluZ0V4Y2VwdGlvbigibm90IGVub3VnaCByb29tIGZvciByZXN1bHQgZGF0YSIpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKChvcHRpb25zICYgRElHSVRTX01BU0spICE9IERJR0lUU19OT09QKSB7CisgICAgICAgICAgICBjaGFyIGRpZ2l0QmFzZSA9ICdcdTAwMzAnOyAvLyBFdXJvcGVhbiBkaWdpdHMKKyAgICAgICAgICAgIHN3aXRjaCAob3B0aW9ucyAmIERJR0lUX1RZUEVfTUFTSykgeworICAgICAgICAgICAgY2FzZSBESUdJVF9UWVBFX0FOOgorICAgICAgICAgICAgICAgIGRpZ2l0QmFzZSA9ICdcdTA2NjAnOyAgLy8gQXJhYmljLUluZGljIGRpZ2l0cworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIERJR0lUX1RZUEVfQU5fRVhURU5ERUQ6CisgICAgICAgICAgICAgICAgZGlnaXRCYXNlID0gJ1x1MDZmMCc7ICAvLyBFYXN0ZXJuIEFyYWJpYy1JbmRpYyBkaWdpdHMgKFBlcnNpYW4gYW5kIFVyZHUpCisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHN3aXRjaCAob3B0aW9ucyAmIERJR0lUU19NQVNLKSB7CisgICAgICAgICAgICBjYXNlIERJR0lUU19FTjJBTjoKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGludCBkaWdpdERlbHRhID0gZGlnaXRCYXNlIC0gJ1x1MDAzMCc7CisgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgb3V0cHV0U2l6ZTsgKytpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjaGFyIGNoID0gdGVtcFtpXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaCA8PSAnXHUwMDM5JyAmJiBjaCA+PSAnXHUwMDMwJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBbaV0gKz0gZGlnaXREZWx0YTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBESUdJVFNfQU4yRU46CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBjaGFyIGRpZ2l0VG9wID0gKGNoYXIpKGRpZ2l0QmFzZSArIDkpOworICAgICAgICAgICAgICAgICAgICBpbnQgZGlnaXREZWx0YSA9ICdcdTAwMzAnIC0gZGlnaXRCYXNlOworICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG91dHB1dFNpemU7ICsraSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY2hhciBjaCA9IHRlbXBbaV07CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPD0gZGlnaXRUb3AgJiYgY2ggPj0gZGlnaXRCYXNlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcFtpXSArPSBkaWdpdERlbHRhOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIERJR0lUU19FTjJBTl9JTklUX0xSOgorICAgICAgICAgICAgICAgIHNoYXBlVG9BcmFiaWNEaWdpdHNXaXRoQ29udGV4dCh0ZW1wLCAwLCBvdXRwdXRTaXplLCBkaWdpdEJhc2UsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBESUdJVFNfRU4yQU5fSU5JVF9BTDoKKyAgICAgICAgICAgICAgICBzaGFwZVRvQXJhYmljRGlnaXRzV2l0aENvbnRleHQodGVtcCwgMCwgb3V0cHV0U2l6ZSwgZGlnaXRCYXNlLCB0cnVlKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmIChpc0xvZ2ljYWwpIHsKKyAgICAgICAgICAgIGludmVydEJ1ZmZlcih0ZW1wLCAwLCBvdXRwdXRTaXplKTsKKyAgICAgICAgfQorCisgICAgICAgIFN5c3RlbS5hcnJheWNvcHkodGVtcCwgMCwgZGVzdCwgZGVzdFN0YXJ0LCBvdXRwdXRTaXplKTsKKworICAgICAgICByZXR1cm4gb3V0cHV0U2l6ZTsKKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyBjbGFzcyBBcmFiaWNTaGFwaW5nRXhjZXB0aW9uIGV4dGVuZHMgUnVudGltZUV4Y2VwdGlvbiB7CisgICAgICAgIEFyYWJpY1NoYXBpbmdFeGNlcHRpb24oU3RyaW5nIG1zZykgeworICAgICAgICAgICAgc3VwZXIobXNnKTsKKyAgICAgICAgfQorICAgIH0KK30KZGlmZiAtLWdpdCBhL2ljd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10gPSAwLjBmOworICAgIGRhdGFbMTRdID0gMC4wZjsKKyAgICBkYXRhWzE1XSA9IDEuMGY7CisKKyAgICBhbmdsZSAqPSBmbG9hdChNX1BJIC8gMTgwLjBmKTsKKyAgICBmbG9hdCBjID0gY29zZihhbmdsZSk7CisgICAgZmxvYXQgcyA9IHNpbmYoYW5nbGUpOworCisgICAgY29uc3QgZmxvYXQgbGVuZ3RoID0gc3FydGYoeCAqIHggKyB5ICogeSArIHogKiB6KTsKKyAgICBjb25zdCBmbG9hdCBuYyA9IDEuMGYgLSBjOworICAgIGNvbnN0IGZsb2F0IHh5ID0geCAqIHk7CisgICAgY29uc3QgZmxvYXQgeXogPSB5ICogejsKKyAgICBjb25zdCBmbG9hdCB6eCA9IHogKiB4OworICAgIGNvbnN0IGZsb2F0IHhzID0geCAqIHM7CisgICAgY29uc3QgZmxvYXQgeXMgPSB5ICogczsKKyAgICBjb25zdCBmbG9hdCB6cyA9IHogKiBzOworCisgICAgZGF0YVswXSAgPSB4ICogeCAqIG5jICsgIGM7CisgICAgZGF0YVs0XSAgPSAgICB4eSAqIG5jIC0genM7CisgICAgZGF0YVs4XSAgPSAgICB6eCAqIG5jICsgeXM7CisgICAgZGF0YVsxXSAgPSAgICB4eSAqIG5jICsgenM7CisgICAgZGF0YVs1XSAgPSB5ICogeSAqIG5jICsgIGM7CisgICAgZGF0YVs5XSAgPSAgICB5eiAqIG5jIC0geHM7CisgICAgZGF0YVsyXSAgPSAgICB6eCAqIG5jIC0geXM7CisgICAgZGF0YVs2XSAgPSAgICB5eiAqIG5jICsgeHM7CisgICAgZGF0YVsxMF0gPSB6ICogeiAqIG5jICsgIGM7Cit9CisKK3ZvaWQgTWF0cml4NDo6bG9hZE11bHRpcGx5KGNvbnN0IE1hdHJpeDQmIHUsIGNvbnN0IE1hdHJpeDQmIHYpIHsKKyAgICBmb3IgKGludCBpID0gMCA7IGkgPCA0IDsgaSsrKSB7CisgICAgICAgIGZsb2F0IHggPSAwOworICAgICAgIC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vamVjdGlvbk1hdHJpeCwgY29uc3QgR0xmbG9hdCogbW9kZWxWaWV3TWF0cml4LAorICAgICAgICAgICAgIGNvbnN0IEdMZmxvYXQqIHRyYW5zZm9ybU1hdHJpeCk7CisKKyAgICBpbnQgcG9zaXRpb247CisgICAgaW50IGNvbG9yOworCisgICAgaW50IHByb2plY3Rpb247CisgICAgaW50IG1vZGVsVmlldzsKKyAgICBpbnQgdHJhbnNmb3JtOworCitwcm90ZWN0ZWQ6CisgICAgdm9pZCBnZXRBdHRyaWJzQW5kVW5pZm9ybXMoKTsKK307CisKK2NsYXNzIERyYXdUZXh0dXJlUHJvZ3JhbTogcHVibGljIERyYXdDb2xvclByb2dyYW0geworcHVibGljOgorICAgIERyYXdUZXh0dXJlUHJvZ3JhbSgpOworCisgICAgaW50IHNhbXBsZXI7CisgICAgaW50IHRleENvb3JkczsKK307CisKKy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KKy8vIFJlbmRlcmVyCisvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisKK2NsYXNzIE9wZW5HTFJlbmRlcmVyIHsKK3B1YmxpYzoKKyAgICBPcGVuR0xSZW5kZXJlcigpOworICAgIH5PcGVuR0xSZW5kZXJlcigpOworCisgICAgdm9pZCBzZXRWaWV3cG9ydChpbnQgd2lkdGgsIGludCBoZWlnaHQpOworICAgIHZvaWQgcHJlcGFyZSgpOworCisgICAgaW50IGdldFNhdmVDb3VudCgpIGNvbnN0OworICAgIGludCBzYXZlKGludCBmbGFncyk7CisgICAgdm9pZCByZXN0b3JlKCk7CisgICAgdm9pZCByZXN0b3JlVG9Db3VudChpbnQgc2F2ZUNvdW50KTsKKworICAgIGludCBzYXZlTGF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gorICovCisKKyNpZm5kZWYgQU5EUk9JRF9VSV9SRUNUX0gKKyNkZWZpbmUgQU5EUk9JRF9VSV9SRUNUX0gKKworbmFtZXNwYWNlIGFuZHJvaWQgeworbmFtZXNwYWNlIHVpcmVuZGVyZXIgeworCisvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisvLyBTdHJ1Y3RzCisvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisKK3N0cnVjdCBSZWN0IHsKKyAgICBmbG9hdCBsZWZ0OworICAgIGZsb2F0IHRvcDsKKyAgICBmbG9hdCByaWdodDsKKyAgICBmbG9hdCBib3R0b207CisKKyAgICBSZWN0KCk6CisgICAgICAgICAgICBsZWZ0KDApLAorICAgICAgICAgICAgdG9wKDApLAorICAgICAgICAgICAgcmlnaHQoMCksCisgICAgICAgICAgICBib3R0b20oMCkgeworICAgIH0KKworICAgIFJlY3QoZmxvYXQgbGVmdCwgZmxvYXQgdG9wLCBmbG9hdCByaWdodCwgZmxvYXQgYm90dG9tKToKKyAgICAgICAgICAgIGxlZnQobGVmdCksCisgICAgICAgICAgICB0b3AodG9wKSwKKyAgICAgICAgICAgIHJpZ2h0KHJpZ2h0KSwKKyAgICAgICAgICAgIGJvdHRvbShib3R0b20pIHsKKyAgICB9CisKKyAgICBSZWN0KGNvbnN0IFJlY3QmIHIpIHsKKyAgICAgICAgc2V0KHIpOworICAgIH0KKworICAgIFJlY3QoUmVjdCYgcikgeworICAgICAgICBzZXQocik7CisgICAgfQorCisgICAgUmVjdCYgb3BlcmF0b3I9KGNvbnN0IFJlY3QmIHIpIHsKKyAgICAgICAgc2V0KHIpOworICAgICAgICByZXR1cm4gKnRoaXM7CisgICAgfQorCisgICAgUmVjdCYgb3BlcmF0b3I9KFJlY3QmIHIpIHsKKyAgICAgICAgc2V0KHIpOworICAgICAgICByZXR1cm4gKnRoaXM7CisgICAgfQorCisgICAgZnJpZW5kIGludCBvcGVyYXRvcj09KGNvbnN0IFJlY3QmIGEsIGNvbnN0IFJlY3QmIGIpIHsKKyAgICAgICAgcmV0dXJuICFtZW1jbXAoJmEsICZiLCBzaXplb2YoYSkpOworICAgIH0KKworICAgIGZyaWVuZCBpbnQgb3BlcmF0b3IhPShjb25zdCBSZWN0JiBhLCBjb25zdCBSZWN0JiBiKSB7CisgICAgICAgIHJldHVybiBtZW1jbXAoJmEsICZiLCBzaXplb2YoYSkpOworICAgIH0KKworICAgIGJvb2wgaXNFbXB0eSgpIGNvbnN0IHsKKyAgICAgICAgcmV0dXJuIGxlZnQgPj0gcmlnaHQgfHwgdG9wID49IGJvdHRvbTsKKyAgICB9CisKKyAgICB2b2lkIHNldEVtcHR5KCkgeworICAgICAgICBtZW1zZXQodGhpcywgMCwgc2l6ZW9mKCp0aGlzKSk7CisgICAgfQorCisgICAgdm9pZCBzZXQoZmxvYXQgbGVmdCwgZmxvYXQgdG9wLCBmbG9hdCByaWdodCwgZmxvYXQgYm90dG9tKSB7CisgICAgICAgIHRoaXMtPmxlZnQgPSBsZWZ0OworICAgICAgICB0aGlzLT5yaWdodCA9IHJpZ2h0OworICAgICAgICB0aGlzLT50b3AgPSB0b3A7CisgICAgICAgIHRoaXMtPmJvdHRvbSA9IGJvdHRvbTsKKyAgICB9CisKKyAgICB2b2lkIHNldChjb25zdCBSZWN0JiByKSB7CisgICAgICAgIHNldChyLmxlZnQsIHIudG9wLCByLnJpZ2h0LCByLmJvdHRvbSk7CisgICAgfQorCisgICAgZmxvYXQgZ2V0V2lkdGgoKSBjb25zdCB7CisgICAgICAgIHJldHVybiByaWdodCAtIGxlZnQ7CisgICAgfQorCisgICAgZmxvYXQgZ2V0SGVpZ2h0KCkgY29uc3QgeworICAgICAgICByZXR1cm4gYm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gICAgfQorCisgICAgcHVibGljIFByb2dyYW1TdG9yZSBnZXRfZ1BGU0JhY2tncm91bmQoKSB7CisgICAgICAgIHJldHVybiBtRXhwb3J0VmFyX2dQRlNCYWNrZ3JvdW5kOworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgc3RhdGljIGludCBtRXhwb3J0VmFySWR4X2dSb3RhdGUgPSA1OworICAgIHByaXZhdGUgZmxvYXQgbUV4cG9ydFZhcl9nUm90YXRlOworICAgIHB1YmxpYyB2b2lkIHNldF9nUm90YXRlKGZsb2F0IHYpIHsKKyAgICAgICAgbUV4cG9ydFZhcl9nUm90YXRlID0gdjsKKyAgICAgICAgc2V0VmFyKG1FeHBvcnRWYXJJZHhfZ1JvdGF0ZSwgdik7CisgICAgfQorCisgICAgcHVibGljIGZsb2F0IGdldF9nUm90YXRlKCkgeworICAgICAgICByZXR1cm4gbUV4cG9ydFZhcl9nUm90YXRlOworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgc3RhdGljIGludCBtRXhwb3J0VmFySWR4X2dJdGFsaWMgPSA2OworICAgIHByaXZhdGUgRm9udCBtRXhwb3J0VmFyX2dJdGFsaWM7CisgICAgcHVibGljIHZvaWQgc2V0X2dJdGFsaWMoRm9udCB2KSB7CisgICAgICAgIG1FeHBvcnRWYXJfZ0l0YWxpYyA9IHY7CisgICAgICAgIHNldFZhcihtRXhwb3J0VmFySWR4X2dJdGFsaWMsIHYpOworICAgIH0KKworICAgIHB1YmxpYyBGb250IGdldF9nSXRhbGljKCkgeworICAgICAgICByZXR1cm4gbUV4cG9ydFZhcl9nSXRhbGljOworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgc3RhdGljIGludCBtRXhwb3J0VmFySWR4X2dUZXh0QWxsb2MgPSA3OworICAgIHByaXZhdGUgQWxsb2NhdGlvbiBtRXhwb3J0VmFyX2dUZXh0QWxsb2M7CisgICAgcHVibGljIHZvaWQgc2V0X2dUZXh0QWxsb2MoQWxsb2NhdGlvbiB2KSB7C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IGZvciAoY3Q9MDsgY3QgPCBjb3VudDsgY3QrKykgewotICAgICAgICBzcmNJZHggPSBjdCAqIDUgKyAxOwotCi0gICAgICAgIGR4ID0gbG9hZEkzMihjb24sIDIsIHNyY0lkeCk7Ci0gICAgICAgIGR5ID0gbG9hZEkzMihjb24sIDIsIHNyY0lkeCArIDEpOwotICAgICAgICBsaWZlID0gbG9hZEkzMihjb24sIDIsIHNyY0lkeCArIDIpOwotICAgICAgICBwb3N4ID0gbG9hZEkzMihjb24sIDIsIHNyY0lkeCArIDMpOwotICAgICAgICBwb3N5ID0gbG9hZEkzMihjb24sIDIsIHNyY0lkeCArIDQpOwotCi0gICAgICAgIGlmIChsaWZlKSB7Ci0gICAgICAgICAgICBpZiAocG9zeSA8ICg0ODAgPDwgMTYpKSB7Ci0gICAgICAgICAgICAgICAgZHN0SWR4ID0gZHJhd0NvdW50ICogOTsKLSAgICAgICAgICAgICAgICBjID0gMHhmZmFmY2YgfCAoKGxpZmUgPj4gbGlmZVNoaWZ0KSA8PCAyNCk7Ci0KLSAgICAgICAgICAgICAgICBzdG9yZVUzMihjb24sIDEsIGRzdElkeCwgYyk7Ci0gICAgICAgICAgICAgICAgc3RvcmVJMzIoY29uLCAxLCBkc3RJZHggKyAxLCBwb3N4KTsKLSAgICAgICAgICAgICAgICBzdG9yZUkzMihjb24sIDEsIGRzdElkeCArIDIsIHBvc3kpOwotCi0gICAgICAgICAgICAgICAgc3RvcmVVMzIoY29uLCAxLCBkc3RJZHggKyAzLCBjKTsKLSAgICAgICAgICAgICAgICBzdG9yZUkzMihjb24sIDEsIGRzdElkeCArIDQsIHBvc3ggKyAweDEwMDAwKTsKLSAgICAgICAgICAgICAgICBzdG9yZUkzMihjb24sIDEsIGRzdElkeCArIDUsIHBvc3kgKyBkeSAqIDQpOwotCi0gICAgICAgICAgICAgICAgc3RvcmVVMzIoY29uLCAxLCBkc3RJZHggKyA2LCBjKTsKLSAgICAgICAgICAgICAgICBzdG9yZUkzMihjb24sID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CBqYXZhLmlvLldyaXRlcjsKLWltcG9ydCBqYXZhLmxhbmcuTWF0aDsKLWltcG9ydCBhbmRyb2lkLnV0aWwuTG9nOwotCi1pbXBvcnQgYW5kcm9pZC5yZW5kZXJzY3JpcHQuUmVuZGVyU2NyaXB0OwotaW1wb3J0IGFuZHJvaWQucmVuZGVyc2NyaXB0LlNpbXBsZU1lc2g7Ci0KLQotY2xhc3MgRmlsbVN0cmlwTWVzaCB7Ci0KLSAgICBjbGFzcyBWZXJ0ZXggewotICAgICAgICBmbG9hdCBueDsKLSAgICAgICAgZmxvYXQgbnk7Ci0gICAgICAgIGZsb2F0IG56OwotICAgICAgICBmbG9hdCBzOwotICAgICAgICBmbG9hdCB0OwotICAgICAgICBmbG9hdCB4OwotICAgICAgICBmbG9hdCB5OwotICAgICAgICBmbG9hdCB6OwotCi0gICAgICAgIFZlcnRleCgpIHsKLSAgICAgICAgICAgIG54ID0gMDsKLSAgICAgICAgICAgIG55ID0gMDsKLSAgICAgICAgICAgIG56ID0gMDsKLSAgICAgICAgICAgIHMgPSAwOwotICAgICAgICAgICAgdCA9IDA7Ci0gICAgICAgICAgICB4ID0gMDsKLSAgICAgICAgICAgIHkgPSAwOwotICAgICAgICAgICAgeiA9IDA7Ci0gICAgICAgIH0KLQotICAgICAgICB2b2lkIHh5eihmbG9hdCBfeCwgZmxvYXQgX3ksIGZsb2F0IF96KSB7Ci0gICAgICAgICAgICB4ID0gX3g7Ci0gICAgICAgICAgICB5ID0gX3k7Ci0gICAgICAgICAgICB6ID0gX3o7Ci0gICAgICAgIH0KLQotICAgICAgICB2b2lkIG54eXooZmxvYXQgX3gsIGZsb2F0IF95LCBmbG9hdCBfeikgewotICAgICAgICAgICAgbnggPSBfeDsKLSAgICAgICAgICAgIG55ID0gX3k7Ci0gICAgICAgICAgICBueiA9IF96OwotICAgICAgICB9Ci0KLSAgICAgICAgdm9pZCBzdChmbG9hdCBfcywgZmxvYXQgX3QpIHsKLSAgICAgICAgICAgIHMgPS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MwNDBmLAotICAgICAgICAgICAgMTQxLjEzMTY4NmYsIC01MC40ODY5MTRmLAotICAgICAgICAgICAgMTI1LjE0MTc5NWYsIC02MC42OTk1OTRmLAotICAgICAgICAgICAgMTA2LjkxODExN2YsIC02NS45NzkwODFmLAotICAgICAgICAgICAgODcuOTQ1MjgzZiwgLTY1Ljg5NTI2OWYsCi0gICAgICAgICAgICA4MGYsIC02NS44OTUyNjlmLAotICAgICAgICAgICAgNjBmLCAtNjUuODk1MjY5ZiwKLSAgICAgICAgICAgIDQwZiwgLTY1Ljg5NTI2OWYsCi0gICAgICAgICAgICAyMGYsIC02NS44OTUyNjlmLAotICAgICAgICAgICAgMGYsIC02NS44OTUyNjlmLAotICAgICAgICAgICAgLTIwZiwgLTY1Ljg5NTI2OWYsCi0gICAgICAgICAgICAtNDBmLCAtNjUuODk1MjY5ZiwKLSAgICAgICAgICAgIC02MGYsIC02NS44OTUyNjlmLAotICAgICAgICAgICAgLTgwZiwgLTY1Ljg5NTI2OWYsCi0gICAgICAgICAgICAtODcuOTQ1MjgzZiwgLTY1Ljg5NTI2OWYsCi0gICAgICAgICAgICAtMTA2LjkxODExN2YsIC02NS45NzkwODFmLAotICAgICAgICAgICAgLTEyNS4xNDE3OTVmLCAtNjAuNjk5NTk0ZiwKLSAgICAgICAgICAgIC0xNDEuMTMxNjg2ZiwgLTUwLjQ4NjkxNGYsCi0gICAgICAgICAgICAtMTUzLjU4NTEzN2YsIC0zNi4xNzMwNDBmLAotICAgICAgICAgICAgLTE2MS40ODc2MDBmLCAtMTguOTI0MDg0ZiwKLSAgICAgICAgICAgIC0xNjQuMTk1MjgzZiwgLTAuMTQ1MjY5ZiwKLSAgICAgICAgICAgIC0xNjEuNDg3NjAwZiwgMTguNjMzNTQ1ZiwKLSAgICAgICAgICAgICAtMTUzLjU4NTEzN2YsIDM1Ljg4MjUwMmYsCi0gICAgICAgICAgICAgLTE0MS4xMzE2ODZmLCA1MC4xOTYzNzZmLAotICAgICAgICAgICAg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SAwOwotICAgICAgICAgICAgdG0uc2V0Tm9ybWFsKHQubngsIHQubnksIHQubnopOwotICAgICAgICAgICAgdG0uc2V0VGV4dHVyZSh0LnMsIHQudCk7Ci0gICAgICAgICAgICB0bS5hZGRWZXJ0ZXgodC54LCB0LnksIHQueik7Ci0gICAgICAgICAgICAvL2FuZHJvaWQudXRpbC5Mb2cuZSgicnMiLCAidnR4IHg9Iit0LngrIiB5PSIrdC55KyIgej0iK3QueisiIHM9Iit0LnMrIiB0PSIrdC50KTsKLSAgICAgICAgICAgIHQueSA9IC41ZjsKLSAgICAgICAgICAgIHQudCA9IDE7Ci0gICAgICAgICAgICB0bS5zZXRUZXh0dXJlKHQucywgdC50KTsKLSAgICAgICAgICAgIHRtLmFkZFZlcnRleCh0LngsIHQueSwgdC56KTsKLSAgICAgICAgICAgIC8vYW5kcm9pZC51dGlsLkxvZy5lKCJycyIsICJ2dHggeD0iK3QueCsiIHk9Iit0LnkrIiB6PSIrdC56KyIgcz0iK3QucysiIHQ9Iit0LnQpOwotCi0gICAgICAgICAgICBpZigocnVubmluZ1MqMikgPiBtVHJpYW5nbGVPZmZzZXRzQ291bnQpIHsKLSAgICAgICAgICAgICAgICBtVHJpYW5nbGVPZmZzZXRzW21UcmlhbmdsZU9mZnNldHNDb3VudF0gPSBjdCoyICogMzsKLSAgICAgICAgICAgICAgICBtVHJpYW5nbGVPZmZzZXRzVGV4W21UcmlhbmdsZU9mZnNldHNDb3VudF0gPSB0LnM7Ci0gICAgICAgICAgICAgICAgbVRyaWFuZ2xlT2Zmc2V0c0NvdW50ICsrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgY291bnQgPSAoY291bnQgKiAyIC0gMik7Ci0gICAgICAgIGZvciAoaW50IGN0PTA7IGN0IDwgKGNvdW50LTIpOyBjdCs9IDIpIHsKLSAgICAgICAgICAgIHRtLmFkZFRyaWFuZ2xlKGN0LCBjdCsxLCBjdCsyKTsKLSAgICAgICAgICAgIHRtLmF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pIDw8IDE2IHwKLSAgICAgICAgICAgICAgICAgICAgKDB4ZjAgPDwgMjQpOwotICAgICAgICBzdHJ1Y3QgcG9pbnRfcyAqIG5wID0gJnBbbmV3UGFydF07Ci0KLSAgICAgICAgd2hpbGUgKHJhdGUtLSkgewotICAgICAgICAgICAgdmVjMlJhbmQoKGZsb2F0ICopJm5wLT5kZWx0YS54LCByTWF4KTsKLSAgICAgICAgICAgIG5wLT5wb3NpdGlvbi54ID0geDsKLSAgICAgICAgICAgIG5wLT5wb3NpdGlvbi55ID0geTsKLSAgICAgICAgICAgIG5wLT5jb2xvciA9IGNvbG9yOwotICAgICAgICAgICAgbmV3UGFydCsrOwotICAgICAgICAgICAgbnArKzsKLSAgICAgICAgICAgIGlmIChuZXdQYXJ0ID49IGNvdW50KSB7Ci0gICAgICAgICAgICAgICAgbmV3UGFydCA9IDA7Ci0gICAgICAgICAgICAgICAgbnAgPSAmcFtuZXdQYXJ0XTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIGZvciAoY3Q9MDsgY3QgPCBjb3VudDsgY3QrKykgewotICAgICAgICBmbG9hdCBkeSA9IHAtPmRlbHRhLnkgKyAwLjE1ZjsKLSAgICAgICAgZmxvYXQgcG9zeSA9IHAtPnBvc2l0aW9uLnkgKyBkeTsKLSAgICAgICAgaWYgKChwb3N5ID4gaGVpZ2h0KSAmJiAoZHkgPiAwKSkgewotICAgICAgICAgICAgZHkgKj0gLTAuM2Y7Ci0gICAgICAgIH0KLSAgICAgICAgcC0+ZGVsdGEueSA9IGR5OwotICAgICAgICBwLT5wb3NpdGlvbi54ICs9IHAtPmRlbHRhLng7Ci0gICAgICAgIHAtPnBvc2l0aW9uLnkgPSBwb3N5OwotICAgICAgICBwKys7Ci0gICAgfQotCi0gICAgdXBsb2FkVG9CdWZmZXJPYmplY3QoTkFNRURfUGFydEJ1ZmZlcik7Ci0gICAgZHJhd1NpbXBsZU1lc2goTkFNRURfUGFydE1lc2gpOwotIC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mYsIDAuZiwgMC5mLCAxLmYpOworICAgIGNvbnN0IGZsb2F0IGhlaWdodCA9IHJzZ0dldEhlaWdodCgpOworICAgIGNvbnN0IGludCBzaXplID0gcnNBbGxvY2F0aW9uR2V0RGltWChyc0dldEFsbG9jYXRpb24ocG9pbnQpKTsKKworICAgIFBvaW50X3QgKiBwID0gcG9pbnQ7CisgICAgZm9yIChpbnQgY3Q9MDsgY3QgPCBzaXplOyBjdCsrKSB7CisgICAgICAgIHAtPmRlbHRhLnkgKz0gMC4xNWY7CisgICAgICAgIHAtPnBvc2l0aW9uICs9IHAtPmRlbHRhOworICAgICAgICBpZiAoKHAtPnBvc2l0aW9uLnkgPiBoZWlnaHQpICYmIChwLT5kZWx0YS55ID4gMCkpIHsKKyAgICAgICAgICAgIHAtPmRlbHRhLnkgKj0gLTAuM2Y7CisgICAgICAgIH0KKyAgICAgICAgcCsrOworICAgIH0KKworICAgIHJzZ0RyYXdTaW1wbGVNZXNoKHBhcnRNZXNoKTsKKyAgICByZXR1cm4gMTsKK30KKwordm9pZCBhZGRQYXJ0aWNsZXMoaW50IHJhdGUsIGZsb2F0IHgsIGZsb2F0IHksIGJvb2wgbmV3Q29sb3IpCit7CisgICAgaWYgKG5ld0NvbG9yKSB7CisgICAgICAgIHBhcnRDb2xvci54ID0gcnNSYW5kKDAuNWYsIDEuMGYpOworICAgICAgICBwYXJ0Q29sb3IueSA9IHJzUmFuZCgxLjBmKTsKKyAgICAgICAgcGFydENvbG9yLnogPSByc1JhbmQoMS4wZik7CisgICAgfQorICAgIGZsb2F0IHJNYXggPSAoKGZsb2F0KXJhdGUpICogMC4wMDVmOworICAgIGludCBzaXplID0gcnNBbGxvY2F0aW9uR2V0RGltWChyc0dldEFsbG9jYXRpb24ocG9pbnQpKTsKKyAgICB1Y2hhcjQgYyA9IHJzUGFja0NvbG9yVG84ODg4KHBhcnRDb2xvcik7CisKKyAgICBQb2ludF90ICogbnAgPSAmcG9pbnRbbmV3UGFydF07CisgICAgZmx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XZhdGUgU2NyaXB0Q19Gb3VudGFpbiBtU2NyaXB0OwogICAgIHB1YmxpYyB2b2lkIGluaXQoUmVuZGVyU2NyaXB0R0wgcnMsIFJlc291cmNlcyByZXMsIGludCB3aWR0aCwgaW50IGhlaWdodCkgewogICAgICAgICBtUlMgPSByczsKICAgICAgICAgbVJlcyA9IHJlczsKLSAgICAgICAgaW5pdFJTKCk7Ci0gICAgfQogCi0gICAgcHVibGljIHZvaWQgbmV3VG91Y2hQb3NpdGlvbihpbnQgeCwgaW50IHksIGludCByYXRlKSB7Ci0gICAgICAgIGlmIChtU0QucmF0ZSA9PSAwKSB7Ci0gICAgICAgICAgICBtU0QuciA9ICgoeCAmIDB4MSkgIT0gMCkgPyAwLmYgOiAxLmY7Ci0gICAgICAgICAgICBtU0QuZyA9ICgoeCAmIDB4MikgIT0gMCkgPyAwLmYgOiAxLmY7Ci0gICAgICAgICAgICBtU0QuYiA9ICgoeCAmIDB4NCkgIT0gMCkgPyAwLmYgOiAxLmY7Ci0gICAgICAgICAgICBpZiAoKG1TRC5yICsgbVNELmcgKyBtU0QuYikgPCAwLjlmKSB7Ci0gICAgICAgICAgICAgICAgbVNELnIgPSAwLjhmOwotICAgICAgICAgICAgICAgIG1TRC5nID0gMC41ZjsKLSAgICAgICAgICAgICAgICBtU0QuYiA9IDEuZjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBtU0QucmF0ZSA9IHJhdGU7Ci0gICAgICAgIG1TRC54ID0geDsKLSAgICAgICAgbVNELnkgPSB5OwotICAgICAgICBtSW50QWxsb2MuZGF0YShtU0QpOwotICAgIH0KLQotCi0gICAgLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KLQotICAgIHByaXZhdGUgUmVzb3VyY2VzIG1SZXM7Ci0KLSAgICBwcml2YXRlIFJlbmRlclNjcmlwdEdMIG1SUzsKLSAgICBwcml2YXRlIEFsbG9jYXRpb24gbUludEFsbG9jO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KyAgICBmbG9hdDMgdGVtcCA9IHJzTWF0cml4TXVsdGlwbHkoJmNvbG9yTWF0LCBjdXJyZW50UGl4ZWwueHl6KTsKKyAgICB0ZW1wID0gKGNsYW1wKHRlbXAsIDAuMWYsIDI1NS5mKSAtIGluQmxhY2spICogb3ZlckluV01pbkluQjsKKyAgICB0ZW1wID0gcG93KHRlbXAsIChmbG9hdDMpZ2FtbWEpOworICAgIGN1cnJlbnRQaXhlbC54eXogPSBjbGFtcCh0ZW1wICogb3V0V01pbk91dEIgKyBvdXRCbGFjaywgMC4xZiwgMjU1LmYpOworICAgIHJldHVybiBjdXJyZW50UGl4ZWw7Cit9CisKK3N0YXRpYyB2b2lkIHByb2Nlc3NOb0JsdXIoKSB7CisgICAgaW50IHcsIGgsIHI7CisgICAgaW50IGNvdW50ID0gMDsKKworICAgIGZsb2F0IGluV01pbkluQiA9IGluV2hpdGUgLSBpbkJsYWNrOworICAgIGZsb2F0IG91dFdNaW5PdXRCID0gb3V0V2hpdGUgLSBvdXRCbGFjazsKKyAgICBmbG9hdDQgY3VycmVudFBpeGVsID0gMDsKKworICAgIGZvcihoID0gMDsgaCA8IGhlaWdodDsgaCArKykgeworICAgICAgICBmb3IodyA9IDA7IHcgPCB3aWR0aDsgdyArKykgeworICAgICAgICAgICAgdWNoYXI0ICppbnB1dCA9IEluUGl4ZWwgKyBoKndpZHRoICsgdzsKKworICAgICAgICAgICAgLy9jdXJyZW50UGl4ZWwueHl6ID0gY29udmVydF9mbG9hdDMoaW5wdXQueHl6KTsKKyAgICAgICAgICAgIGN1cnJlbnRQaXhlbC54ID0gKGZsb2F0KShpbnB1dC0+eCk7CisgICAgICAgICAgICBjdXJyZW50UGl4ZWwueSA9IChmbG9hdCkoaW5wdXQtPnkpOworICAgICAgICAgICAgY3VycmVudFBpeGVsLnogPSAoZmxvYXQpKGlucHV0LT56KTsKKworICAgICAgICAgICAgY3VycmVudFBpeGVsID0gbGV2ZWxzU2F0dXJhdGlvbihjdXJyZW50UGl4ZWwpOworCisgICAgICAgICAgICB1Y2hhcjQgKm91dHB1dCA9IE91dFBpeGVsICsgaCp3aWR0aCArIHc7CisgICAgICAgICAgICAvL291dHB1dC54eXogPSBjb252ZXJ0X3VjaGFyMyhjdXJyZW50UGl4ZWwueHl6KTsKKyAgICAgICAgICAgIG91dHB1dC0+eCA9ICh1aW50OF90KWN1cnJlbnRQaXhlbC54OworICAgICAgICAgICAgb3V0cHV0LT55ID0gKHVpbnQ4X3QpY3VycmVudFBpeGVsLnk7CisgICAgICAgICAgICBvdXRwdXQtPnogPSAodWludDhfdCljdXJyZW50UGl4ZWwuejsKKyAgICAgICAgICAgIG91dHB1dC0+dyA9IGlucHV0LT53OworICAgICAgICB9CisgICAgfQorICAgIHJzU2VuZFRvQ2xpZW50KCZjb3VudCwgMSwgNCwgMCk7Cit9CisKK3N0YXRpYyB2b2lkIGhvcml6b250YWxCbHVyKCkgeworICAgIGZsb2F0NCBibHVycmVkUGl4ZWwgPSAwOworICAgIGZsb2F0NCBjdXJyZW50UGl4ZWwgPSAwOworICAgIC8vIEhvcml6b250YWwgYmx1cgorICAgIGludCB3LCBoLCByOworICAgIGZvcihoID0gMDsgaCA8IGhlaWdodDsgaCArKykgeworICAgICAgICB1Y2hhcjQgKmlucHV0ID0gSW5QaXhlbCArIGgqd2lkdGg7CisgICAgICAgIHVjaGFyNCAqb3V0cHV0ID0gU2NyYXRjaFBpeGVsICsgaCp3aWR0aDsKKworICAgICAgICBmb3IodyA9IDA7IHcgPCB3aWR0aDsgdyArKykgeworICAgICAgICAgICAgYmx1cnJlZFBpeGVsID0gMDsKKworICAgICAgICAgICAgZm9yKHIgPSAtcmFkaXVzOyByIDw9IHJhZGl1czsgciArKykgeworICAgICAgICAgICAgICAgIC8vIFN0ZXBwaW5nIGxlZnQgYW5kIHJpZ2h0IGF3YXkgZnJvbSB0aGUgcGl4ZWwKKyAgICAgICAgICAgICAgICBpbnQgdmFsaWRXID0gdyArIHI7CisgICAgICAgICAgICAgICAgLy8gQ2xhbXAgdG8gemVybyBhbmQgd2lkdGggbWF4KCkgaXNuJ3QgZXhwb3NlZCBmb3IgaW50cyB5ZXQKKyAgICAgICAgICAgICAgICBpZih2YWxpZFcgPCAwKSB7CisgICAgICAgICAgICAgICAgICAgIHZhbGlkVyA9IDA7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmKHZhbGlkVyA+IHdpZHRoIC0gMSkgeworICAgICAgICAgICAgICAgICAgICB2YWxpZFcgPSB3aWR0aCAtIDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8vaW50IHZhbGlkVyA9IHJzQ2xhbXAodyArIHIsIDAsIHdpZHRoIC0gMSk7CisKKyAgICAgICAgICAgICAgICBmbG9hdCB3ZWlnaHQgPSBnYXVzc2lhbltyICsgcmFkaXVzXTsKKyAgICAgICAgICAgICAgICBjdXJyZW50UGl4ZWwueCA9IChmbG9hdCkoaW5wdXRbdmFsaWRXXS54KTsKKyAgICAgICAgICAgICAgICBjdXJyZW50UGl4ZWwueSA9IChmbG9hdCkoaW5wdXRbdmFsaWRXXS55KTsKKyAgICAgICAgICAgICAgICBjdXJyZW50UGl4ZWwueiA9IChmbG9hdCkoaW5wdXRbdmFsaWRXXS56KTsKKyAgICAgICAgICAgICAgICAvL2N1cnJlbnRQaXhlbC53ID0gKGZsb2F0KShpbnB1dC0+YSk7CisKKyAgICAgICAgICAgICAgICBibHVycmVkUGl4ZWwgKz0gY3VycmVudFBpeGVsKndlaWdodDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgb3V0cHV0LT54ID0gKHVpbnQ4X3QpYmx1cnJlZFBpeGVsLng7CisgICAgICAgICAgICBvdXRwdXQtPnkgPSAodWludDhfdClibHVycmVkUGl4ZWwueTsKKyAgICAgICAgICAgIG91dHB1dC0+eiA9ICh1aW50OF90KWJsdXJyZWRQaXhlbC56OworICAgICAgICAgICAgLy9vdXRwdXQtPmEgPSAodWludDhfdClibHVycmVkUGl4ZWwudzsKKyAgICAgICAgICAgIG91dHB1dCsrOworICAgICAgICB9CisgICAgfQorfQorCitzdGF0aWMgdm9pZCBob3Jpem9udGFsQmx1ckxldmVscygpIHsKKyAgICBmbG9hdDQgYmx1cnJlZFBpeGVsID0gMDsKKyAgICBmbG9hdDQgY3VycmVudFBpeGVsID0gMDsKKyAgICAvLyBIb3Jpem9udGFsIGJsdXIKKyAgICBpbnQgdywgaCwgcjsKKyAgICBmb3IoaCA9IDA7IGggPCBoZWlnaHQ7IGggKyspIHsKKyAgICAgICAgdWNoYXI0ICpvdXRwdXQgPSBPdXRQaXhlbCArIGgqd2lkdGg7CisKKyAgICAgICAgZm9yKHcgPSAwOyB3IDwgd2lkdGg7IHcgKyspIHsKKyAgICAgICAgICAgIGJsdXJyZWRQaXhlbCA9IDA7CisKKyAgICAgICAgICAgIGZvcihyID0gLXJhZGl1czsgciA8PSByYWRpdXM7IHIgKyspIHsKKyAgICAgICAgICAgICAgICAvLyBTdGVwcGluZyBsZWZ0IGFuZCByaWdodCBhd2F5IGZyb20gdGhlIHBpeGVsCisgICAgICAgICAgICAgICAgaW50IHZhbGlkVyA9IHcgKyByOworICAgICAgICAgICAgICAgIC8vIENsYW1wIHRvIHplcm8gYW5kIHdpZHRoIG1heCgpIGlzbid0IGV4cG9zZWQgZm9yIGludHMgeWV0CisgICAgICAgICAgICAgICAgaWYodmFsaWRXIDwgMCkgeworICAgICAgICAgICAgICAgICAgICB2YWxpZFcgPSAwOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZih2YWxpZFcgPiB3aWR0aCAtIDEpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFsaWRXID0gd2lkdGggLSAxOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvL2ludCB2YWxpZFcgPSByc0NsYW1wKHcgKyByLCAwLCB3aWR0aCAtIDEpOworCisgICAgICAgICAgICAgICAgdWNoYXI0ICppbnB1dCA9IEluUGl4ZWwgKyBoKndpZHRoICsgdmFsaWRXOworCisgICAgICAgICAgICAgICAgZmxvYXQgd2VpZ2h0ID0gZ2F1c3NpYW5bciArIHJhZGl1c107CisgICAgICAgICAgICAgICAgY3VycmVudFBpeGVsLnggPSAoZmxvYXQpKGlucHV0LT54KTsKKyAgICAgICAgICAgICAgICBjdXJyZW50UGl4ZWwueSA9IChmbG9hdCkoaW5wdXQtPnkpOworICAgICAgICAgICAgICAgIGN1cnJlbnRQaXhlbC56ID0gKGZsb2F0KShpbnB1dC0+eik7CisgICAgICAgICAgICAgICAgLy9jdXJyZW50UGl4ZWwudyA9IChmbG9hdCkoaW5wdXQtPmEpOworCisgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsLnh5eiArPSBjdXJyZW50UGl4ZWwueHl6ICogd2VpZ2h0OworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBibHVycmVkUGl4ZWwgPSBsZXZlbHNTYXR1cmF0aW9uKGJsdXJyZWRQaXhlbCk7CisKKyAgICAgICAgICAgIG91dHB1dC0+eCA9ICh1aW50OF90KWJsdXJyZWRQaXhlbC54OworICAgICAgICAgICAgb3V0cHV0LT55ID0gKHVpbnQ4X3QpYmx1cnJlZFBpeGVsLnk7CisgICAgICAgICAgICBvdXRwdXQtPnogPSAodWludDhfdClibHVycmVkUGl4ZWwuejsKKyAgICAgICAgICAgIC8vb3V0cHV0LT5hID0gKHVpbnQ4X3QpYmx1cnJlZFBpeGVsLnc7CisgICAgICAgICAgICBvdXRwdXQrKzsKKyAgICAgICAgfQorICAgIH0KK30KKworc3RhdGljIHZvaWQgdmVydGljYWxCbHVyKCkgeworICAgIGZsb2F0NCBibHVycmVkUGl4ZWwgPSAwOworICAgIGZsb2F0NCBjdXJyZW50UGl4ZWwgPSAwOworICAgIC8vIFZlcnRpY2FsIGJsdXIKKyAgICBpbnQgdywgaCwgcjsKKyAgICBmb3IoaCA9IDA7IGggPCBoZWlnaHQ7IGggKyspIHsKKyAgICAgICAgdWNoYXI0ICpvdXRwdXQgPSBPdXRQaXhlbCArIGgqd2lkdGg7CisKKyAgICAgICAgZm9yKHcgPSAwOyB3IDwgd2lkdGg7IHcgKyspIHsKKworICAgICAgICAgICAgYmx1cnJlZFBpeGVsID0gMDsKKyAgICAgICAgICAgIGZvcihyID0gLXJhZGl1czsgciA8PSByYWRpdXM7IHIgKyspIHsKKyNpZiAxCisgICAgICAgICAgICAgICAgaW50IHZhbGlkSCA9IGggKyByOworICAgICAgICAgICAgICAgIC8vIENsYW1wIHRvIHplcm8gYW5kIHdpZHRoCisgICAgICAgICAgICAgICAgaWYodmFsaWRIIDwgMCkgeworICAgICAgICAgICAgICAgICAgICB2YWxpZEggPSAwOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZih2YWxpZEggPiBoZWlnaHQgLSAxKSB7CisgICAgICAgICAgICAgICAgICAgIHZhbGlkSCA9IGhlaWdodCAtIDE7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgdWNoYXI0ICppbnB1dCA9IFNjcmF0Y2hQaXhlbCArIHZhbGlkSCp3aWR0aCArIHc7CisKKyAgICAgICAgICAgICAgICBmbG9hdCB3ZWlnaHQgPSBnYXVzc2lhbltyICsgcmFkaXVzXTsKKworICAgICAgICAgICAgICAgIGN1cnJlbnRQaXhlbC54ID0gKGZsb2F0KShpbnB1dC0+eCk7CisgICAgICAgICAgICAgICAgY3VycmVudFBpeGVsLnkgPSAoZmxvYXQpKGlucHV0LT55KTsKKyAgICAgICAgICAgICAgICBjdXJyZW50UGl4ZWwueiA9IChmbG9hdCkoaW5wdXQtPnopOworCisgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsLnh5eiArPSBjdXJyZW50UGl4ZWwueHl6ICogd2VpZ2h0OworI2Vsc2UKKyAgICAgICAgICAgICAgICBpbnQgdmFsaWRIID0gcnNDbGFtcChoICsgciwgMCwgaGVpZ2h0IC0gMSk7CisgICAgICAgICAgICAgICAgdWNoYXI0ICppbnB1dCA9IFNjcmF0Y2hQaXhlbCArIHZhbGlkSCp3aWR0aCArIHc7CisgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsLnh5eiArPSBjb252ZXJ0X2Zsb2F0MyhpbnB1dC0+eHl6KSAqIGdhdXNzaWFuW3IgKyByYWRpdXNdOworI2VuZGlmCisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vb3V0cHV0LT54eXogPSBjb252ZXJ0X3VjaGFyMyhibHVycmVkUGl4ZWwueHl6KTsKKyAgICAgICAgICAgIG91dHB1dC0+eCA9ICh1aW50OF90KWJsdXJyZWRQaXhlbC54OworICAgICAgICAgICAgb3V0cHV0LT55ID0gKHVpbnQ4X3QpYmx1cnJlZFBpeGVsLnk7CisgICAgICAgICAgICBvdXRwdXQtPnogPSAodWludDhfdClibHVycmVkUGl4ZWwuejsKKyAgICAgICAgICAgIC8vb3V0cHV0LT5hID0gKHVpbnQ4X3QpYmx1cnJlZFBpeGVsLnc7CisgICAgICAgICAgICBvdXRwdXQrKzsKKyAgICAgICAgfQorICAgIH0KK30KKwordm9pZCBmaWx0ZXIoKSB7CisgICAgUlNfREVCVUcoaGVpZ2h0KTsKKyAgICBSU19ERUJVRyh3aWR0aCk7CisgICAgUlNfREVCVUcocmFkaXVzKTsKKworICAgIGNvbXB1dGVDb2xvck1hdHJpeCgpOworCisgICAgaWYocmFkaXVzID09IDApIHsKKyAgICAgICAgcHJvY2Vzc05vQmx1cigpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgY29tcHV0ZUdhdXNzaWFuV2VpZ2h0cygpOworCisgICAgaG9yaXpvbnRhbEJsdXJMZXZlbHMoKTsKKyAgICB2ZXJ0aWNhbEJsdXIoKTsKKworICAgIGludCBjb3VudCA9IDA7CisgICAgcnNTZW5kVG9DbGllbnQoJmNvdW50LCAxLCA0LCAwKTsKK30KKwordm9pZCBmaWx0ZXJCZW5jaG1hcmsoKSB7CisKKyAgICBjb21wdXRlR2F1c3NpYW5XZWlnaHRzKCk7CisKKy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SGVpZ2h0KTsKICAgICAgICAgICAgICAgICBtRGlzcGxheVZpZXcuaW52YWxpZGF0ZSgpOwogICAgICAgICAgICAgfQogICAgICAgICB9OwpAQCAtODksMjkgKzg5LDIxOSBAQAogICAgICAgICB9CiAgICAgfQogCi0gICAgcHJpdmF0ZSB2b2lkIGphdmFGaWx0ZXIoKSB7CisgICAgaW50IGluW107CisgICAgaW50IGludGVybVtdOworICAgIGludCBvdXRbXTsKKyAgICBpbnQgTUFYX1JBRElVUyA9IDI1OworICAgIC8vIFN0b3JlIG91ciBjb2VmZmljaWVudHMgaGVyZQorICAgIGZsb2F0IGdhdXNzaWFuW107CisKKyAgICBwcml2YXRlIGxvbmcgamF2YUZpbHRlcigpIHsKKyAgICAgICAgZmluYWwgaW50IHdpZHRoID0gbUJpdG1hcEluLmdldFdpZHRoKCk7CisgICAgICAgIGZpbmFsIGludCBoZWlnaHQgPSBtQml0bWFwSW4uZ2V0SGVpZ2h0KCk7CisgICAgICAgIGZpbmFsIGludCBjb3VudCA9IHdpZHRoICogaGVpZ2h0OworCisgICAgICAgIGlmIChpbiA9PSBudWxsKSB7CisgICAgICAgICAgICBpbiA9IG5ldyBpbnRbY291bnRdOworICAgICAgICAgICAgaW50ZXJtID0gbmV3IGludFtjb3VudF07CisgICAgICAgICAgICBvdXQgPSBuZXcgaW50W2NvdW50XTsKKyAgICAgICAgICAgIGdhdXNzaWFuID0gbmV3IGZsb2F0W01BWF9SQURJVVMgKiAyICsgMV07CisgICAgICAgICAgICBtQml0bWFwSW4uZ2V0UGl4ZWxzKGluLCAwLCB3aWR0aCwgMCwgMCwgd2lkdGgsIGhlaWdodCk7CisgICAgICAgIH0KKwogICAgICAgICBsb25nIHQgPSBqYXZhLmxhbmcuU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCk7Ci0gICAgICAgIGludCBjb3VudCA9IG1QYXJhbXMuaW5XaWR0aCAqIG1QYXJhbXMuaW5IZWlnaHQ7Ci0gICAgICAgIGZsb2F0IHRocmVzaG9sZCA9IG1QYXJhbXMudGhyZXNob2xkICogMjU1LmY7CiAKLSAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7Ci0gICAgICAgICAgICBmaW5hbCBmbG9hdCByID0gKGZsb2F0KSgobUluRGF0YVtpXSA+PiAwKSAmIDB4ZmYpOwotICAgICAgICAgICAgZmluYWwgZmxvYXQgZyA9IChmbG9hdCkoKG1JbkRhdGFbaV0gPj4gOCkgJiAweGZmKTsKLSAgICAgICAgICAgIGZpbmFsIGZsb2F0IGIgPSAoZmxvYXQpKChtSW5EYXRhW2ldID4+IDE2KSAmIDB4ZmYpOworICAgICAgICBpbnQgdywgaCwgcjsKIAotICAgICAgICAgICAgZmluYWwgZmxvYXQgbHVtaW5hbmNlID0gMC4yMTI1ZiAqIHIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC43MTU0ZiAqIGcgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wNzIxZiAqIGI7Ci0gICAgICAgICAgICBpZiAobHVtaW5hbmNlID4gdGhyZXNob2xkKSB7Ci0gICAgICAgICAgICAgICAgbU91dERhdGFbaV0gPSBtSW5EYXRhW2ldOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBtT3V0RGF0YVtpXSA9IG1JbkRhdGFbaV0gJiAweGZmMDAwMDAwOworICAgICAgICBmbG9hdCBmUmFkaXVzID0gKGZsb2F0KW1SYWRpdXM7CisgICAgICAgIGludCByYWRpdXMgPSAoaW50KW1SYWRpdXM7CisKKyAgICAgICAgLy8gQ29tcHV0ZSBnYXVzc2lhbiB3ZWlnaHRzIGZvciB0aGUgYmx1cgorICAgICAgICAvLyBlIGlzIHRoZSBldWxlcidzIG51bWJlcgorICAgICAgICBmbG9hdCBlID0gMi43MTgyODE4Mjg0NTkwNDVmOworICAgICAgICBmbG9hdCBwaSA9IDMuMTQxNTkyNjUzNTg5NzkzMmY7CisgICAgICAgI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IGNvZWZmMiA9IC0gMS4wZiAvICgyLjBmICogc2lnbWEgKiBzaWdtYSk7CisgICAgICAgIGZsb2F0IG5vcm1hbGl6ZUZhY3RvciA9IDAuMGY7CisgICAgICAgIGZsb2F0IGZsb2F0UiA9IDAuMGY7CisgICAgICAgIGZvcihyID0gLXJhZGl1czsgciA8PSByYWRpdXM7IHIgKyspIHsKKyAgICAgICAgICAgIGZsb2F0UiA9IChmbG9hdClyOworICAgICAgICAgICAgZ2F1c3NpYW5bciArIHJhZGl1c10gPSBjb2VmZjEgKiAoZmxvYXQpTWF0aC5wb3coZSwgZmxvYXRSICogZmxvYXRSICogY29lZmYyKTsKKyAgICAgICAgICAgIG5vcm1hbGl6ZUZhY3RvciArPSBnYXVzc2lhbltyICsgcmFkaXVzXTsKKyAgICAgICAgfQorCisgICAgICAgIC8vTm93IHdlIG5lZWQgdG8gbm9ybWFsaXplIHRoZSB3ZWlnaHRzIGJlY2F1c2UgYWxsIG91ciBjb2VmZmljaWVudHMgbmVlZCB0byBhZGQgdXAgdG8gb25lCisgICAgICAgIG5vcm1hbGl6ZUZhY3RvciA9IDEuMGYgLyBub3JtYWxpemVGYWN0b3I7CisgICAgICAgIGZvcihyID0gLXJhZGl1czsgciA8PSByYWRpdXM7IHIgKyspIHsKKyAgICAgICAgICAgIGZsb2F0UiA9IChmbG9hdClyOworICAgICAgICAgICAgZ2F1c3NpYW5bciArIHJhZGl1c10gKj0gbm9ybWFsaXplRmFjdG9yOworICAgICAgICB9CisKKyAgICAgICAgZmxvYXQgYmx1cnJlZFBpeGVsUiA9IDAuMGY7CisgICAgICAgIGZsb2F0IGJsdXJyZWRQaXhlbEcgPSAwLjBmOworICAgICAgICBmbG9hdCBibHVycmVkUGl4ZWxCID0gMC4wZjsKKyAgICAgICAgZmxvYXQgYmx1cnJlZFBpeGVsQSA9IDAuMGY7CisKKyAgICAgICAgZm9yKGggPSAwOyBoIDwgaGVpZ2h0OyBoICsrKSB7CisgICAgICAgICAgICBmb3IodyA9IDA7IHcgPCB3aWR0aDsgdyArKykgeworCisgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsUiA9IDAuMGY7CisgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsRyA9IDAuMGY7CisgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsQiA9IDAuMGY7CisgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsQSA9IDAuMGY7CisKKyAgICAgICAgICAgICAgICBmb3IociA9IC1yYWRpdXM7IHIgPD0gcmFkaXVzOyByICsrKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFN0ZXBwaW5nIGxlZnQgYW5kIHJpZ2h0IGF3YXkgZnJvbSB0aGUgcGl4ZWwKKyAgICAgICAgICAgICAgICAgICAgaW50IHZhbGlkVyA9IHcgKyByOworICAgICAgICAgICAgICAgICAgICAvLyBDbGFtcCB0byB6ZXJvIGFuZCB3aWR0aCBtYXgoKSBpc24ndCBleHBvc2VkIGZvciBpbnRzIHlldAorICAgICAgICAgICAgICAgICAgICBpZih2YWxpZFcgPCAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWxpZFcgPSAwOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmKHZhbGlkVyA+IHdpZHRoIC0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFsaWRXID0gd2lkdGggLSAxOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaW50IGlucHV0ID0gaW5baCp3aWR0aCArIHZhbGlkV107CisKKyAgICAgICAgICAgICAgICAgICAgaW50IFIgPSAoKGlucHV0ID4+IDI0KSAmIDB4ZmYpOworICAgICAgICAgICAgICAgICAgICBpbnQgRyA9ICgoaW5wdXQgPj4gMTYpICYgMHhmZik7CisgICAgICAgICAgICAgICAgICAgIGludCBCID0gKChpbnB1dCA+PiA4KSAmIDB4ZmYpOworICAgICAgICAgICAgICAgICAgICBpbnQgQSA9IChpbnB1dCAmIDB4ZmYpOworCisgICAgICAgICAgICAgICAgICAgIGZsb2F0IHdlaWdodCA9IGdhdXNzaWFuW3IgKyByYWRpdXNdOworCisgICAgICAgICAgICAgICAgICAgIGJsdXJyZWRQaXhlbFIgKz0gKGZsb2F0KShSKSp3ZWlnaHQ7CisgICAgICAgICAgICAgICAgICAgIGJsdXJyZWRQaXhlbEcgKz0gKGZsb2F0KShHKSp3ZWlnaHQ7CisgICAgICAgICAgICAgICAgICAgIGJsdXJyZWRQaXhlbEIgKz0gKGZsb2F0KShCKSp3ZWlnaHQ7CisgICAgICAgICAgICAgICAgICAgIGJsdXJyZWRQaXhlbEEgKz0gKGZsb2F0KShBKSp3ZWlnaHQ7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaW50IFIgPSAoaW50KWJsdXJyZWRQaXhlbFI7CisgICAgICAgICAgICAgICAgaW50IEcgPSAoaW50KWJsdXJyZWRQaXhlbEc7CisgICAgICAgICAgICAgICAgaW50IEIgPSAoaW50KWJsdXJyZWRQaXhlbEI7CisgICAgICAgICAgICAgICAgaW50IEEgPSAoaW50KWJsdXJyZWRQaXhlbEE7CisKKyAgICAgICAgICAgICAgICBpbnRlcm1baCp3aWR0aCArIHddID0gKFIgPDwgMjQpIHwgKEcgPDwgMTYpIHwgKEIgPDwgOCkgfCAoQSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBmb3IoaCA9IDA7IGggPCBoZWlnaHQ7IGggKyspIHsKKyAgICAgICAgICAgIGZvcih3ID0gMDsgdyA8IHdpZHRoOyB3ICsrKSB7CisKKyAgICAgICAgICAgICAgICBibHVycmVkUGl4ZWxSID0gMC4wZjsKKyAgICAgICAgICAgICAgICBibHVycmVkUGl4ZWxHID0gMC4wZjsKKyAgICAgICAgICAgICAgICBibHVycmVkUGl4ZWxCID0gMC4wZjsKKyAgICAgICAgICAgICAgICBibHVycmVkUGl4ZWxBID0gMC4wZjsKKyAgICAgICAgICAgICAgICBmb3IociA9IC1yYWRpdXM7IHIgPD0gcmFkaXVzOyByICsrKSB7CisgICAgICAgICAgICAgICAgICAgIGludCB2YWxpZEggPSBoICsgcjsKKyAgICAgICAgICAgICAgICAgICAgLy8gQ2xhbXAgdG8gemVybyBhbmQgd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgaWYodmFsaWRIIDwgMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFsaWRIID0gMDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZih2YWxpZEggPiBoZWlnaHQgLSAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWxpZEggPSBoZWlnaHQgLSAxOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaW50IGlucHV0ID0gaW50ZXJtW3ZhbGlkSCp3aWR0aCArIHddOworCisgICAgICAgICAgICAgICAgICAgIGludCBSID0gKChpbnB1dCA+PiAyNCkgJiAweGZmKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IEcgPSAoKGlucHV0ID4+IDE2KSAmIDB4ZmYpOworICAgICAgICAgICAgICAgICAgICBpbnQgQiA9ICgoaW5wdXQgPj4gOCkgJiAweGZmKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IEEgPSAoaW5wdXQgJiAweGZmKTsKKworICAgICAgICAgICAgICAgICAgICBmbG9hdCB3ZWlnaHQgPSBnYXVzc2lhbltyICsgcmFkaXVzXTsKKworICAgICAgICAgICAgICAgICAgICBibHVycmVkUGl4ZWxSICs9IChmbG9hdCkoUikqd2VpZ2h0OworICAgICAgICAgICAgICAgICAgICBibHVycmVkUGl4ZWxHICs9IChmbG9hdCkoRykqd2VpZ2h0OworICAgICAgICAgICAgICAgICAgICBibHVycmVkUGl4ZWxCICs9IChmbG9hdCkoQikqd2VpZ2h0OworICAgICAgICAgICAgICAgICAgICBibHVycmVkUGl4ZWxBICs9IChmbG9hdCkoQSkqd2VpZ2h0OworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGludCBSID0gKGludClibHVycmVkUGl4ZWxSOworICAgICAgICAgICAgICAgIGludCBHID0gKGludClibHVycmVkUGl4ZWxHOworICAgICAgICAgICAgICAgIGludCBCID0gKGludClibHVycmVkUGl4ZWxCOworICAgICAgICAgICAgICAgIGludCBBID0gKGludClibHVycmVkUGl4ZWxBOworCisgICAgICAgICAgICAgICAgb3V0W2gqd2lkdGggKyB3XSA9IChSIDw8IDI0KSB8IChHIDw8IDE2KSB8IChCIDw8IDgpIHwgKEEpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKICAgICAgICAgdCA9IGphdmEubGFuZy5TeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSAtIHQ7CisgICAgICAgIGFuZHJvaWQudXRpbC5Mb2cudigiSW1nIiwgIkphdmEgZnJhbWUgdGltZSBtcyAiICsgdCk7CisgICAgICAgIG1CaXRtYXBPdXQuc2V0UGl4ZWxzKG91dCwgMCwgd2lkdGgsIDAsIDAsIHdpZHRoLCBoZWlnaHQpOworICAgICAgICByZXR1cm4gdDsKKyAgICB9CiAKLSAgICAgICAgYW5kcm9pZC51dGlsLkxvZy52KCJJbWciLCAiZnJhbWUgdGltZSBtcyAiICsgdCk7CisgICAgcHVibGljIHZvaWQgb25Qcm9ncmVzc0NoYW5nZWQoU2Vla0JhciBzZWVrQmFyLCBpbnQgcHJvZ3Jlc3MsIGJvb2xlYW4gZnJvbVVzZXIpIHsKKyAgICAgICAgaWYgKGZyb21Vc2VyKSB7CisKKyAgICAgICAgICAgIGlmKHNlZWtCYXIgPT0gbVJhZGl1c1NlZWtCYXIpIHsKKyAgICAgICAgICAgICAgICBmbG9hdCBmUmFkaXVzID0gcHJvZ3Jlc3MgLyAxMDAuMGY7CisgICAgICAgICAgICAgICAgZlJhZGl1cyAqPSAoZmxvYXQpKE1BWF9SQURJVVMpOworICAgICAgICAgICAgICAgIG1SYWRpdXMgPSAoaW50KWZSYWRpdXM7CisKKyAgICAgICAgICAgICAgICBtU2NyaXB0LnNldF9yYWRpdXMobVJhZGl1cyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKHNlZWtCYXIgPT0gbUluQmxhY2tTZWVrQmFyKSB7CisgICAgICAgICAgICAgICAgbUluQmxhY2sgPSAoZmxvYXQpcHJvZ3Jlc3M7CisgICAgICAgICAgICAgICAgbVNjcmlwdC5zZXRfaW5CbGFjayhtSW5CbGFjayk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKHNlZWtCYXIgPT0gbU91dEJsYWNrU2Vla0JhcikgeworICAgICAgICAgICAgICAgIG1PdXRCbGFjayA9IChmbG9hdClwcm9ncmVzczsKKyAgICAgICAgICAgICAgICBtU2NyaXB0LnNldF9vdXRCbGFjayhtT3V0QmxhY2spOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZihzZWVrQmFyID09IG1JbldoaXRlU2Vla0JhcikgeworICAgICAgICAgICAgICAgIG1JbldoaXRlID0gKGZsb2F0KXByb2dyZXNzICsgMTI3LjBmOworICAgICAgICAgICAgICAgIG1TY3JpcHQuc2V0X2luV2hpdGUobUluV2hpdGUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZihzZWVrQmFyID09IG1PdXRXaGl0ZVNlZWtCYXIpIHsKKyAgICAgICAgICAgICAgICBtT3V0V2hpdGUgPSAoZmxvYXQpcHJvZ3Jlc3MgKyAxMjcuMGY7CisgICAgICAgICAgICAgICAgbVNjcmlwdC5zZXRfb3V0V2hpdGUobU91dFdoaXRlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYoc2Vla0JhciA9PSBtR2FtbWFTZWVrQmFyKSB7CisgICAgICAgICAgICAgICAgbUdhbW1hID0gKGZsb2F0KXByb2dyZXNzLzEwMC4wZjsKKyAgICAgICAgICAgICAgICBtR2FtbWEgPSBNYXRoLm1heChtR2FtbWEsIDAuMWYpOworICAgICAgICAgICAgICAgIG1HYW1tYSA9IDEuMGYgLyBtR2FtbWE7CisgICAgICAgICAgICAgICAgbVNjcmlwdC5zZXRfZ2FtbWEobUdhbW1hKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYoc2Vla0JhciA9PSBtU2F0dXJhdGlvblNlZWtCYXIpIHsKKyAgICAgICAgICAgICAgICBtU2F0dXJhdGlvbiA9IChmbG9hdClwcm9ncmVzcyAvIDUwLjBmOworICAgICAgICAgICAgICAgIG1TY3JpcHQuc2V0X3NhdHVyYXRpb24obVNhdHVyYXRpb24pOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBsb25nIHQgPSBqYXZhLmxhbmcuU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCk7CisgICAgICAgICAgICBpZiAodHJ1ZSkgeworICAgICAgICAgICAgICAgIG1TY3JpcHQuaW52b2tlX2ZpbHRlcigpOworICAgICAgICAgICAgICAgIG1SUy5maW5pc2goKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgamF2YUZpbHRlcigpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB0ID0gamF2YS5sYW5nLlN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpIC0gdDsKKyAgICAgICAgICAgIGFuZHJvaWQudXRpbC5Mb2cudigiSW1nIiwgIlJlbmRlcnNjcmlwdCBmcmFtZSB0aW1lIGNvcmUgbXMgIiArIHQpOworCisgICAgICAgICAgICBtRGlzcGxheVZpZXcuaW52YWxpZGF0ZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgb25TdGFydFRyYWNraW5nVG91Y2goU2Vla0JhciBzZWVrQmFyKSB7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgb25TdG9wVHJhY2tpbmdUb3VjaChTZWVrQmFyIHNlZWtCYXIpIHsKICAgICB9CiAKICAgICBAT3ZlcnJpZGUKQEAgLTExOSw0NSArMzA5LDU0IEBACiAgICAgICAgIHN1c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zZXIpIHsKLSAgICAgICAgICAgICAgICAgICAgbVBhcmFtcy50aHJlc2hvbGQgPSBwcm9ncmVzcyAvIDEwMC4wZjsKLSAgICAgICAgICAgICAgICAgICAgbVBhcmFtc0FsbG9jYXRpb24uZGF0YShtUGFyYW1zKTsKKyAgICAgICAgbVJhZGl1c1NlZWtCYXIgPSAoU2Vla0JhcikgZmluZFZpZXdCeUlkKFIuaWQucmFkaXVzKTsKKyAgICAgICAgbVJhZGl1c1NlZWtCYXIuc2V0T25TZWVrQmFyQ2hhbmdlTGlzdGVuZXIodGhpcyk7CiAKLSAgICAgICAgICAgICAgICAgICAgaWYgKHRydWUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1JbnZva2FibGUuZXhlY3V0ZSgpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgamF2YUZpbHRlcigpOwotICAgICAgICAgICAgICAgICAgICAgICAgbUJpdG1hcC5zZXRQaXhlbHMobU91dERhdGEsIDAsIG1QYXJhbXMub3V0V2lkdGgsIDAsIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1QYXJhbXMub3V0V2lkdGgsIG1QYXJhbXMub3V0SGVpZ2h0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1EaXNwbGF5Vmlldy5pbnZhbGlkYXRlKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9CisgICAgICAgIG1JbkJsYWNrU2Vla0JhciA9IChTZWVrQmFyKWZpbmRWaWV3QnlJZChSLmlkLmluQmxhY2spOworICAgICAgICBtSW5CbGFja1NlZWtCYXIuc2V0T25TZWVrQmFyQ2hhbmdlTGlzdGVuZXIodGhpcyk7CisgICAgICAgIG1JbkJsYWNrU2Vla0Jhci5zZXRNYXgoMTI4KTsKKyAgICAgICAgbUluQmxhY2tTZWVrQmFyLnNldFByb2dyZXNzKDApOworICAgICAgICBtT3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W9uLCAyKTsKLQotICAgICAgICByZXR1cm4gaW52b2thYmxlOwotICAgIH0KLQotICAgIHByaXZhdGUgUGFyYW1zIGNyZWF0ZVBhcmFtcygpIHsKLSAgICAgICAgZmluYWwgUGFyYW1zIHBhcmFtcyA9IG5ldyBQYXJhbXMoKTsKLSAgICAgICAgcGFyYW1zLmluV2lkdGggPSBwYXJhbXMub3V0V2lkdGggPSBtQml0bWFwLmdldFdpZHRoKCk7Ci0gICAgICAgIHBhcmFtcy5pbkhlaWdodCA9IHBhcmFtcy5vdXRIZWlnaHQgPSBtQml0bWFwLmdldEhlaWdodCgpOwotICAgICAgICBwYXJhbXMudGhyZXNob2xkID0gMC41ZjsKLSAgICAgICAgcmV0dXJuIHBhcmFtczsKKyAgICAgICAgbVNjcmlwdC5iaW5kX0luUGl4ZWwobUluUGl4ZWxzQWxsb2NhdGlvbik7CisgICAgICAgIG1TY3JpcHQuYmluZF9PdXRQaXhlbChtT3V0UGl4ZWxzQWxsb2NhdGlvbik7CisgICAgICAgIG1TY3JpcHQuYmluZF9TY3JhdGNoUGl4ZWwobVNjcmF0Y2hQaXhlbHNBbGxvY2F0aW9uKTsKICAgICB9CiAKICAgICBwcml2YXRlIEJpdG1hcCBsb2FkQml0bWFwKGludCByZXNvdXJjZSkgewpAQCAtMjI5LDQgKzQwMywzMCBAQAogICAgICAgICBzb3VyY2UucmVjeWNsZSgpOwogICAgICAgICByZXR1cm4gYjsKICAgICB9CisKKyAgICAvLyBidXR0b24gaG9vaworICAgIHB1YmxpYyB2b2lkIGJlbmNobWFyayhWaWV3IHYpIHsKKyAgICAgICAgYW5kcm9pZC51dGlsLkxvZy52KCJJbWciLCAiQmVuY2htYXJraW5nIik7CisgICAgICAgIGludCBvbGRSYWRpdXMgPSBtUmFkaXVzOworICAgICAgICBtUmFkaXVzID0gTUFYX1JBRElVUzsKKyAgICAgICAgbVNjcmlwdC5zZXRfcmFkaXVzKG1SYWRpdXMpOworCisgICAgICAgIGxvbmcgdCA9IG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U2NyaXB0QyB7CisgICAgLy8gQ29uc3RydWN0b3IKKyAgICBwdWJsaWMgIFNjcmlwdENfVGhyZXNob2xkKFJlbmRlclNjcmlwdCBycywgUmVzb3VyY2VzIHJlc291cmNlcywgaW50IGlkLCBib29sZWFuIGlzUm9vdCkgeworICAgICAgICBzdXBlcihycywgcmVzb3VyY2VzLCBpZCwgaXNSb290KTsKKyAgICB9CisKKyAgICBwcml2YXRlIGZpbmFsIHN0YXRpYyBpbnQgbUV4cG9ydFZhcklkeF9oZWlnaHQgPSAwOworICAgIHByaXZhdGUgaW50IG1FeHBvcnRWYXJfaGVpZ2h0OworICAgIHB1YmxpYyB2b2lkIHNldF9oZWlnaHQoaW50IHYpIHsKKyAgICAgICAgbUV4cG9ydFZhcl9oZWlnaHQgPSB2OworICAgICAgICBzZXRWYXIobUV4cG9ydFZhcklkeF9oZWlnaHQsIHYpOworICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0X2hlaWdodCgpIHsKKyAgICAgICAgcmV0dXJuIG1FeHBvcnRWYXJfaGVpZ2h0OworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgc3RhdGljIGludCBtRXhwb3J0VmFySWR4X3dpZHRoID0gMTsKKyAgICBwcml2YXRlIGludCBtRXhwb3J0VmFyX3dpZHRoOworICAgIHB1YmxpYyB2b2lkIHNldF93aWR0aChpbnQgdikgeworICAgICAgICBtRXhwb3J0VmFyX3dpZHRoID0gdjsKKyAgICAgICAgc2V0VmFyKG1FeHBvcnRWYXJJZHhfd2lkdGgsIHYpOworICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0X3dpZHRoKCkgeworICAgICAgICByZXR1cm4gbUV4cG9ydFZhcl93aWR0aDsKKyAgICB9CisKKyAgICBwcml2YXRlIGZpbmFsIHN0YXRpYyBpbnQgbUV4cG9ydFZhcklkeF9yYWRpdXMgPSAyOworICAgIHByaXZhdGUgaW50IG1FeHBvcnRWYXJfcmFkaXVzOworICAgIHB1YmxpYyB2b2lk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clNjcmlwdEdMIG1SUzsKKyAgICBwcml2YXRlIFNhbXBsZXIgbVNhbXBsZXI7CisgICAgcHJpdmF0ZSBQcm9ncmFtU3RvcmUgbVBTQmFja2dyb3VuZDsKKyAgICBwcml2YXRlIFByb2dyYW1GcmFnbWVudCBtUEZCYWNrZ3JvdW5kOworICAgIHByaXZhdGUgUHJvZ3JhbVZlcnRleCBtUFZCYWNrZ3JvdW5kOworICAgIHByaXZhdGUgUHJvZ3JhbVZlcnRleC5NYXRyaXhBbGxvY2F0aW9uIG1QVkE7CisKKyAgICBwcml2YXRlIEFsbG9jYXRpb24gbUdyaWRJbWFnZTsKKyAgICBwcml2YXRlIEFsbG9jYXRpb24gbUFsbG9jUFY7CisKKyAgICBwcml2YXRlIFNpbXBsZU1lc2ggbU1lc2g7CisKKyAgICBwcml2YXRlIEZvbnQgbUl0YWxpYzsKKyAgICBwcml2YXRlIEFsbG9jYXRpb24gbVRleHRBbGxvYzsKKworICAgIHByaXZhdGUgU2NyaXB0Q19Nb2RlbHZpZXdlciBtU2NyaXB0OworCisgICAgaW50IG1MYXN0WDsKKyAgICBpbnQgbUxhc3RZOworCisgICAgcHVibGljIHZvaWQgdG91Y2hFdmVudChpbnQgeCwgaW50IHkpIHsKKyAgICAgICAgaW50IGR4ID0gbUxhc3RYIC0geDsKKyAgICAgICAgaWYoTWF0aC5hYnMoZHgpID4gNTAgfHwgTWF0aC5hYnMoZHgpIDwgMykgeworICAgICAgICAgICAgZHggPSAwOworICAgICAgICB9CisKKyAgICAgICAgbVJvdGF0aW9uIC09IGR4OworICAgICAgICBpZihtUm90YXRpb24gPiAzNjApIHsKKyAgICAgICAgICAgIG1Sb3RhdGlvbiAtPSAzNjA7CisgICAgICAgIH0KKyAgICAgICAgaWYobVJvdGF0aW9uIDwgMCkgeworICAgICAgICAgICAgbVJvdGF0aW9uICs9IDM2MDsKKyAgICAgICAgfQorCisgICAgICAgIG1TY3JpcHQuc2V0X2dSb3RhdGUoLShmbG9hdCltUm90YXRpb24pOworCisgICAgICAgIG1MYXN0WCA9IHg7CisgICAgICAgIG1MYXN0WSA9IHk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGluaXRQRlMoKSB7CisgICAgICAgIFByb2dyYW1TdG9yZS5CdWlsZGVyIGIgPSBuZXcgUHJvZ3JhbVN0b3JlLkJ1aWxkZXIobVJTLCBudWxsLCBudWxsKTsKKworICAgICAgICBiLnNldERlcHRoRnVuYyhQcm9ncmFtU3RvcmUuRGVwdGhGdW5jLkxFU1MpOworICAgICAgICBiLnNldERpdGhlckVuYWJsZShmYWxzZSk7CisgICAgICAgIGIuc2V0RGVwdGhNYXNrKHRydWUpOworICAgICAgICBtUFNCYWNrZ3JvdW5kID0gYi5jcmVhdGUoKTsKKworICAgICAgICBtU2NyaXB0LnNldF9nUEZTQmFja2dyb3VuZChtUFNCYWNrZ3JvdW5kKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgaW5pdFBGKCkgeworICAgICAgICBTYW1wbGVyLkJ1aWxkZXIgYnMgPSBuZXcgU2FtcGxlci5CdWlsZGVyKG1SUyk7CisgICAgICAgIGJzLnNldE1pbihTYW1wbGVyLlZhbHVlLkxJTkVBUik7CisgICAgICAgIGJzLnNldE1hZyhTYW1wbGVyLlZhbHVlLkxJTkVBUik7CisgICAgICAgIGJzLnNldFdyYXBTKFNhbXBsZXIuVmFsdWUuQ0xBTVApOworICAgICAgICBicy5zZXRXcmFwVChTYW1wbGVyLlZhbHVlLldSQVApOworICAgICAgICBtU2FtcGxlciA9IGJzLmNyZWF0ZSgpOworCisgICAgICAgIFByb2dyYW1GcmFnbWVudC5CdWlsZGVyIGIgPSBuZXcgUHJvZ3JhbUZyYWdtZW50LkJ1aWxkZXIobVJTKTsKKyAgICAgICAgYi5zZXRUZXh0dXJlKFByb2dyYW1GcmFnbWVudC5CdWlsZGVyLkVudk1vZGUuUkVQTEFDRSwKKyAgICAgICAgICAgICAgICAgICAgIFByb2dyYW1GcmFnbWVud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ICAgICAgU3RyaW5nIGFsbG9jU3RyaW5nID0gIkRpc3BsYXlpbmcgZmlsZTogUi5yYXcucm9ib3QiOworICAgICAgICBtVGV4dEFsbG9jID0gQWxsb2NhdGlvbi5jcmVhdGVGcm9tU3RyaW5nKG1SUywgYWxsb2NTdHJpbmcpOworICAgICAgICBtU2NyaXB0LnNldF9nVGV4dEFsbG9jKG1UZXh0QWxsb2MpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBpbml0UlMoKSB7CisKKyAgICAgICAgbVNjcmlwdCA9IG5ldyBTY3JpcHRDX01vZGVsdmlld2VyKG1SUywgbVJlcywgUi5yYXcubW9kZWx2aWV3ZXJfYmMsIHRydWUpOworCisgICAgICAgIGluaXRQRlMoKTsKKyAgICAgICAgaW5pdFBGKCk7CisgICAgICAgIGluaXRQVigpOworCisgICAgICAgIGxvYWRJbWFnZSgpOworCisgICAgICAgIEZpbGVBM0QgbW9kZWwgPSBGaWxlQTNELmNyZWF0ZUZyb21SZXNvdXJjZShtUlMsIG1SZXMsIFIucmF3LnJvYm90KTsKKyAgICAgICAgRmlsZUEzRC5JbmRleEVudHJ5IGVudHJ5ID0gbW9kZWwuZ2V0SW5kZXhFbnRyeSgwKTsKKyAgICAgICAgaWYoZW50cnkgPT0gbnVsbCB8fCBlbnRyeS5nZXRDbGFzc0lEKCkgIT0gRmlsZUEzRC5DbGFzc0lELlNJTVBMRV9NRVNIKSB7CisgICAgICAgICAgICBMb2cuZSgicnMiLCAiY291bGQgbm90IGxvYWQgbW9kZWwiKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgIG1NZXNoID0gKFNpbXBsZU1lc2gpZW50cnkuZ2V0T2JqZWN0KCk7CisgICAgICAgICAgICBtU2NyaXB0LnNldF9nVGVzdE1lc2gobU1lc2gpOworICAgICAgICB9CisKKyAgICAgICAgbUl0YWxpYyA9IEZvbnQuY3JlYXRlKG1SUywgbVJlcywgIkRyb2lkU2VyaWYtSXRhbGlj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ICszOSwxNSBAQAogaW1wb3J0IGFuZHJvaWQudmlldy5LZXlFdmVudDsKIGltcG9ydCBhbmRyb2lkLnZpZXcuTW90aW9uRXZlbnQ7CiAKLXB1YmxpYyBjbGFzcyBGaWxtVmlldyBleHRlbmRzIFJTU3VyZmFjZVZpZXcgeworcHVibGljIGNsYXNzIE1vZGVsVmlld2VyVmlldyBleHRlbmRzIFJTU3VyZmFjZVZpZXcgewogCi0gICAgcHVibGljIEZpbG1WaWV3KENvbnRleHQgY29udGV4dCkgeworICAgIHB1YmxpYyBNb2RlbFZpZXdlclZpZXcoQ29udGV4dCBjb250ZXh0KSB7CiAgICAgICAgIHN1cGVyKGNvbnRleHQpOwogICAgICAgICAvL3NldEZvY3VzYWJsZSh0cnVlKTsKICAgICB9CiAKICAgICBwcml2YXRlIFJlbmRlclNjcmlwdEdMIG1SUzsKLSAgICBwcml2YXRlIEZpbG1SUyBtUmVuZGVyOworICAgIHByaXZhdGUgTW9kZWxWaWV3ZXJSUyBtUmVuZGVyOwogCiAKICAgICBwdWJsaWMgdm9pZCBzdXJmYWNlQ2hhbmdlZChTdXJmYWNlSG9sZGVyIGhvbGRlciwgaW50IGZvcm1hdCwgaW50IHcsIGludCBoKSB7CkBAIC01NSw3ICs1NSw3IEBACiAgICAgICAgIGlmIChtUlMgPT0gbnVsbCkgewogICAgICAgICAgICAgbVJTID0gY3JlYXRlUmVuZGVyU2NyaXB0KHRydWUpOwogICAgICAgICAgICAgbVJTLmNvbnRleHRTZXRTdXJmYWNlKHcsIGgsIGhvbGRlci5nZXRTdXJmYWNlKCkpOwotICAgICAgICAgICAgbVJlbmRlciA9IG5ldyBGaWxtUlMoKTsKKyAgICAgICAgICAgIG1SZW5kZXIgPSBuZXcgTW9kZWxWaWV3ZXJSUygpOwogICAgICAgICAgICAgbVJlbmRlci5pbml0KG1SUywgZ2V0UmVzb3VyY2VzKCksIHcsIGgpOwogICAgICAgICB9CiAgICAgfQpAQCAtODUsNyArODUsOCBAQAogICAg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0JhY2tncm91bmQsICh2ID09IG51bGwpID8gMCA6IHYuZ2V0SUQoKSk7CisgICAgfQorCisgICAgcHVibGljIFByb2dyYW1TdG9yZSBnZXRfZ1BGU0JhY2tncm91bmQoKSB7CisgICAgICAgIHJldHVybiBtRXhwb3J0VmFyX2dQRlNCYWNrZ3JvdW5kOworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgc3RhdGljIGludCBtRXhwb3J0VmFySWR4X2dSb3RhdGUgPSA1OworICAgIHByaXZhdGUgZmxvYXQgbUV4cG9ydFZhcl9nUm90YXRlOworICAgIHB1YmxpYyB2b2lkIHNldF9nUm90YXRlKGZsb2F0IHYpIHsKKyAgICAgICAgbUV4cG9ydFZhcl9nUm90YXRlID0gdjsKKyAgICAgICAgc2V0VmFyKG1FeHBvcnRWYXJJZHhfZ1JvdGF0ZSwgdik7CisgICAgfQorCisgICAgcHVibGljIGZsb2F0IGdldF9nUm90YXRlKCkgeworICAgICAgICByZXR1cm4gbUV4cG9ydFZhcl9nUm90YXRlOworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgc3RhdGljIGludCBtRXhwb3J0VmFySWR4X2dJdGFsaWMgPSA2OworICAgIHByaXZhdGUgRm9udCBtRXhwb3J0VmFyX2dJdGFsaWM7CisgICAgcHVibGljIHZvaWQgc2V0X2dJdGFsaWMoRm9udCB2KSB7CisgICAgICAgIG1FeHBvcnRWYXJfZ0l0YWxpYyA9IHY7CisgICAgICAgIHNldFZhcihtRXhwb3J0VmFySWR4X2dJdGFsaWMsICh2ID09IG51bGwpID8gMCA6IHYuZ2V0SUQoKSk7CisgICAgfQorCisgICAgcHVibGljIEZvbnQgZ2V0X2dJdGFsaWMoKSB7CisgICAgICAgIHJldHVybiBtRXhwb3J0VmFyX2dJdGFsaWM7CisgICAgfQorCisgICAgcHJpdmF0ZSBmaW5hbCBzdGF0aWMgaW50IG1FeHBvcnRWYXJJZHhfZ1RleHRBbGxvYyA9IDc7CisgICAgcHJpdmF0ZSBBbGxv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klNQVRJT05fSU5URVJQT0xBVElPTl9TVEVQOworICAgIG1FZGdlUHJlID0gUlNfQU5JTUFUSU9OX0VER0VfVU5ERUZJTkVEOworICAgIG1FZGdlUG9zdCA9IFJTX0FOSU1BVElPTl9FREdFX1VOREVGSU5FRDsKKyAgICBtSW5wdXRNaW4gPSAwOworICAgIG1JbnB1dE1heCA9IDA7Cit9CisKK0FuaW1hdGlvbiAqIEFuaW1hdGlvbjo6Y3JlYXRlKENvbnRleHQgKnJzYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGZsb2F0ICppblZhbHVlcywgY29uc3QgZmxvYXQgKm91dFZhbHVlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHZhbHVlQ291bnQsIFJzQW5pbWF0aW9uSW50ZXJwb2xhdGlvbiBpbnRlcnAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSc0FuaW1hdGlvbkVkZ2UgcHJlLCBSc0FuaW1hdGlvbkVkZ2UgcG9zdCkKK3sKKyAgICBpZiAodmFsdWVDb3VudCA8IDIpIHsKKyAgICAgICAgcnNjLT5zZXRFcnJvcihSU19FUlJPUl9CQURfVkFMVUUsICJBbmltYXRpb25zIHJlcXVpcmUgbW9yZSB0aGFuIDIgdmFsdWVzLiIpOworICAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisgICAgQW5pbWF0aW9uICphID0gbmV3IEFuaW1hdGlvbihyc2MpOworICAgIGlmICghYSkgeworICAgICAgICByc2MtPnNldEVycm9yKFJTX0VSUk9SX09VVF9PRl9NRU1PUlkpOworICAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisKKyAgICBmbG9hdCAqdmluID0gKGZsb2F0ICopbWFsbG9jKHZhbHVlQ291bnQgKiBzaXplb2YoZmxvYXQpKTsKKyAgICBmbG9hdCAqdm91dCA9IChmbG9hdCAqKW1hbGxvYyh2YWx1ZUNvdW50ICogc2l6ZW9mKGZsb2F0KSk7Cis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gICAgIH0KKyAgICB9CisKKyAgICB3aGlsZSAoMSkgeworICAgICAgICBib29sIGNoYW5nZWQgPSBmYWxzZTsKKyAgICAgICAgZm9yICh1aW50MzJfdCBjdD0xOyBjdCA8IHZhbHVlQ291bnQ7IGN0KyspIHsKKyAgICAgICAgICAgIGlmICh2aW5bY3QtMV0gPiB2aW5bY3RdKSB7CisgICAgICAgICAgICAgICAgZmxvYXQgdCA9IHZpbltjdC0xXTsKKyAgICAgICAgICAgICAgICB2aW5bY3QtMV0gPSB2aW5bY3RdOworICAgICAgICAgICAgICAgIHZpbltjdF0gPSB0OworICAgICAgICAgICAgICAgIHQgPSB2b3V0W2N0LTFdOworICAgICAgICAgICAgICAgIHZvdXRbY3QtMV0gPSB2b3V0W2N0XTsKKyAgICAgICAgICAgICAgICB2b3V0W2N0XSA9IHQ7CisgICAgICAgICAgICAgICAgY2hhbmdlZCA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYgKCFjaGFuZ2VkKSBicmVhazsKKyAgICB9CisKKyAgICByZXR1cm4gYTsKK30KKyovCisKKworLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KKy8vCisKK25hbWVzcGFjZSBhbmRyb2lkIHsKK25hbWVzcGFjZSByZW5kZXJzY3JpcHQgeworCitSc0FuaW1hdGlvbiByc2lfQW5pbWF0aW9uQ3JlYXRlKENvbnRleHQgKnJzYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZmxvYXQgKmluVmFsdWVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBmbG9hdCAqb3V0VmFsdWVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCB2YWx1ZUNvdW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSc0FuaW1hdGlvbkludGVycG9sYXRpb24gaW50ZXJwLAorICAgICAgICAgICAgIC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guaW5pdChyc2MsIHJzYy0+bUVHTC5tV2lkdGgsIHJzYy0+bUVHTC5tSGVpZ2h0KTsKKyAgICAgICAgIHJzYy0+bVN0YXRlVmVydGV4LmluaXQocnNjKTsKICAgICAgICAgIHJzYy0+c2V0VmVydGV4KE5VTEwpOwotICAgICAgICAgcnNjLT5tU3RhdGVGcmFnbWVudC5pbml0KHJzYywgcnNjLT5tRUdMLm1XaWR0aCwgcnNjLT5tRUdMLm1IZWlnaHQpOworICAgICAgICAgcnNjLT5tU3RhdGVGcmFnbWVudC5pbml0KHJzYyk7CiAgICAgICAgICByc2MtPnNldEZyYWdtZW50KE5VTEwpOwotICAgICAgICAgcnNjLT5tU3RhdGVGcmFnbWVudFN0b3JlLmluaXQocnNjLCByc2MtPm1FR0wubVdpZHRoLCByc2MtPm1FR0wubUhlaWdodCk7CisgICAgICAgICByc2MtPm1TdGF0ZUZyYWdtZW50U3RvcmUuaW5pdChyc2MpOwogICAgICAgICAgcnNjLT5zZXRGcmFnbWVudFN0b3JlKE5VTEwpOworICAgICAgICAgcnNjLT5tU3RhdGVGb250LmluaXQocnNjKTsKKyAgICAgICAgIHJzYy0+c2V0Rm9udChOVUxMKTsKICAgICAgICAgIHJzYy0+bVN0YXRlVmVydGV4QXJyYXkuaW5pdChyc2MpOwogICAgICB9CiAKQEAgLTM0NiwxMSArMzMyLDEzIEBACiAgICAgICAgICByc2MtPm1GcmFnbWVudC5jbGVhcigpOwogICAgICAgICAgcnNjLT5tVmVydGV4LmNsZWFyKCk7CiAgICAgICAgICByc2MtPm1GcmFnbWVudFN0b3JlLmNsZWFyKCk7CisgICAgICAgICByc2MtPm1Gb250LmNsZWFyKCk7CiAgICAgICAgICByc2MtPm1Sb290U2NyaXB0LmNsZWFyKCk7CiAgICAgICAgICByc2MtPm1TdGF0ZVJhc3Rlci5kZWluaXQocnNjKTsKICAgICAgICAgIHJzYy0+bVN0YXRlVmVydGV4LmRlaW5pdChyc2MpOwogICAgICAgICAgcnNjLT5tU3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JlICogZ2V0RGVmYXVsdFByb2dyYW1TdG9yZSgpIGNvbnN0IHsKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorICAgIFByb2dyYW1SYXN0ZXIgKiBnZXREZWZhdWx0UHJvZ3JhbVJhc3RlcigpIGNvbnN0IHsKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorCisgICAgdWludDMyX3QgZ2V0V2lkdGgoKSBjb25zdCB7cmV0dXJuIDA7fQorICAgIHVpbnQzMl90IGdldEhlaWdodCgpIGNvbnN0IHtyZXR1cm4gMDt9CisKKyAgICAvLyBUaW1lcnMKKyAgICBlbnVtIFRpbWVycyB7CisgICAgICAgIFJTX1RJTUVSX0lETEUsCisgICAgICAgIFJTX1RJTUVSX0lOVEVSTkFMLAorICAgICAgICBSU19USU1FUl9TQ1JJUFQsCisgICAgICAgIFJTX1RJTUVSX0NMRUFSX1NXQVAsCisgICAgICAgIF9SU19USU1FUl9UT1RBTAorICAgIH07CisKKyAgICBib29sIGNoZWNrVmVyc2lvbjFfMSgpIGNvbnN0IHtyZXR1cm4gZmFsc2U7IH0KKyAgICBib29sIGNoZWNrVmVyc2lvbjJfMCgpIGNvbnN0IHtyZXR1cm4gZmFsc2U7IH0KKworICAgIHN0cnVjdCB7CisgICAgICAgIGJvb2wgbUxvZ1RpbWVzOworICAgICAgICBib29sIG1Mb2dTY3JpcHRzOworICAgICAgICBib29sIG1Mb2dPYmplY3RzOworICAgICAgICBib29sIG1Mb2dTaGFkZXJzOworICAgIH0gcHJvcHM7CisKKyAgICB2b2lkIGR1bXBEZWJ1ZygpIGNvbnN0IHsgICAgfQorICAgIHZvaWQgY2hlY2tFcnJvcihjb25zdCBjaGFyICopIGNvbnN0IHsgIH07CisgICAgdm9pZCBzZXRFcnJvcihSc0Vycm9yIGUsIGNvbnN0IGNoYXIgKm1zZyA9IE5VTEwpIHsgIH0KKworICAgIG11dGFibGUgY29uc3QgT2JqZWN0QmFzZSAqIG1PYmpIZWFkOworCis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mc4IG5hbWU7CisgICAgc3RyZWFtLT5sb2FkU3RyaW5nKCZuYW1lKTsKKworICAgIEVsZW1lbnQgKmVsZW0gPSBuZXcgRWxlbWVudChyc2MpOworICAgIGVsZW0tPm1Db21wb25lbnQubG9hZEZyb21TdHJlYW0oc3RyZWFtKTsKKyAgICBlbGVtLT5tQml0cyA9IGVsZW0tPm1Db21wb25lbnQuZ2V0Qml0cygpOworCisgICAgZWxlbS0+bUZpZWxkQ291bnQgPSBzdHJlYW0tPmxvYWRVMzIoKTsKKyAgICBpZihlbGVtLT5tRmllbGRDb3VudCkgeworICAgICAgICBlbGVtLT5tRmllbGRzID0gbmV3IEVsZW1lbnRGaWVsZF90IFtlbGVtLT5tRmllbGRDb3VudF07CisgICAgICAgIGZvcih1aW50MzJfdCBjdCA9IDA7IGN0IDwgZWxlbS0+bUZpZWxkQ291bnQ7IGN0ICsrKSB7CisgICAgICAgICAgICBzdHJlYW0tPmxvYWRTdHJpbmcoJmVsZW0tPm1GaWVsZHNbY3RdLm5hbWUpOworICAgICAgICAgICAgRWxlbWVudCAqZmllbGRFbGVtID0gRWxlbWVudDo6Y3JlYXRlRnJvbVN0cmVhbShyc2MsIHN0cmVhbSk7CisgICAgICAgICAgICBlbGVtLT5tRmllbGRzW2N0XS5lLnNldChmaWVsZEVsZW0pOworICAgICAgICB9CisgICAgfQorCisgICAgLy8gV2UgbmVlZCB0byBjaGVjayBpZiB0aGlzIGFscmVhZHkgZXhpc3RzCisgICAgZm9yICh1aW50MzJfdCBjdD0wOyBjdCA8IHJzYy0+bVN0YXRlRWxlbWVudC5tRWxlbWVudHMuc2l6ZSgpOyBjdCsrKSB7CisgICAgICAgIEVsZW1lbnQgKmVlID0gcnNjLT5tU3RhdGVFbGVtZW50Lm1FbGVtZW50c1tjdF07CisKKyAgICAgICAgaWYgKCFlZS0+Z2V0RmllbGRDb3VudCgpICkgeworCisgICAgICAgICAgICBpZigoZWUtPmdldENvbXBvbmVudCgpLmdldFR5cGUoKSA9PSBlbGVtLT5nZXRDb21wb25lbnQoKS5nZXRUeXBlKCkpICYmCisgICAgICAgICAgICAgICAoZWUtPmdldENvbXBvbmVudCgpLmdldEtpbmQoKSA9PSBlbGVtLT5nZXRDb21wb25lbnQoKS5nZXRLaW5kKCkpICYmCisgICAgICAgICAgICAgICAoZWUtPmdldENvbXBvbmVudCgpLmdldElzTm9ybWFsaXplZCgpID09IGVsZW0tPmdldENvbXBvbmVudCgpLmdldElzTm9ybWFsaXplZCgpKSAmJgorICAgICAgICAgICAgICAgKGVlLT5nZXRDb21wb25lbnQoKS5nZXRWZWN0b3JTaXplKCkgPT0gZWxlbS0+Z2V0Q29tcG9uZW50KCkuZ2V0VmVjdG9yU2l6ZSgpKSkgeworICAgICAgICAgICAgICAgIC8vIE1hdGNoCisgICAgICAgICAgICAgICAgZGVsZXRlIGVsZW07CisgICAgICAgICAgICAgICAgZWUtPmluY1VzZXJSZWYoKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gZWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgfSBlbHNlIGlmIChlZS0+Z2V0RmllbGRDb3VudCgpID09IGVsZW0tPm1GaWVsZENvdW50KSB7CisKKyAgICAgICAgICAgIGJvb2wgbWF0Y2ggPSB0cnVlOworICAgICAgICAgICAgZm9yICh1aW50MzJfdCBpPTA7IGkgPCBlbGVtLT5tRmllbGRDb3VudDsgaSsrKSB7CisgICAgICAgICAgICAgICAgaWYgKChlZS0+bUZpZWxkc1tpXS5lLmdldCgpICE9IGVsZW0tPm1GaWVsZHNbaV0uZS5nZXQoKSkgfHwKKyAgICAgICAgICAgICAgICAgICAgKGVlLT5tRmllbGRzW2ldLm5hbWUubGVuZ3RoKCkgIT0gZWxlbS0+bUZpZWxkc1tpXS5uYW1lLmxlbmd0aCgpKSB8fAorICAgICAgICAgICAgICAgICAgICAoZWUtPm1GaWVsZHNbaV0ubmFtZSAhPSBlbGVtLT5tRmllbGRzW2ldLm5hbWUpKSB7CisgICAgICAgICAgICAgICAgICAgIG1hdGNoID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtYXRjaCkgeworICAgICAgICAgICAgICAgIGRlbGV0ZSBlbGVtOworICAgICAgICAgICAgICAgIGVlLT5pbmNVc2VyUmVmKCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGVlOworICAgICAgICAgICAgfQorCisgICAgICAgIH0KKyAgICB9CisKKyAgICByc2MtPm1TdGF0ZUVsZW1lbnQubUVsZW1lbnRzLnB1c2goZWxlbSk7CisgICAgcmV0dXJuIGVsZW07Cit9CisKIAogY29uc3QgRWxlbWVudCAqIEVsZW1lbnQ6OmNyZWF0ZShDb250ZXh0ICpyc2MsIFJzRGF0YVR5cGUgZHQsIFJzRGF0YUtpbmQgZGssCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBpc05vcm0sIHVpbnQzMl90IHZlY1NpemUpCkBAIC0xNDMsNDUgKzIzMiw2IEBACiAgICAgcmV0dXJuIGU7CiB9CiAKLVN0cmluZzggRWxlbWVudDo6Z2V0Q1N0cnVjdEJvZHkodWludDMyX3QgaW5kZW50KSBjb25zdAotewotICAgIFN0cmluZzggc2k7Ci0gICAgZm9yICh1aW50MzJfdCBjdD0wOyBjdCA8IGluZGVudDsgY3QrKykgewotICAgICAgICBzaS5hcHBlbmQoIiAiKTsKLSAgICB9Ci0KLSAgICBTdHJpbmc4IHMoc2kpOwotICAgIHMuYXBwZW5kKCJ7XG4iKTsKLSAgICBmb3IgKHVpbnQzMl90IGN0ID0gMDsgY3QgPCBtRmllbGRDb3VudDsgY3QrKykgewotICAgICAgICBzLmFwcGVuZChzaSk7Ci0gICAgICAgIHMuYXBwZW5kKG1GaWVsZHNbY3RdLmUtPmdldENUeXBlKGluZGVudCs0KSk7Ci0gICAgICAgIHMuYXBwZW5kKCIgIik7Ci0gICAgICAgIHMuYXBwZW5kKG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IGZhbHNlOworICAgIH0KKworICAgIC8vIFJlYWQgdGhlIHNpemUgb2YgdGhlIGRhdGEKKyAgICBtZW1jcHkoJm1EYXRhU2l6ZSwgbG9jYWxEYXRhLCBzaXplb2YobURhdGFTaXplKSk7CisgICAgbG9jYWxEYXRhICs9IHNpemVvZihtRGF0YVNpemUpOworICAgIGxlbmd0aFJlbWFpbmluZyAtPSBzaXplb2YobURhdGFTaXplKTsKKworICAgIExPR0UoIkxvYWRpbmcgZGF0YSwgbURhdGFTaXplID0gJWxsaSIsIG1EYXRhU2l6ZSk7CisKKyAgICBpZihsZW5ndGhSZW1haW5pbmcgPCBtRGF0YVNpemUpIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIC8vIFdlIHNob3VsZCBrbm93IGVub3VnaCB0byByZWFkIHRoZSBmaWxlIGluIGF0IHRoaXMgcG9pbnQuCisgICAgbUFsbG9jID0gbWFsbG9jKG1EYXRhU2l6ZSk7CisgICAgaWYgKCFtQWxsb2MpIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKyAgICBtRGF0YSA9ICh1aW50OF90ICopbUFsbG9jOworICAgIG1lbWNweShtQWxsb2MsIGxvY2FsRGF0YSwgbURhdGFTaXplKTsKKworICAgIG1SZWFkU3RyZWFtID0gbmV3IElTdHJlYW0obURhdGEsIG1Vc2U2NEJpdE9mZnNldHMpOworCisgICAgcmV0dXJuIHRydWU7Cit9CisKK2Jvb2wgRmlsZUEzRDo6bG9hZChGSUxFICpmKQogewogICAgIGNoYXIgbWFnaWNTdHJpbmdbMTJdOwogICAgIHNpemVfdCBsZW47CkBAIC00OSw0NyArMTc2LDM5IEBACiAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICB9CiAKLSAgICBMT0dFKCJmaWxlIG9wZW4gMiIpOwotICAgIGxlbiA9IGZyZWFkKCZtTWFqb3JWZXJzaW9uLCAxLCBzaXplb2YobU1ham9yVmVyc2lvbiksIGYpOwotICAgIGlmICh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RleFt2ZXJ0SWR4XS5tUnNPYmo7Ci0KLSAgICBwLT5tSW5kaWNpZXMgPSBuZXcgdWludDE2X3RbcC0+bUluZGV4Q291bnRdOwotICAgIGZvciAodWludDMyX3QgY3QgPSAwOyBjdCA8IHAtPm1JbmRleENvdW50OyBjdCsrKSB7Ci0gICAgICAgIHN3aXRjaChiaXRzKSB7Ci0gICAgICAgIGNhc2UgODoKLSAgICAgICAgICAgIHAtPm1JbmRpY2llc1tjdF0gPSBpby0+bG9hZFU4KCk7CisgICAgLy8gU2VlayB0byB0aGUgYmVnaW5uaW5nIG9mIG9iamVjdAorICAgIG1SZWFkU3RyZWFtLT5yZXNldChlbnRyeS0+bU9mZnNldCk7CisgICAgc3dpdGNoIChlbnRyeS0+bVR5cGUpIHsKKyAgICAgICAgY2FzZSBSU19BM0RfQ0xBU1NfSURfVU5LTk9XTjoKKyAgICAgICAgICAgIHJldHVybiBOVUxMOworICAgICAgICBjYXNlIFJTX0EzRF9DTEFTU19JRF9NRVNIOgorICAgICAgICAgICAgZW50cnktPm1Sc09iaiA9IE1lc2g6OmNyZWF0ZUZyb21TdHJlYW0obVJTQywgbVJlYWRTdHJlYW0pOwogICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgMTY6Ci0gICAgICAgICAgICBwLT5tSW5kaWNpZXNbY3RdID0gaW8tPmxvYWRVMTYoKTsKKyAgICAgICAgY2FzZSBSU19BM0RfQ0xBU1NfSURfU0lNUExFX01FU0g6CisgICAgICAgICAgICBlbnRyeS0+bVJzT2JqID0gU2ltcGxlTWVzaDo6Y3JlYXRlRnJvbVN0cmVhbShtUlNDLCBtUmVhZFN0cmVhbSk7CiAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSAzMjoKLSAgICAgICAgICAgIHAtPm1JbmRpY2llc1tjdF0gPSBpby0+bG9hZFUzMigpOworICAgICAgICBjYXNlIFJTX0EzRF9DTEFTU19JRF9UWVBFOgorICAgICAgICAgICAgZW50cnktPm1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SRToKKyAgICAgICAgICAgIGVudHJ5LT5tUnNPYmogPSBQcm9ncmFtU3RvcmU6OmNyZWF0ZUZyb21TdHJlYW0obVJTQywgbVJlYWRTdHJlYW0pOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgUlNfQTNEX0NMQVNTX0lEX1NBTVBMRVI6CisgICAgICAgICAgICBlbnRyeS0+bVJzT2JqID0gU2FtcGxlcjo6Y3JlYXRlRnJvbVN0cmVhbShtUlNDLCBtUmVhZFN0cmVhbSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBSU19BM0RfQ0xBU1NfSURfQU5JTUFUSU9OOgorICAgICAgICAgICAgZW50cnktPm1Sc09iaiA9IEFuaW1hdGlvbjo6Y3JlYXRlRnJvbVN0cmVhbShtUlNDLCBtUmVhZFN0cmVhbSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBSU19BM0RfQ0xBU1NfSURfTElHSFQ6CisgICAgICAgICAgICBlbnRyeS0+bVJzT2JqID0gTGlnaHQ6OmNyZWF0ZUZyb21TdHJlYW0obVJTQywgbVJlYWRTdHJlYW0pOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgUlNfQTNEX0NMQVNTX0lEX0FEQVBURVJfMUQ6CisgICAgICAgICAgICBlbnRyeS0+bVJzT2JqID0gQWRhcHRlcjFEOjpjcmVhdGVGcm9tU3RyZWFtKG1SU0MsIG1SZWFkU3RyZWFtKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIFJTX0EzRF9DTEFTU19JRF9BREFQVEVSXzJEOgorICAgICAgICAgICAgZW50cnktPm1Sc09iaiA9IEFkYXB0ZXIyRDo6Y3JlYXRlRnJvbVN0cmVhbShtUlNDLCBtUmVhZFN0cmVhbSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBSU19BM0RfQ0xBU1NfSURfU0NSSVBUX0M6CisgICAgICAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisgICAgaWYoZW50cnktPm1Sc09iaikgeworICAgICAgICBlbnRyeS0+bVJzT2JqLT5pbmNVc2VyUmVmKCk7CisgICAgfQorICAgIHJldHVybiBlbnRyeS0+bVJzT2JqOworfQorCitib29sIEZpbGVBM0Q6OndyaXRlRmlsZShjb25zdCBjaGFyICpmaWxlbmFtZSkKK3sKKyAgICBpZighbVdyaXRlU3RyZWFtKSB7CisgICAgICAgIExPR0UoIk5vIG9iamVjdHMgdG8gd3JpdGVcbiIpOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorICAgIGlmKG1Xcml0ZVN0cmVhbS0+Z2V0UG9zKCkgPT0gMCkgeworICAgICAgICBMT0dFKCJObyBvYmplY3RzIHRvIHdyaXRlXG4iKTsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIEZJTEUgKndyaXRlSGFuZGxlID0gZm9wZW4oZmlsZW5hbWUsICJ3YiIpOworICAgIGlmKCF3cml0ZUhhbmRsZSkgeworICAgICAgICBMT0dFKCJDb3VsZG4ndCBvcGVuIHRoZSBmaWxlIGZvciB3cml0aW5nXG4iKTsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIC8vIE9wZW4gYSBuZXcgc3RyZWFtIHRvIG1ha2Ugd3JpdGluZyB0aGUgaGVhZGVyIGVhc2llcgorICAgIE9TdHJlYW0gaGVhZGVyU3RyZWFtKDUqMTAyNCwgZmFsc2UpOworICAgIGhlYWRlclN0cmVhbS5hZGRVMzIobU1ham9yVmVyc2lvbik7CisgICAgaGVhZGVyU3RyZWFtLmFkZFUzMihtTWlub3JWZXJzaW9uKTsKKyAgICB1aW50MzJfdCBpczY0Qml0ID0gMDsKKyAgICBoZWFkZXJTdHJlYW0uYWRkVTMyKGlzNjRCaXQpOworCisgICAgdWludDMyX3Qgd3JpdGVJbmRleFNpemUgPSBtV3JpdGVJbmRleC5zaXplKCk7CisgICAgaGVhZGVyU3RyZWFtLmFk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ibGVPZmZzZXQ7CiAgICAgYm9vbCBtVXNlNjRCaXRPZmZzZXRzOwogCi0gICAgc3RydWN0IEEzREluZGV4RW50cnkgewotICAgICAgICBTdHJpbmc4IG1JRDsKLSAgICAgICAgQTNEQ2h1bmtUeXBlIG1UeXBlOworICAgIGNsYXNzIEEzREluZGV4RW50cnkgeworICAgICAgICBTdHJpbmc4IG1PYmplY3ROYW1lOworICAgICAgICBSc0EzRENsYXNzSUQgbVR5cGU7CiAgICAgICAgIHVpbnQ2NF90IG1PZmZzZXQ7Ci0gICAgICAgIHZvaWQgKiBtUnNPYmo7CisgICAgICAgIHVpbnQ2NF90IG1MZW5ndGg7CisgICAgICAgIE9iamVjdEJhc2UgKm1Sc09iajsKKyAgICBwdWJsaWM6CisgICAgICAgIGZyaWVuZCBjbGFzcyBGaWxlQTNEOworICAgICAgICBjb25zdCBTdHJpbmc4ICZnZXRPYmplY3ROYW1lKCkgY29uc3QgeworICAgICAgICAgICAgcmV0dXJuIG1PYmplY3ROYW1lOworICAgICAgICB9CisgICAgICAgIFJzQTNEQ2xhc3NJRCBnZXRUeXBlKCkgY29uc3QgeworICAgICAgICAgICAgcmV0dXJuIG1UeXBlOworICAgICAgICB9CiAgICAgfTsKIAotICAgIGJvb2wgbG9hZChDb250ZXh0ICpyc2MsIEZJTEUgKmYpOworICAgIGJvb2wgbG9hZChGSUxFICpmKTsKKyAgICBib29sIGxvYWQoY29uc3Qgdm9pZCAqZGF0YSwgc2l6ZV90IGxlbmd0aCk7CisKKyAgICBzaXplX3QgZ2V0TnVtSW5kZXhFbnRyaWVzKCkgY29uc3Q7CisgICAgY29uc3QgQTNESW5kZXhFbnRyeSogZ2V0SW5kZXhFbnRyeShzaXplX3QgaW5kZXgpIGNvbnN0OworICAgIE9iamVjdEJhc2UgKmluaXRpYWxpemVGcm9tRW50cnkoc2l6ZV90IGluZGV4KTsKKworICAgIHZvaWQgYXBwZW5kVG9GaWxlKE9iamVjdEJhc2UgKm9iaik7CisgICAgYm9vbCB3cml0ZUZpbGUoY29uc3QgY2hhciAqZmlsZW5hbWUpOworCisgICAgLy8gQ3VycmVudGx5IGZpbGVzIGRvIG5vdCBnZXQgc2VyaWFsaXplZCwKKyAgICAvLyBidXQgd2UgbmVlZCB0byBpbmhlcml0IGZyb20gT2JqZWN0QmFzZSBmb3IgcmVmIHRyYWNraW5nCisgICAgdmlydHVhbCB2b2lkIHNlcmlhbGl6ZShPU3RyZWFtICpzdHJlYW0pIGNvbnN0IHsKKyAgICB9CisgICAgdmlydHVhbCBSc0EzRENsYXNzSUQgZ2V0Q2xhc3NJZCgpIGNvbnN0IHsKKyAgICAgICAgcmV0dXJuIFJTX0EzRF9DTEFTU19JRF9VTktOT1dOOworICAgIH0KIAogcHJvdGVjdGVkOgotICAgIGNsYXNzIElPCi0gICAgewotICAgIHB1YmxpYzoKLSAgICAgICAgSU8oY29uc3QgdWludDhfdCAqLCBib29sIHVzZTY0KTsKLSAgICAKLSAgICAgICAgZmxvYXQgbG9hZEYoKSB7Ci0gICAgICAgICAgICBtUG9zID0gKG1Qb3MgKyAzKSAmICh+Myk7Ci0gICAgICAgICAgICBmbG9hdCB0bXAgPSByZWludGVycHJldF9jYXN0PGNvbnN0IGZsb2F0ICo+KCZtRGF0YVttUG9zXSlbMF07Ci0gICAgICAgICAgICBtUG9zICs9IHNpemVvZihmbG9hdCk7Ci0gICAgICAgICAgICByZXR1cm4gdG1wOwotICAgICAgICB9Ci0gICAgICAgIGludDMyX3QgbG9hZEkzMigpIHsKLSAgICAgICAgICAgIG1Qb3MgPSAobVBvcyArIDMpICYgKH4zKTsKLSAgICAgICAgICAgIGludDMyX3QgdG1wID0gcmVpbnRlcnByZXRfY2FzdDxjb25zdCBpbnQzMl90ICo+KCZtRGF0YVttUG9zXSlbMF07Ci0gICAgICAgICAgICBtUG9zICs9IHNpemVvZihpbnQzMl90KTsKLSAgICAgICAgICAgIHJldHVybiB0bXA7Ci0gICAgICAgIH0KLSAgICAgICAgdWludDMyX3Qgb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YWNoZWRHbHlwaEluZm8gKmdseXBoLCBpbnQgeCwgaW50IHkpCit7CisgICAgRm9udFN0YXRlICpzdGF0ZSA9ICZtUlNDLT5tU3RhdGVGb250OworCisgICAgaW50IG5QZW5YID0geCArIGdseXBoLT5tQml0bWFwTGVmdDsKKyAgICBpbnQgblBlblkgPSB5IC0gZ2x5cGgtPm1CaXRtYXBUb3AgKyBnbHlwaC0+bUJpdG1hcEhlaWdodDsKKworICAgIHN0YXRlLT5hcHBlbmRNZXNoUXVhZChuUGVuWCwgblBlblksIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPm1CaXRtYXBNaW5VLCBnbHlwaC0+bUJpdG1hcE1heFYsCisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuUGVuWCArIChpbnQpZ2x5cGgtPm1CaXRtYXBXaWR0aCwgblBlblksIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPm1CaXRtYXBNYXhVLCBnbHlwaC0+bUJpdG1hcE1heFYsCisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuUGVuWCArIChpbnQpZ2x5cGgtPm1CaXRtYXBXaWR0aCwgblBlblkgLSAoaW50KWdseXBoLT5tQml0bWFwSGVpZ2h0LCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT5tQml0bWFwTWF4VSwgZ2x5cGgtPm1CaXRtYXBNaW5WLAorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgblBlblgsIG5QZW5ZIC0gKGludClnbHlwaC0+bUJpdG1hcEhlaWdodCwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaC0+bUJpdG1hcE1pblUsIGdseXBoLT5tQml0bWFwTWluVik7Cit9CisKK3ZvaWQgRm9udDo6cmVuZGVyVVRGKGNvbnN0IGNoYXIgKnRleHQsIHVpbnQzMl90IGxlbiwgdWludDMyX3Qgc3RhcnQsIGludCBudW1HbHlwaHMsIGludCB4LCBpbnQgeSkKK3sKKyAgICBpZighbUluaXRpYWxpemVkIHx8IG51bUdseXBocyA9PSAwIHx8IHRleHQgPT0gTlVMTCB8fCBsZW4gPT0gMCkgeworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaW50IHBlblggPSB4LCBwZW5ZID0geTsKKyAgICBpbnQgZ2x5cGhzTGVmdCA9IDE7CisgICAgaWYobnVtR2x5cGhzID4gMCkgeworICAgICAgICBnbHlwaHNMZWZ0ID0gbnVtR2x5cGhzOworICAgIH0KKworICAgIHNpemVfdCBpbmRleCA9IHN0YXJ0OworICAgIHNpemVfdCBuZXh0SW5kZXggPSAwOworCisgICAgd2hpbGUgKGdseXBoc0xlZnQgPiAwKSB7CisKKyAgICAgICAgaW50MzJfdCB1dGZDaGFyID0gdXRmMzJfYXQodGV4dCwgbGVuLCBpbmRleCwgJm5leHRJbmRleCk7CisKKyAgICAgICAgLy8gUmVhY2hlZCB0aGUgZW5kIG9mIHRoZSBzdHJpbmcgb3IgZW5jb3VudGVyZWQKKyAgICAgICAgaWYodXRmQ2hhciA8IDApIHsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgLy8gTW92ZSB0byB0aGUgbmV4dCBjaGFyYWN0ZXIgaW4gdGhlIGFycmF5CisgICAgICAgIGluZGV4ID0gbmV4dEluZGV4OworCisgICAgICAgIENhY2hlZEdseXBoSW5mbyAqY2FjaGVkR2x5cGggPSBtQ2FjaGVkR2x5cGhzLnZhbHVlRm9yKCh1aW50MzJfdCl1dGZDaGFyKTsKKworICAgICAgICBpZihjYWNoZWRHbHlwaCA9PSBOVUxMKSB7CisgICAgICAgICAgICBjYWNoZWRHbHlwaCA9IGNhY2hlR2x5cGgoKHVpbnQzMl90KXV0ZkNoYXIpOworICAgICAgICB9CisgICAgICAgIC8vIElzIHRoZSBnbHlwaCBzdGlsbCBpbiB0ZXh0dXJlIGNhY2hlPworICAgICAgICBpZighY2FjaGVkR2x5cGgtPm1Jc1ZhbGlk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BoSW5kZXgpOworCisgICAgdXBkYXRlR2x5cGhDYWNoZShuZXdHbHlwaCk7CisKKyAgICByZXR1cm4gbmV3R2x5cGg7Cit9CisKK0ZvbnQgKiBGb250OjpjcmVhdGUoQ29udGV4dCAqcnNjLCBjb25zdCBjaGFyICpuYW1lLCB1aW50MzJfdCBmb250U2l6ZSwgdWludDMyX3QgZHBpKQoreworICAgIFZlY3RvcjxGb250Kj4gJmFjdGl2ZUZvbnRzID0gcnNjLT5tU3RhdGVGb250Lm1BY3RpdmVGb250czsKKworICAgIGZvcih1aW50MzJfdCBpID0gMDsgaSA8IGFjdGl2ZUZvbnRzLnNpemUoKTsgaSArKykgeworICAgICAgICBGb250ICppdGhGb250ID0gYWN0aXZlRm9udHNbaV07CisgICAgICAgIGlmKGl0aEZvbnQtPm1Gb250TmFtZSA9PSBuYW1lICYmIGl0aEZvbnQtPm1Gb250U2l6ZSA9PSBmb250U2l6ZSAmJiBpdGhGb250LT5tRHBpID09IGRwaSkgeworICAgICAgICAgICAgaXRoRm9udC0+aW5jVXNlclJlZigpOworICAgICAgICAgICAgcmV0dXJuIGl0aEZvbnQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBGb250ICpuZXdGb250ID0gbmV3IEZvbnQocnNjKTsKKyAgICBib29sIGlzSW5pdGlhbGl6ZWQgPSBuZXdGb250LT5pbml0KG5hbWUsIGZvbnRTaXplLCBkcGkpOworICAgIGlmKGlzSW5pdGlhbGl6ZWQpIHsKKyAgICAgICAgbmV3Rm9udC0+aW5jVXNlclJlZigpOworICAgICAgICBhY3RpdmVGb250cy5wdXNoKG5ld0ZvbnQpOworICAgICAgICByZXR1cm4gbmV3Rm9udDsKKyAgICB9CisKKyAgICBkZWxldGUgbmV3Rm9udDsKKyAgICByZXR1cm4gTlVMTDsKKworfQorCitGb250Ojp+Rm9udCgpCit7CisgICAgaWYobUZhY2UpIHsKKyAgICAgICAgRlRfRG9uZV9GYWNlKG1GYWNlKTsKKyAgICB9CisKKyAgICB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nJzYykKK3sKKyAgICBGVF9FcnJvciBlcnJvcjsKKworICAgIGlmKCFtTGlicmFyeSkgeworICAgICAgICBlcnJvciA9IEZUX0luaXRfRnJlZVR5cGUoJm1MaWJyYXJ5KTsKKyAgICAgICAgaWYoZXJyb3IpIHsKKyAgICAgICAgICAgIExPR0UoIlVuYWJsZSB0byBpbml0aWFsaXplIGZyZWV0eXBlIik7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICB9CisKKyAgICBtUlNDID0gcnNjOworCisgICAgbURlZmF1bHQuc2V0KEZvbnQ6OmNyZWF0ZShyc2MsICJEcm9pZFNhbnMudHRmIiwgMTYsIDk2KSk7Cit9CisKK3ZvaWQgRm9udFN0YXRlOjpmbHVzaEFsbEFuZEludmFsaWRhdGUoKQoreworICAgIGlmKG1DdXJyZW50UXVhZEluZGV4ICE9IDApIHsKKyAgICAgICAgaXNzdWVEcmF3Q29tbWFuZCgpOworICAgICAgICBtQ3VycmVudFF1YWRJbmRleCA9IDA7CisgICAgfQorICAgIGZvcih1aW50MzJfdCBpID0gMDsgaSA8IG1BY3RpdmVGb250cy5zaXplKCk7IGkgKyspIHsKKyAgICAgICAgbUFjdGl2ZUZvbnRzW2ldLT5pbnZhbGlkYXRlVGV4dHVyZUNhY2hlKCk7CisgICAgfQorICAgIGZvcih1aW50MzJfdCBpID0gMDsgaSA8IG1DYWNoZUxpbmVzLnNpemUoKTsgaSArKykgeworICAgICAgICBtQ2FjaGVMaW5lc1tpXS0+bUN1cnJlbnRDb2wgPSAwOworICAgIH0KK30KKworYm9vbCBGb250U3RhdGU6OmNhY2hlQml0bWFwKEZUX0JpdG1hcCAqYml0bWFwLCB1aW50MzJfdCAqcmV0T3JpZ2luWCwgdWludDMyX3QgKnJldE9yaWdpblkpCit7CisgICAgLy8gSWYgdGhlIGdseXBoIGlzIHRvbyB0YWxsLCBkb24ndCBjYWNoZSBpdAorICAgIGlmKCh1aW50MzJfdCliaXRtYXAtPnJvd3MgPiBtQ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YXJ0WSk7CisgICAgICAgICAgICBpZihiaXRtYXBGaXQpIHsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIGlmIHdlIHN0aWxsIGRvbid0IGZpdCwgc29tZXRoaW5nIGlzIHdyb25nIGFuZCB3ZSBzaG91bGRuJ3QgZHJhdworICAgICAgICBpZighYml0bWFwRml0KSB7CisgICAgICAgICAgICBMT0dFKCJCaXRtYXAgZG9lc24ndCBmaXQgaW4gY2FjaGUuIHdpZHRoLCBoZWlnaHQgPSAlaSwgJWkiLCAoaW50KWJpdG1hcC0+d2lkdGgsIChpbnQpYml0bWFwLT5yb3dzKTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgIH0KKworICAgICpyZXRPcmlnaW5YID0gc3RhcnRYOworICAgICpyZXRPcmlnaW5ZID0gc3RhcnRZOworCisgICAgdWludDMyX3QgZW5kWCA9IHN0YXJ0WCArIGJpdG1hcC0+d2lkdGg7CisgICAgdWludDMyX3QgZW5kWSA9IHN0YXJ0WSArIGJpdG1hcC0+cm93czsKKworICAgIC8vTE9HRSgiQml0bWFwIHdpZHRoLCBoZWlnaHQgPSAlaSwgJWkiLCAoaW50KWJpdG1hcC0+d2lkdGgsIChpbnQpYml0bWFwLT5yb3dzKTsKKworICAgIHVpbnQzMl90IGNhY2hlV2lkdGggPSBnZXRDYWNoZVRleHR1cmVUeXBlKCktPmdldERpbVgoKTsKKworICAgIHVuc2lnbmVkIGNoYXIgKmNhY2hlQnVmZmVyID0gKHVuc2lnbmVkIGNoYXIqKW1UZXh0VGV4dHVyZS0+Z2V0UHRyKCk7CisgICAgdW5zaWduZWQgY2hhciAqYml0bWFwQnVmZmVyID0gYml0bWFwLT5idWZmZXI7CisKKyAgICB1aW50MzJfdCBjYWNoZVggPSAwLCBiWCA9IDAsIGNhY2hlWSA9IDAsIGJZID0gMDsKKyAgICBmb3IoY2FjaGVYID0gc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WxzZSwgMSk7CisgICAgVHlwZSAqaW5kZXhUeXBlID0gbmV3IFR5cGUobVJTQyk7CisgICAgdWludDMyX3QgbnVtSW5kaWNpZXMgPSBtTWF4TnVtYmVyT2ZRdWFkcyAqIDY7CisgICAgaW5kZXhUeXBlLT5zZXREaW1YKG51bUluZGljaWVzKTsKKyAgICBpbmRleFR5cGUtPnNldEVsZW1lbnQoaW5kZXhFbGVtKTsKKyAgICBpbmRleFR5cGUtPmNvbXB1dGUoKTsKKworICAgIEFsbG9jYXRpb24gKmluZGV4QWxsb2MgPSBuZXcgQWxsb2NhdGlvbihtUlNDLCBpbmRleFR5cGUpOworICAgIHVpbnQxNl90ICppbmRleFB0ciA9ICh1aW50MTZfdCopaW5kZXhBbGxvYy0+Z2V0UHRyKCk7CisKKyAgICAvLyBGb3VyIHZlcnRzLCB0d28gdHJpYW5nbGVzICwgc2l4IGluZGljZXMgcGVyIHF1YWQKKyAgICBmb3IodWludDMyX3QgaSA9IDA7IGkgPCBtTWF4TnVtYmVyT2ZRdWFkczsgaSArKykgeworICAgICAgICBpbnQgaTYgPSBpICogNjsKKyAgICAgICAgaW50IGk0ID0gaSAqIDQ7CisKKyAgICAgICAgaW5kZXhQdHJbaTYgKyAwXSA9IGk0ICsgMDsKKyAgICAgICAgaW5kZXhQdHJbaTYgKyAxXSA9IGk0ICsgMTsKKyAgICAgICAgaW5kZXhQdHJbaTYgKyAyXSA9IGk0ICsgMjsKKworICAgICAgICBpbmRleFB0cltpNiArIDNdID0gaTQgKyAwOworICAgICAgICBpbmRleFB0cltpNiArIDRdID0gaTQgKyAyOworICAgICAgICBpbmRleFB0cltpNiArIDVdID0gaTQgKyAzOworICAgIH0KKworICAgIGluZGV4QWxsb2MtPmRlZmVyZWRVcGxvYWRUb0J1ZmZlck9iamVjdChtUlNDKTsKKyAgICBtSW5kZXhCdWZmZXIuc2V0KGluZGV4QWxsb2MpOworCisgICAgY29uc3QgRWxlbWVudCAqcG9zRWxlbSA9IEVsZW1lb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mVyT2JqZWN0SUQoKSk7CisgICAgZ2xEcmF3RWxlbWVudHMoR0xfVFJJQU5HTEVTLCBtQ3VycmVudFF1YWRJbmRleCAqIDYsIEdMX1VOU0lHTkVEX1NIT1JULCAodWludDE2X3QgKikoMCkpOworCisgICAgLy8gUmVzZXQgdGhlIHN0YXRlCisgICAgbVJTQy0+c2V0VmVydGV4KChQcm9ncmFtVmVydGV4ICopdG1wVi5nZXQoKSk7CisgICAgbVJTQy0+c2V0RnJhZ21lbnQoKFByb2dyYW1GcmFnbWVudCAqKXRtcEYuZ2V0KCkpOworICAgIG1SU0MtPnNldEZyYWdtZW50U3RvcmUoKFByb2dyYW1TdG9yZSAqKXRtcFBTLmdldCgpKTsKK30KKwordm9pZCBGb250U3RhdGU6OmFwcGVuZE1lc2hRdWFkKGZsb2F0IHgxLCBmbG9hdCB5MSwgZmxvYXQgejEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdTEsIGZsb2F0IHYxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHgyLCBmbG9hdCB5MiwgZmxvYXQgejIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdTIsIGZsb2F0IHYyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHgzLCBmbG9hdCB5MywgZmxvYXQgejMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdTMsIGZsb2F0IHYzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHg0LCBmbG9hdCB5NCwgZmxvYXQgejQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdTQsIGZsb2F0IHY0KQoreworICAgIGNvbnN0IHVpbnQzMl90IHZlcnRzUGVyUXVhZCA9IDQ7CisgICAgY29uc3QgdWludDMyX3QgZmxvYXRzUGVyVmVydCA9IDU7CisgICAgZmxvYXQgKmN1cnJlbnRQb3MgPSBtVGV4dE1lc2hQdHIgKyBtQ3VycmVudFF1YWRJbmRleCAqIHZlcnRzUGVyUXVhZCAqIGZsb2F0c1BlclZlcnQ7CisKKyAgICAvLyBDdWxsIHRoaW5ncyB0aGF0IGFyZSBvZmYgdGhlIHNjcmVlbgorICAgIGZsb2F0IHdpZHRoID0gKGZsb2F0KW1SU0MtPmdldFdpZHRoKCk7CisgICAgZmxvYXQgaGVpZ2h0ID0gKGZsb2F0KW1SU0MtPmdldEhlaWdodCgpOworCisgICAgaWYoeDEgPiB3aWR0aCB8fCB5MSA8IDAuMGYgfHwgeDIgPCAwIHx8IHk0ID4gaGVpZ2h0KSB7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICAvKkxPR0UoIlYwIHg6ICVmIHk6ICVmIHo6ICVmIiwgeDEsIHkxLCB6MSk7CisgICAgTE9HRSgiVjEgeDogJWYgeTogJWYgejogJWYiLCB4MiwgeTIsIHoyKTsKKyAgICBMT0dFKCJWMiB4OiAlZiB5OiAlZiB6OiAlZiIsIHgzLCB5MywgejMpOworICAgIExPR0UoIlYzIHg6ICVmIHk6ICVmIHo6ICVmIiwgeDQsIHk0LCB6NCk7Ki8KKworICAgICgqY3VycmVudFBvcysrKSA9IHgxOworICAgICgqY3VycmVudFBvcysrKSA9IHkxOworICAgICgqY3VycmVudFBvcysrKSA9IHoxOworICAgICgqY3VycmVudFBvcysrKSA9IHUxOworICAgICgqY3VycmVudFBvcysrKSA9IHYxOworCisgICAgKCpjdXJyZW50UG9zKyspID0geDI7CisgICAgKCpjdXJyZW50UG9zKyspID0geTI7CisgICAgKCpjdXJyZW50UG9zKyspID0gejI7CisgICAgKCpjdXJyZW50UG9zKyspID0gdTI7CisgICAgKCpjdXJyZW50UG9zKyspID0gdjI7CisKKyAgICAoKmN1cnJlbnRQb3MrKykgPSB4MzsKKyAgICAoKmN1cnJlbnRQb3MrKykgPSB5MzsKKyAgICAoKmN1cnJlbnRQb3MrKykgPSB6MzsKKyAgICAoKmN1cnJlbnRQb3MrKykgPSB1MzsKKyAgICAoKmN1cnJlbnRQb3MrKykgPSB2MzsKKworICAgICgqY3VycmVudFBvcysrKSA9IHg0OworICAgICgqY3VycmVudFBvcysrKSA9IHk0OworICAgICgqY3VycmVudFBvcysrKSA9IHo0OworICAgICgqY3VycmVudFBvcysrKSA9IHU0OworICAgICgqY3VycmVudFBvcysrKSA9IHY0OworCisgICAgbUN1cnJlbnRRdWFkSW5kZXggKys7CisKKyAgICBpZihtQ3VycmVudFF1YWRJbmRleCA9PSBtTWF4TnVtYmVyT2ZRdWFkcykgeworICAgICAgICBpc3N1ZURyYXdDb21tYW5kKCk7CisgICAgICAgIG1DdXJyZW50UXVhZEluZGV4ID0gMDsKKyAgICB9Cit9CisKK3ZvaWQgRm9udFN0YXRlOjpyZW5kZXJUZXh0KGNvbnN0IGNoYXIgKnRleHQsIHVpbnQzMl90IGxlbiwgdWludDMyX3Qgc3RhcnRJbmRleCwgaW50IG51bUdseXBocywgaW50IHgsIGludCB5KQoreworICAgIGNoZWNrSW5pdCgpOworCisgICAgU3RyaW5nOCB0ZXh0OCh0ZXh0KTsKKworICAgIC8vIFJlbmRlciBjb2RlIGhlcmUKKyAgICBGb250ICpjdXJyZW50Rm9udCA9IG1SU0MtPmdldEZvbnQoKTsKKyAgICBjdXJyZW50Rm9udC0+cmVuZGVyVVRGKHRleHQsIGxlbiwgc3RhcnRJbmRleCwgbnVtR2x5cGhzLCB4LCB5KTsKKworICAgIGlmKG1DdXJyZW50UXVhZEluZGV4ICE9IDApIHsKKyAgICAgICAgaXNzdWVEcmF3Q29tbWFuZCgpOworICAgICAgICBtQ3VycmVudFF1YWRJbmRleCA9IDA7CisgICAgfQorfQorCit2b2lkIEZvbnRTdGF0ZTo6cmVuZGVyVGV4dChjb25zdCBjaGFyICp0ZXh0LCBpbnQgeCwgaW50IHkpCit7CisgICAgc2l6ZV90IHRleHRMZW4gPSBzdHJsZW4odGV4dCk7Cisg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ICAgdWludDMyX3QgbUJpdG1hcE1pblk7CisgICAgICAgIHVpbnQzMl90IG1CaXRtYXBXaWR0aDsKKyAgICAgICAgdWludDMyX3QgbUJpdG1hcEhlaWdodDsKKyAgICAgICAgLy8gQWxzbyBjYWNoZSB0ZXh0dXJlIGNvb3JkcyBmb3IgdGhlIHF1YWQKKyAgICAgICAgZmxvYXQgbUJpdG1hcE1pblU7CisgICAgICAgIGZsb2F0IG1CaXRtYXBNaW5WOworICAgICAgICBmbG9hdCBtQml0bWFwTWF4VTsKKyAgICAgICAgZmxvYXQgbUJpdG1hcE1heFY7CisgICAgICAgIC8vIE1pbmltaXplIGhvdyBtdWNoIHdlIGNhbGwgZnJlZXR5cGUKKyAgICAgICAgRlRfVUludCBtR2x5cGhJbmRleDsKKyAgICAgICAgRlRfVmVjdG9yIG1BZHZhbmNlOworICAgICAgICAvLyBWYWx1ZXMgYmVsb3cgY29udGFpbiBhIGdseXBoJ3Mgb3JpZ2luIGluIHRoZSBiaXRtYXAKKyAgICAgICAgRlRfSW50IG1CaXRtYXBMZWZ0OworICAgICAgICBGVF9JbnQgbUJpdG1hcFRvcDsKKyAgICAgICAgLy8gSG9sZCBvbiB0byB0aGUgYml0bWFwIGluIGNhc2UgY2FjaGUgaXMgaW52YWxpZGF0ZWQKKyAgICAgICAgRlRfQml0bWFwIG1CaXRtYXA7CisgICAgICAgIGJvb2wgbUJpdG1hcFZhbGlkOworICAgIH07CisKKyAgICBTdHJpbmc4IG1Gb250TmFtZTsKKyAgICB1aW50MzJfdCBtRm9udFNpemU7CisgICAgdWludDMyX3QgbURwaTsKKworICAgIEZvbnQoQ29udGV4dCAqcnNjKTsKKyAgICBib29sIGluaXQoY29uc3QgY2hhciAqbmFtZSwgdWludDMyX3QgZm9udFNpemUsIHVpbnQzMl90IGRwaSk7CisKKyAgICBGVF9GYWNlIG1GYWNlOworICAgIGJvb2wgbUluaXRpYWxpemVkOworICAgIGJvb2wgbUhhc0tlcm5pbmc7CisKKyAgICBE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h0OworICAgICAgICB1aW50MzJfdCBtTWF4V2lkdGg7CisgICAgICAgIHVpbnQzMl90IG1DdXJyZW50Um93OworICAgICAgICB1aW50MzJfdCBtQ3VycmVudENvbDsKKworICAgICAgICBDYWNoZVRleHR1cmVMaW5lKHVpbnQzMl90IG1heEhlaWdodCwgdWludDMyX3QgbWF4V2lkdGgsIHVpbnQzMl90IGN1cnJlbnRSb3csIHVpbnQzMl90IGN1cnJlbnRDb2wpIDoKKyAgICAgICAgICAgIG1NYXhIZWlnaHQobWF4SGVpZ2h0KSwgbU1heFdpZHRoKG1heFdpZHRoKSwgbUN1cnJlbnRSb3coY3VycmVudFJvdyksIG1DdXJyZW50Q29sKGN1cnJlbnRDb2wpIHsKKyAgICAgICAgfQorCisgICAgICAgIGJvb2wgZml0Qml0bWFwKEZUX0JpdG1hcCAqYml0bWFwLCB1aW50MzJfdCAqcmV0T3JpZ2luWCwgdWludDMyX3QgKnJldE9yaWdpblkpIHsKKyAgICAgICAgICAgIGlmKCh1aW50MzJfdCliaXRtYXAtPnJvd3MgPiBtTWF4SGVpZ2h0KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZihtQ3VycmVudENvbCArICh1aW50MzJfdCliaXRtYXAtPndpZHRoIDwgbU1heFdpZHRoKSB7CisgICAgICAgICAgICAgICAqcmV0T3JpZ2luWCA9IG1DdXJyZW50Q29sOworICAgICAgICAgICAgICAgKnJldE9yaWdpblkgPSBtQ3VycmVudFJvdzsKKyAgICAgICAgICAgICAgIG1DdXJyZW50Q29sICs9IGJpdG1hcC0+d2lkdGg7CisgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfTsKKworICAgIFZlY3RvcjxDYWNoZVRleHR1cmVMaW5lKj4gbUNhY2hlTGluZXM7CisKKyAgICBDb250ZXh0IC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leEFycmF5QnVmZmVycygpOworICAgIE9iamVjdEJhc2VSZWY8QWxsb2NhdGlvbj4gbUluZGV4QnVmZmVyOworICAgIE9iamVjdEJhc2VSZWY8QWxsb2NhdGlvbj4gbVZlcnRleEFycmF5OworCisKKyAgICBib29sIG1Jbml0aWFsaXplZDsKKworICAgIHZvaWQgY2hlY2tJbml0KCk7CisKKyAgICB2b2lkIGlzc3VlRHJhd0NvbW1hbmQoKTsKKworICAgIHZvaWQgYXBwZW5kTWVzaFF1YWQoZmxvYXQgeDEsIGZsb2F0IHkxLCBmbG9hdCB6MSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdTEsIGZsb2F0IHYxLAorICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB4MiwgZmxvYXQgeTIsIGZsb2F0IHoyLAorICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB1MiwgZmxvYXQgdjIsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHgzLCBmbG9hdCB5MywgZmxvYXQgejMsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHUzLCBmbG9hdCB2MywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeDQsIGZsb2F0IHk0LCBmbG9hdCB6NCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdTQsIGZsb2F0IHY0KTsKKworfTsKKworCit9Cit9CisKKyNlbmRpZgpkaWZmIC0tZ2l0IGEvbGlicy9ycy9yc0hhbmRjb2RlLmggYi9saWJzL3JzL3JzSGFuZGNvZGUuaAppbmRleCA4MDBlZGRkLi4zNTNiNzNhIDEwMDY0NAotLS0gYS9saWJzL3JzL3JzSGFuZGNvZGUuaAorKysgYi9saWJzL3JzL3JzSGFuZGNvZGUuaApAQCAtMSw2ICsxLDU3IEBACiAKICNkZWZpbmUgREFUQV9TWU5DX1NJWkUgMTAyNAogCitzdGF0aWMgaW5saW5lIHZvaWQgcnNIQ0FQSV9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5kYXRhID0gKHZvaWQgKikoY21kKzEpOworICAgICAgICBtZW1jcHkoY21kKzEsIGRhdGEsIHNpemVCeXRlcyk7CisgICAgICAgIGlvLT5tVG9Db3JlLmNvbW1pdChSU19DTURfSURfU2NyaXB0SW52b2tlViwgc2l6ZSk7CisgICAgfSBlbHNlIHsKKyAgICAgICAgaW8tPm1Ub0NvcmUuY29tbWl0U3luYyhSU19DTURfSURfU2NyaXB0SW52b2tlViwgc2l6ZSk7CisgICAgfQorfQorCisKK3N0YXRpYyBpbmxpbmUgdm9pZCByc0hDQVBJX1NjcmlwdFNldFZhclYgKFJzQ29udGV4dCByc2MsIFJzU2NyaXB0IHZhLCB1aW50MzJfdCBzbG90LCBjb25zdCB2b2lkICogZGF0YSwgdWludDMyX3Qgc2l6ZUJ5dGVzKQoreworICAgIFRocmVhZElPICppbyA9ICYoKENvbnRleHQgKilyc2MpLT5tSU87CisgICAgdWludDMyX3Qgc2l6ZSA9IHNpemVvZihSU19DTURfU2NyaXB0U2V0VmFyVik7CisgICAgaWYgKHNpemVCeXRlcyA8IERBVEFfU1lOQ19TSVpFKSB7CisgICAgICAgIHNpemUgKz0gKHNpemVCeXRlcyArIDMpICYgfjM7CisgICAgfQorICAgIFJTX0NNRF9TY3JpcHRTZXRWYXJWICpjbWQgPSBzdGF0aWNfY2FzdDxSU19DTURfU2NyaXB0U2V0VmFyViAqPihpby0+bVRvQ29yZS5yZXNlcnZlKHNpemUpKTsKKyAgICBjbWQtPnMgPSB2YTsKKyAgICBjbWQtPnNsb3QgPSBzbG90OworICAgIGNtZC0+ZGF0YUxlbiA9IHNpemVCeXRlczsKKyAgICBjbWQtPmRhdGEgPSBkYXRhOworICAgIGlmIChzaXplQnl0ZXMgPCBEQVRBX1NZTkNfU0laRSkgeworICAgICAgICBjbWQtPmRhdGEgPSAodm9pZCAqKShjbWQrMSk7CisgICAgICAgIG1lbWNweShjbWQrMSwgZGF0YSwgc2l6ZUJ5dGVzKTsKKyAgICAgICAgaW8tP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cnRzLT5tQWxsb2NhdGlvbkNvdW50KTsKKworICAgICAgICBmb3IgKHVpbnQzMl90IGFDb3VudCA9IDA7IGFDb3VudCA8IHZlcnRzLT5tQWxsb2NhdGlvbkNvdW50OyBhQ291bnQrKykgeworICAgICAgICAgICAgdmVydHMtPm1BbGxvY2F0aW9uc1thQ291bnRdLT5zZXJpYWxpemUoc3RyZWFtKTsKKyAgICAgICAgfQorICAgICAgICBzdHJlYW0tPmFkZFUzMih2ZXJ0cy0+bVZlcnRleERhdGFTaXplKTsKKworICAgICAgICBzdHJlYW0tPmFkZFUzMih2ZXJ0cy0+bU9mZnNldENvb3JkKTsKKyAgICAgICAgc3RyZWFtLT5hZGRVMzIodmVydHMtPm1PZmZzZXRUZXgpOworICAgICAgICBzdHJlYW0tPmFkZFUzMih2ZXJ0cy0+bU9mZnNldE5vcm0pOworCisgICAgICAgIHN0cmVhbS0+YWRkVTMyKHZlcnRzLT5tU2l6ZUNvb3JkKTsKKyAgICAgICAgc3RyZWFtLT5hZGRVMzIodmVydHMtPm1TaXplVGV4KTsKKyAgICAgICAgc3RyZWFtLT5hZGRVMzIodmVydHMtPm1TaXplTm9ybSApOworICAgIH0KKworICAgIHN0cmVhbS0+YWRkVTMyKG1QcmltaXRpdmVzQ291bnQpOworICAgIC8vIFN0b3JlIHRoZSBwcmltaXRpdmVzCisgICAgZm9yICh1aW50MzJfdCBwQ291bnQgPSAwOyBwQ291bnQgPCBtUHJpbWl0aXZlc0NvdW50OyBwQ291bnQgKyspIHsKKyAgICAgICAgUHJpbWl0aXZlX3QgKiBwcmltID0gbVByaW1pdGl2ZXNbcENvdW50XTsKKworICAgICAgICBzdHJlYW0tPmFkZFU4KCh1aW50OF90KXByaW0tPm1UeXBlKTsKKworICAgICAgICAvLyBXZSBzdG9yZSB0aGUgaW5kZXggdG8gdGhlIHZlcnRpY2VzCisgICAgICAgIC8vIFNvIGl0ZXJhdGUgb3ZlciBvdXIgdmVydGljZXMgdG8gZmluZCB3aGljaCBvbmUgd2UgcG9pbnQgdG8KKyAgICAgICAgdWludDMyX3QgdmVydGV4SW5kZXggPSAwOworICAgICAgICBmb3IodWludDMyX3QgdkNvdW50ID0gMDsgdkNvdW50IDwgbVZlcnRpY2llc0NvdW50OyB2Q291bnQgKyspIHsKKyAgICAgICAgICAgIGlmKHByaW0tPm1WZXJ0aWNpZXMgPT0gbVZlcnRpY2llc1t2Q291bnRdKSB7CisgICAgICAgICAgICAgICAgdmVydGV4SW5kZXggPSB2Q291bnQ7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgc3RyZWFtLT5hZGRVMzIodmVydGV4SW5kZXgpOworCisgICAgICAgIHN0cmVhbS0+YWRkVTMyKHByaW0tPm1JbmRleENvdW50KTsKKyAgICAgICAgZm9yICh1aW50MzJfdCBjdCA9IDA7IGN0IDwgcHJpbS0+bUluZGV4Q291bnQ7IGN0KyspIHsKKyAgICAgICAgICAgIHN0cmVhbS0+YWRkVTE2KHByaW0tPm1JbmRpY2llc1tjdF0pOworICAgICAgICB9CisKKyAgICAgICAgc3RyZWFtLT5hZGRVMzIocHJpbS0+bVJlc3RhcnRDb3VudHMpOworICAgICAgICBmb3IgKHVpbnQzMl90IGN0ID0gMDsgY3QgPCBwcmltLT5tUmVzdGFydENvdW50czsgY3QrKykgeworICAgICAgICAgICAgc3RyZWFtLT5hZGRVMTYocHJpbS0+bVJlc3RhcnRzW2N0XSk7CisgICAgICAgIH0KKyAgICB9Cit9CisKK01lc2ggKk1lc2g6OmNyZWF0ZUZyb21TdHJlYW0oQ29udGV4dCAqcnNjLCBJU3RyZWFtICpzdHJlYW0pCit7CisgICAgLy8gRmlyc3QgbWFrZSBzdXJlIHdlIGFyZSByZWFkaW5nIHRoZSBjb3JyZWN0IG9iamVjdAorICAgIFJzQTNEQ2xhc3NJRCBjbGFzc0lEID0gKFJzQTNEQ2xhc3NJRClzdHJlYW0tPmxvYWRVMzIoKTsKKyAgICB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dGl2ZXMKKyAgICBmb3IgKHVpbnQzMl90IHBDb3VudCA9IDA7IHBDb3VudCA8IG1lc2gtPm1QcmltaXRpdmVzQ291bnQ7IHBDb3VudCArKykgeworICAgICAgICBQcmltaXRpdmVfdCAqIHByaW0gPSBuZXcgUHJpbWl0aXZlX3Q7CisgICAgICAgIG1lc2gtPm1QcmltaXRpdmVzW3BDb3VudF0gPSBwcmltOworCisgICAgICAgIHByaW0tPm1UeXBlID0gKFJzUHJpbWl0aXZlKXN0cmVhbS0+bG9hZFU4KCk7CisKKyAgICAgICAgLy8gV2Ugc3RvcmUgdGhlIGluZGV4IHRvIHRoZSB2ZXJ0aWNlcworICAgICAgICB1aW50MzJfdCB2ZXJ0ZXhJbmRleCA9IHN0cmVhbS0+bG9hZFUzMigpOworICAgICAgICBpZih2ZXJ0ZXhJbmRleCA8IG1lc2gtPm1WZXJ0aWNpZXNDb3VudCkgeworICAgICAgICAgICAgcHJpbS0+bVZlcnRpY2llcyA9IG1lc2gtPm1WZXJ0aWNpZXNbdmVydGV4SW5kZXhdOworICAgICAgICB9CisgICAgICAgIGVsc2UgeworICAgICAgICAgICAgcHJpbS0+bVZlcnRpY2llcyA9IE5VTEw7CisgICAgICAgIH0KKworICAgICAgICBwcmltLT5tSW5kZXhDb3VudCA9IHN0cmVhbS0+bG9hZFUzMigpOworICAgICAgICBpZihwcmltLT5tSW5kZXhDb3VudCl7CisgICAgICAgICAgICBwcmltLT5tSW5kaWNpZXMgPSBuZXcgdWludDE2X3RbcHJpbS0+bUluZGV4Q291bnRdOworICAgICAgICAgICAgZm9yICh1aW50MzJfdCBjdCA9IDA7IGN0IDwgcHJpbS0+bUluZGV4Q291bnQ7IGN0KyspIHsKKyAgICAgICAgICAgICAgICBwcmltLT5tSW5kaWNpZXNbY3RdID0gc3RyZWFtLT5sb2FkVTE2KCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZSB7CisgICAgICAgICAgICBwcmltLT5tSW5kaWNpZXMgPSBOVUxMOworICAgICAgICB9CisKKyAgICAgICAgcHJpbS0+bVJlc3RhcnRDb3VudHMgPSBzdHJlYW0tPmxvYWRVMzIoKTsKKyAgICAgICAgaWYgKHByaW0tPm1SZXN0YXJ0Q291bnRzKSB7CisgICAgICAgICAgICBwcmltLT5tUmVzdGFydHMgPSBuZXcgdWludDE2X3RbcHJpbS0+bVJlc3RhcnRDb3VudHNdOworICAgICAgICAgICAgZm9yICh1aW50MzJfdCBjdCA9IDA7IGN0IDwgcHJpbS0+bVJlc3RhcnRDb3VudHM7IGN0KyspIHsKKyAgICAgICAgICAgICAgICBwcmltLT5tUmVzdGFydHNbY3RdID0gc3RyZWFtLT5sb2FkVTE2KCk7CisKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgIHByaW0tPm1SZXN0YXJ0cyA9IE5VTEw7CisgICAgICAgIH0KKworICAgIH0KKworICAgIHJldHVybiBtZXNoOworfQogCiAKIE1lc2hDb250ZXh0OjpNZXNoQ29udGV4dCgpCmRpZmYgLS1naXQgYS9saWJzL3JzL3JzTWVzaC5oIGIvbGlicy9ycy9yc01lc2guaAppbmRleCA1MjAxYWJkLi44YzdlOGE0IDEwMDY0NAotLS0gYS9saWJzL3JzL3JzTWVzaC5oCisrKyBiL2xpYnMvcnMvcnNNZXNoLmgKQEAgLTYyLDE1ICs2MiwxNyBAQAogICAgICAgICB1aW50MTZfdCAqbVJlc3RhcnRzOwogICAgIH07CiAKLSAgICBWZXJ0aWNpZXNfdCAqIG1WZXJ0aWNpZXM7CisgICAgVmVydGljaWVzX3QgKiogbVZlcnRpY2llczsKICAgICB1aW50MzJfdCBtVmVydGljaWVzQ291bnQ7CiAKICAgICBQcmltaXRpdmVfdCAqKiBtUHJpbWl0aXZlczsKICAgICB1aW50MzJfdCBtUHJpbWl0aXZlc0NvdW50OwogCi0KLQogICAgIHZvaWQgYW5hbHl6ZUVsZW1lbnQoKTsKKyAgICB2aX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KyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAorICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKi8KKworI2luY2x1ZGUgInJzTXV0ZXguaCIKKwordXNpbmcgbmFtZXNwYWNlIGFuZHJvaWQ7Cit1c2luZyBuYW1lc3BhY2UgYW5kcm9pZDo6cmVuZGVyc2NyaXB0OworCisKK011dGV4OjpNdXRleCgpCit7Cit9CisKK011dGV4Ojp+TXV0ZXgoKQoreworICAgIHB0aHJlYWRfbXV0ZXhfZGVzdHJveSgmbU11dGV4KTsKK30KKworYm9vbCBNdXRleDo6aW5pdCgpCit7CisgICAgaW50IHN0YXR1cyA9IHB0aHJlYWRfbXV0ZXhfaW5pdCgmbU11dGV4LCBOVUxMKTsKKyAgICBpZiAoc3RhdHVzKSB7CisgICAgICAgIExPR0UoIk11dGV4OjpNdXRleCBpbml0IGZhaWx1cmUiKTsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKyAgICByZXR1cm4gdHJ1ZTsKK30KKworYm9vbCBNdXRleDo6bG9jaygpCit7CisgICAgaW50IHN0YXR1czsKKyAgICBzdGF0dXMgPSBwdGhyZWFkX211dGV4X2xvY2soJm1NdXRleCk7CisgICAgaWYgKHN0YXR1cykgeworICAgICAgICBMT0dFKCJNdXRleDogZXJyb3IgJWkgbG9ja2luZy4iLCBzdGF0dXMpOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorICAgIHJldHVybiB0cnVlOworfQorCitib29sIE11dGV4Ojp1bmxvY2soKQoreworICAgIGludCBzdGF0dXM7CisgICAgc3RhdHVzID0gcHRocmVhZF9tdXRleF91bmxvY2soJm1Nd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2ldKTsKLSAgICB9Ci0gICAgCi0gICAgZm9yIChpID0gQi0xOyBpID49IDA7IGktLSkgewotICAgICAgICBrID0gcFtpXTsKLSAgICAgICAgcFtpXSA9IHBbaiA9IHJhbmQoKSAlIEJdOwotICAgICAgICBwW2pdID0gazsKLSAgICB9Ci0gICAgCi0gICAgZm9yIChpID0gMDsgaSA8IEIgKyAyOyBpKyspIHsKLSAgICAgICAgcFtCICsgaV0gPSBwW2ldOwotICAgICAgICBnMVtCICsgaV0gPSBnMVtpXTsKLSAgICAgICAgZm9yIChqID0gMDsgaiA8IDI7IGorKykKLSAgICAgICAgICAgIGcyW0IgKyBpXVtqXSA9IGcyW2ldW2pdOwotICAgICAgICBmb3IgKGogPSAwOyBqIDwgMzsgaisrKQotICAgICAgICAgICAgZzNbQiArIGldW2pdID0gZzNbaV1bal07Ci0gICAgfQotfQotCi1mbG9hdCBTQ19ub2lzZWYoZmxvYXQgeCkKLXsKLSAgICBzcmFuZCh0aW1lKE5VTEwpKTsKLSAgICBpbnQgYngwLCBieDE7Ci0gICAgZmxvYXQgcngwLCByeDEsIHN4LCB0LCB1LCB2OwotICAgIAotICAgIGlmIChub2lzZV9zdGFydCkgewotICAgICAgICBub2lzZV9zdGFydCA9IGZhbHNlOwotICAgICAgICBub2lzZV9pbml0KCk7Ci0gICAgfQotICAgIAotICAgIHQgPSB4ICsgTjsKLSAgICBieDAgPSAoKGludCl0KSAmIEJNOwotICAgIGJ4MSA9IChieDArMSkgJiBCTTsKLSAgICByeDAgPSB0IC0gKGludCl0OwotICAgIHJ4MSA9IHJ4MCAtIDEuMGY7Ci0gICAgCi0gICAgc3ggPSBub2lzZV9zQ3VydmUocngwKTsKLSAgICAKLSAgICB1ID0gcngwICogZzFbcFtieDBdXTsKLSAgICB2ID0gcngxICogZzFbcFtieDFdXTsKLSAgICByZXR1cm4gMi4zZiAqIGxlcnBmKHUsIHYsIHN4KTsKLX0KLQotZmxvYXQgU0Nfbm9pc2VmMihmbG9hdCB4LC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ICAgICAgY29uc3QgTGlnaHQgKmwgPSBtTGlnaHRzW2N0XS5nZXQoKTsKICAgICAgICAgICAgIGdsRW5hYmxlKEdMX0xJR0hUMCArIGN0KTsKQEAgLTkyLDYgKzEwMSw3IEBACiAgICAgICAgIGZvciAodWludDMyX3QgY3QgPSBtTGlnaHRDb3VudDsgY3QgPCBNQVhfTElHSFRTOyBjdCsrKSB7CiAgICAgICAgICAgICBnbERpc2FibGUoR0xfTElHSFQwICsgY3QpOwogICAgICAgICB9CisjZW5kaWYgLy9BTkRST0lEX1JTX0JVSUxEX0ZPUl9IT1NUCiAgICAgfSBlbHNlIHsKICAgICAgICAgZ2xEaXNhYmxlKEdMX0xJR0hUSU5HKTsKICAgICB9CkBAIC0xMjgsNiArMTM4LDExIEBACiAgICAgICAgICAgICBjb25zdCBFbGVtZW50ICplID0gbUNvbnN0YW50VHlwZXNbY3RdLT5nZXRFbGVtZW50KCk7CiAgICAgICAgICAgICBmb3IgKHVpbnQzMl90IGZpZWxkPTA7IGZpZWxkIDwgZS0+Z2V0RmllbGRDb3VudCgpOyBmaWVsZCsrKSB7CiAgICAgICAgICAgICAgICAgY29uc3QgRWxlbWVudCAqZiA9IGUtPmdldEZpZWxkKGZpZWxkKTsKKyAgICAgICAgICAgICAgICBjb25zdCBjaGFyICpmbiA9IGUtPmdldEZpZWxkTmFtZShmaWVsZCk7CisKKyAgICAgICAgICAgICAgICBpZiAoZm5bMF0gPT0gJyMnKSB7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgIC8vIENhbm5vdCBiZSBjb21wbGV4CiAgICAgICAgICAgICAgICAgcnNBc3NlcnQoIWYtPmdldEZpZWxkQ291bnQoKSk7CkBAIC0xNDAsNyArMTU1LDcgQEAKICAgICAgICAgICAgICAgICAgICAgcnNBc3NlcnQoMCk7CiAgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgbVNoYWRlci5hcHBlbmQoZS0+Z2V0RmllbGROYW1lKGZpZWxkKSk7CisgICAgICAgICAgICAgICAgbVNoYWRlci5hcHBlbmQoZm4pOwogICAgICAgICAgICAgICAgIG1TaGFkZXIuYXBwZW5kKCI7XG4iKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQpAQCAtMTUwLDYgKzE2NSwxMSBAQAogICAgICAgICAgICAgY29uc3QgRWxlbWVudCAqZSA9IG1JbnB1dEVsZW1lbnRzW2N0XS5nZXQoKTsKICAgICAgICAgICAgIGZvciAodWludDMyX3QgZmllbGQ9MDsgZmllbGQgPCBlLT5nZXRGaWVsZENvdW50KCk7IGZpZWxkKyspIHsKICAgICAgICAgICAgICAgICBjb25zdCBFbGVtZW50ICpmID0gZS0+Z2V0RmllbGQoZmllbGQpOworICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgKmZuID0gZS0+Z2V0RmllbGROYW1lKGZpZWxkKTsKKworICAgICAgICAgICAgICAgIGlmIChmblswXSA9PSAnIycpIHsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgLy8gQ2Fubm90IGJlIGNvbXBsZXgKICAgICAgICAgICAgICAgICByc0Fzc2VydCghZi0+Z2V0RmllbGRDb3VudCgpKTsKQEAgLTE2MiwxNyArMTgyLDE3IEBACiAgICAgICAgICAgICAgICAgICAgIHJzQXNzZXJ0KDApOwogICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgIG1TaGFkZXIuYXBwZW5kKGUtPmdldEZpZWxkTmFtZShmaWVsZCkpOworICAgICAgICAgICAgICAgIG1TaGFkZXIuYXBwZW5kKGZuKTsKICAgICAgICAgICAgICAgICBtU2hhZGVyLmFwcGVuZCgiO1xuIik7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgbVNoYWRlci5hcHBlbmQobVVzZXJTaGFkZXIpOwogICAgIH0gZWxzZSB7Ci0gICAgICAgIG1TaGFkZ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RW52aXJvbWVudC5tRnJhZ21lbnRTdG9yZS5nZXQoKSkgewogICAgICAgICByc2MtPnNldEZyYWdtZW50U3RvcmUobUVudmlyb21lbnQubUZyYWdtZW50U3RvcmUuZ2V0KCkpOwogICAgIH0KQEAgLTgzLDIwICsxMTYsOTIgQEAKICAgICBpZiAobUVudmlyb21lbnQubVJhc3Rlci5nZXQoKSkgewogICAgICAgICByc2MtPnNldFJhc3RlcihtRW52aXJvbWVudC5tUmFzdGVyLmdldCgpKTsKICAgICB9Cit9CiAKLSAgICBpZiAobGF1bmNoSW5kZXggPT0gMCkgewotICAgICAgICBtRW52aXJvbWVudC5tU3RhcnRUaW1lTWlsbGlzCi0gICAgICAgICAgICAgICAgPSBuYW5vc2Vjb25kc190b19taWxsaXNlY29uZHMoc3lzdGVtVGltZShTWVNURU1fVElNRV9NT05PVE9OSUMpKTsKK3VpbnQzMl90IFNjcmlwdEM6OnJ1bihDb250ZXh0ICpyc2MpCit7CisgICAgaWYgKG1Qcm9ncmFtLm1Sb290ID09IE5VTEwpIHsKKyAgICAgICAgcnNjLT5zZXRFcnJvcihSU19FUlJPUl9CQURfU0NSSVBULCAiQXR0ZW1wdGVkIHRvIHJ1biBiYWQgc2NyaXB0Iik7CisgICAgICAgIHJldHVybiAwOwogICAgIH0KLSAgICBzZXR1cFNjcmlwdCgpOworCisgICAgc2V0dXBTY3JpcHQocnNjKTsKIAogICAgIHVpbnQzMl90IHJldCA9IDA7Ci0gICAgdGxzLT5tU2NyaXB0ID0gdGhpczsKLSAgICByZXQgPSBtUHJvZ3JhbS5tU2NyaXB0KGxhdW5jaEluZGV4KTsKLSAgICB0bHMtPm1TY3JpcHQgPSBOVUxMOworICAgIFNjcmlwdCAqIG9sZFRMUyA9IHNldFRMUyh0aGlzKTsKKyAgICAvL0xPR0UoIlNjcmlwdEM6OnJ1biAlcCIsIG1Qcm9ncmFtLm1Sb290KTsKKyAgICByZXQgPSBtUHJvZ3JhbS5tUm9vdCgpOworICAgIHNldFRMUyhvbGRUTFMpOworICAgIC8vTE9HRSgiU2NyaXB0Qzo6cnVuIHJldCAlaSIsIHJldCk7CiAgICAgcmV0dXJuIHJldDsKIH0KIAordm9pZCBTY3JpcHRDOjpydW5Gb3JFYWNoKENvbnRleHQgKnJzYywgY29uc3QgQWxsb2NhdGlvbiAqYWluLCBBbGxvY2F0aW9uICphb3V0LAorICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHhTdGFydCwgdWludDMyX3QgeVN0YXJ0LCB1aW50MzJfdCB4RW5kLCB1aW50MzJfdCB5RW5kKQoreworICAgIExPR0UoIlNjcmlwdEM6OnJ1bkZvckVhY2ggbm90IGltcGxlbWVudGVkIik7Cit9CisKK3ZvaWQgU2NyaXB0Qzo6cnVuRm9yRWFjaChDb250ZXh0ICpyc2MsIGNvbnN0IEFsbG9jYXRpb24gKmFpbiwgQWxsb2NhdGlvbiAqYW91dCwgdWludDMyX3QgeFN0YXJ0LCB1aW50MzJfdCB4RW5kKQoreworICAgIHVpbnQzMl90IGRpbVggPSBhaW4tPmdldFR5cGUoKS0+Z2V0RGltWCgpOworICAgIHJzQXNzZXJ0KHhTdGFydCA8IGRpbVgpOworICAgIHJzQXNzZXJ0KHhFbmQgPD0gZGltWCk7CisgICAgcnNBc3NlcnQoYWluLT5nZXRUeXBlKCktPmdldERpbVkoKSA9PSAwKTsKKyAgICByc0Fzc2VydChhaW4tPmdldFR5cGUoKS0+Z2V0RGltWigpID09IDApOworCisgICAgaWYgKHhTdGFydCA+PSBkaW1YKSB4U3RhcnQgPSBkaW1YIC0gMTsKKyAgICBpZiAoeEVuZCA+PSBkaW1YKSB4RW5kID0gZGltWCAtIDE7CisgICAgaWYgKHhTdGFydCA+IHhFbmQpIHJldHVybjsKKworICAgIHNldHVwU2NyaXB0KHJzYyk7CisgICAgU2NyaXB0ICogb2xkVExTID0gc2V0VExTKHRoaXMpOworCisgICAgdHlwZWRlZiBpbnQgKCpyc190KShjb25zdCB2b2lkICosIHZvaW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F07Ci0gICAgICAgIGFjY0dldFByYWdtYXMocy0+bUFjY1NjcmlwdCwgJnByYWdtYUNvdW50LCBwcmFnbWFNYXgsICZzdHJbMF0pOworICAgICAgICBCQ0NzaXplaSBwcmFnbWFDb3VudDsKKyAgICAgICAgQkNDY2hhciAqIHN0cltwcmFnbWFNYXhdOworICAgICAgICBiY2NHZXRQcmFnbWFzKHMtPm1CY2NTY3JpcHQsICZwcmFnbWFDb3VudCwgcHJhZ21hTWF4LCAmc3RyWzBdKTsKIAogICAgICAgICBmb3IgKGludCBjdD0wOyBjdCA8IHByYWdtYUNvdW50OyBjdCs9MikgeworICAgICAgICAgICAgLy9MT0dFKCJwcmFnbWUgJXMgJXMiLCBzdHJbY3RdLCBzdHJbY3QrMV0pOwogICAgICAgICAgICAgaWYgKCFzdHJjbXAoc3RyW2N0XSwgInZlcnNpb24iKSkgewogICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgfQpAQCAtMjA4LDExICszMTIsNiBAQAogICAgICAgICAgICAgICAgICAgICBzLT5tRW52aXJvbWVudC5tVmVydGV4LmNsZWFyKCk7CiAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBQcm9ncmFtVmVydGV4ICogcHYgPSAoUHJvZ3JhbVZlcnRleCAqKXJzYy0+bG9va3VwTmFtZShzdHJbY3QrMV0pOwotICAgICAgICAgICAgICAgIGlmIChwdiAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIHMtPm1FbnZpcm9tZW50Lm1WZXJ0ZXguc2V0KHB2KTsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIExPR0UoIlVucmVjb25pemVkIHZhbHVlICVzIHBhc3NlZCB0byBzdGF0ZVZlcnRleCIsIHN0cltjdCsxXSk7CiAgICAgICAgICAgICB9CiAKQEAgLTIyNCwxMSArMzIzLDYgQEAKICAgICAgICAgICAgICAgICAgICAgcy0+bUVudmlyb21lbnQubVJhc3Rlci5jbGVhcigpOwogICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgUHJvZ3JhbVJhc3RlciAqIHByID0gKFByb2dyYW1SYXN0ZXIgKilyc2MtPmxvb2t1cE5hbWUoc3RyW2N0KzFdKTsKLSAgICAgICAgICAgICAgICBpZiAocHIgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgICAgICBzLT5tRW52aXJvbWVudC5tUmFzdGVyLnNldChwcik7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBMT0dFKCJVbnJlY29uaXplZCB2YWx1ZSAlcyBwYXNzZWQgdG8gc3RhdGVSYXN0ZXIiLCBzdHJbY3QrMV0pOwogICAgICAgICAgICAgfQogCkBAIC0yNDAsMTEgKzMzNCw2IEBACiAgICAgICAgICAgICAgICAgICAgIHMtPm1FbnZpcm9tZW50Lm1GcmFnbWVudC5jbGVhcigpOwogICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgUHJvZ3JhbUZyYWdtZW50ICogcGYgPSAoUHJvZ3JhbUZyYWdtZW50ICopcnNjLT5sb29rdXBOYW1lKHN0cltjdCsxXSk7Ci0gICAgICAgICAgICAgICAgaWYgKHBmICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgcy0+bUVudmlyb21lbnQubUZyYWdtZW50LnNldChwZik7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBMT0dFKCJVbnJlY29uaXplZCB2YWx1ZSAlcyBwYXNzZWQgdG8gc3RhdGVGcmFnbWVudCIsIHN0cltjdCsxXSk7CiAgICAgICAgICAgICB9CiAKQEAgLTI1NiwxMiArMzQ1LDYgQEAKICAgICAgICAgICAgICAgICAgICAgcy0+bUVudmlyb21lbnQubUZyYWdtZW50U3RvcmUuY2xlYXIoKTsKICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIFByb2dyYW1GcmFnbWVudFN0b3JlICogcGZzID0KLSAgICAgICAgICAgICAgICAgICAgKFByb2dyYW1GcmFnbWVudFN0b3JlICopcnNjLT5sb29rdXBOYW1lKHN0cltjdCsxXSk7Ci0gICAgICAgICAgICAgICAgaWYgKHBmcyAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIHMtPm1FbnZpcm9tZW50Lm1GcmFnbWVudFN0b3JlLnNldChwZnMpOwotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgTE9HRSgiVW5yZWNvbml6ZWQgdmFsdWUgJXMgcGFzc2VkIHRvIHN0YXRlU3RvcmUiLCBzdHJbY3QrMV0pOwogICAgICAgICAgICAgfQogCkBAIC0yNzMsMTExICszNTYsNiBAQAogICAgIH0KIH0KIAotc3RhdGljIHZvaWQgYXBwZW5kRWxlbWVudEJvZHkoU3RyaW5nOCAqcywgY29uc3QgRWxlbWVudCAqZSkKLXsKLSAgICBzLT5hcHBlbmQoIiB7XG4iKTsKLSAgICBmb3IgKHNpemVfdCBjdDI9MDsgY3QyIDwgZS0+Z2V0RmllbGRDb3VudCgpOyBjdDIrKykgewotICAgICAgICBjb25zdCBFbGVtZW50ICpjID0gZS0+Z2V0RmllbGQoY3QyKTsKLSAgICAgICAgcy0+YXBwZW5kKCIgICAgIik7Ci0gICAgICAgIHMtPmFwcGVuZChjLT5nZXRDVHlwZSgpKTsKLSAgICAgICAgcy0+YXBwZW5kKCIgIik7Ci0gICAgICAgIHMtPmFwcGVuZChlLT5nZXRGaWVsZE5hbWUoY3QyKSk7Ci0gICAgICAgIHMtPm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CA9IG1Db25zdGFudEJ1ZmZlclR5cGVzW2N0XS5nZXQoKTsKLSAgICAgICAgaWYgKCF0KSB7Ci0gICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgfQotICAgICAgICBjb25zdCBFbGVtZW50ICplID0gdC0+Z2V0RWxlbWVudCgpOwotICAgICAgICBpZiAoZS0+Z2V0TmFtZSgpICYmIChlLT5nZXRGaWVsZENvdW50KCkgPiAxKSkgewotICAgICAgICAgICAgU3RyaW5nOCBzKCJzdHJ1Y3Qgc3RydWN0XyIpOwotICAgICAgICAgICAgcy5hcHBlbmQoZS0+Z2V0TmFtZSgpKTsKLSAgICAgICAgICAgIHMuYXBwZW5kKGUtPmdldENTdHJ1Y3RCb2R5KCkpOwotICAgICAgICAgICAgcy5hcHBlbmQoIjtcbiIpOwotCi0gICAgICAgICAgICBzLmFwcGVuZCgiI2RlZmluZSAiKTsKLSAgICAgICAgICAgIHMuYXBwZW5kKGUtPmdldE5hbWUoKSk7Ci0gICAgICAgICAgICBzLmFwcGVuZCgiX3Qgc3RydWN0IHN0cnVjdF8iKTsKLSAgICAgICAgICAgIHMuYXBwZW5kKGUtPmdldE5hbWUoKSk7Ci0gICAgICAgICAgICBzLmFwcGVuZCgiXG5cbiIpOwotICAgICAgICAgICAgaWYgKHJzYy0+cHJvcHMubUxvZ1NjcmlwdHMpIHsKLSAgICAgICAgICAgICAgICBMT0dWKCIlcyIsIHN0YXRpY19jYXN0PGNvbnN0IGNoYXIqPihzKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBzdHItPmFwcGVuZChzKTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtU2xvdE5hbWVzW2N0XS5sZW5ndGgoKSA+IDApIHsKLSAgICAgICAgICAgIFN0cmluZzggczsKLSAgICAgICAgICAgIGlmIChlLT5nZXROYW1lKCkpIHsKLSAgICAgICAgICAgICAgICAvLyBVc2UgdGhlIG5hbWVkIHN0cnVjdAotICAgICAgICAgICAgICAgIHMuc2V0VG8oZS0+Z2V0TmFtZSgpKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgLy8gY3JlYXRlIGFuIHN0cnVjdCBuYW1lZCBmcm9tIHRoZSBzbG90LgotICAgICAgICAgICAgICAgIHMuc2V0VG8oInN0cnVjdCAiKTsKLSAgICAgICAgICAgICAgICBzLmFwcGVuZChtU2xvdE5hbWVzW2N0XSk7Ci0gICAgICAgICAgICAgICAgcy5hcHBlbmQoIl9zIik7Ci0gICAgICAgICAgICAgICAgcy5hcHBlbmQoZS0+Z2V0Q1N0cnVjdEJvZHkoKSk7Ci0gICAgICAgICAgICAgICAgLy9hcHBlbmRFbGVtZW50Qm9keSgmcywgZSk7Ci0gICAgICAgICAgICAgICAgcy5hcHBlbmQoIjtcbiIpOwotICAgICAgICAgICAgICAgIHMuYXBwZW5kKCJzdHJ1Y3QgIik7Ci0gICAgICAgICAgICAgICAgcy5hcHBlbmQobVNsb3ROYW1lc1tjdF0pOwotICAgICAgICAgICAgICAgIHMuYXBwZW5kKCJfcyIpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBzLmFwcGVuZCgiICogIik7Ci0gICAgICAgICAgICBzLmFwcGVuZChtU2xvdE5hbWVzW2N0XSk7Ci0gICAgICAgICAgICBzLmFwcGVuZCgiO1xuIik7Ci0gICAgICAgICAgICBpZiAocnNjLT5wcm9wcy5tTG9nU2NyaXB0cykgewotICAgICAgICAgICAgICAgIExPR1YoIiVzIiwgc3RhdGljX2Nhc3Q8Y29uc3QgY2hhcio+KHMpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHN0ci0+YXBwZW5kKHMpOwotICAgICAgICB9Ci0gICAgfQotfQogCiAKIG5hbWVzcGFjZSBhbmRyb2lkIHsKQEAgLTQyMCw3ICszOTgsNiBAQAogICAgIHMtPnNldENvbnRleHQocnNjKTsKICAgICBmb3IgKGludCBjdD0wOyBjdCA8IE1BWF9TQ1JJUFRfQkFOS1M7IGN0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CwgZmxvYXQgbWF4U3RvcCwgZmxvYXQgdmFsdWUpCi17Ci0gICAgcmV0dXJuIG1heFN0YXJ0ICsgKG1heFN0YXJ0IC0gbWF4U3RvcCkgKiAoKHZhbHVlIC0gbWluU3RhcnQpIC8gKG1pblN0b3AgLSBtaW5TdGFydCkpOworICAgIGludCBpID0gKGludClmbG9vcih2KTsKKyAgICByZXR1cm4gZm1pbih2IC0gaSwgMHgxLmZmZmZmZXAtMWYpOwogfQogCiAvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KQEAgLTUxMSw2ICsxNzksMjQgQEAKICAgICByZXR1cm4gdGltZWluZm8tPnRtX3llYXI7CiB9CiAKK3N0YXRpYyBpbnQ2NF90IFNDX3VwdGltZU1pbGxpczIoKQoreworICAgIHJldHVybiBuYW5vc2Vjb25kc190b19taWxsaXNlY29uZHMoc3lzdGVtVGltZShTWVNURU1fVElNRV9NT05PVE9OSUMpKTsKK30KKworc3RhdGljIGludDY0X3QgU0Nfc3RhcnRUaW1lTWlsbGlzMigpCit7CisgICAgR0VUX1RMUygpOworICAgIHJldHVybiBzYy0+bUVudmlyb21lbnQubVN0YXJ0VGltZU1pbGxpczsKK30KKworc3RhdGljIGludDY0X3QgU0NfZWxhcHNlZFRpbWVNaWxsaXMyKCkKK3sKKyAgICBHRVRfVExTKCk7CisgICAgcmV0dXJuIG5hbm9zZWNvbmRzX3RvX21pbGxpc2Vjb25kcyhzeXN0ZW1UaW1lKFNZU1RFTV9USU1FX01PTk9UT05JQykpCisgICAgICAgICAgICAtIHNjLT5tRW52aXJvbWVudC5tU3RhcnRUaW1lTWlsbGlzOworfQorCiBzdGF0aWMgaW50MzJfdCBTQ191cHRpbWVNaWxsaXMoKQogewogICAgIHJldHVybiBuYW5vc2Vjb25kc190b19taWxsaXNlY29uZHMoc3lzdGVtVGltZShTWVNURU1f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otICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeDMsIGZsb2F0IHkzLCBmbG9hdCB6MywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHUzLCBmbG9hdCB2MywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHg0LCBmbG9hdCB5NCwgZmxvYXQgejQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB1NCwgZmxvYXQgdjQpCi17Ci0gICAgR0VUX1RMUygpOwotICAgIGlmICghcnNjLT5zZXR1cENoZWNrKCkpIHsKLSAgICAgICAgcmV0dXJuOwotICAgIH0KLQotICAgIC8vTE9HRSgiUXVhZCIpOwotICAgIC8vTE9HRSgiJTQuMmYsICU0LjJmLCAlNC4yZiIsIHgxLCB5MSwgejEpOwotICAgIC8vTE9HRSgiJTQuMmYsICU0LjJmLCAlNC4yZiIsIHgyLCB5MiwgejIpOwotICAgIC8vTE9HRSgiJTQuMmYsICU0LjJmLCAlNC4yZiIsIHgzLCB5MywgejMpOwotICAgIC8vTE9HRSgiJTQuMmYsICU0LjJmLCAlNC4yZiIsIHg0LCB5NCwgejQpOwotCi0gICAgZmxvYXQgdnR4W10gPSB7eDEseTEsejEsIHgyLHkyLHoyLCB4Myx5Myx6MywgeDQseTQsejR9OwotICAgIGNvbnN0IGZsb2F0IHRleFtdID0ge3UxLHYxLCB1Mix2MiwgdTMsdjMsIHU0LHY0fTsKLQotICAgIFZlcnRleEFycmF5IHZhOwotICAgIHZhLmFkZExlZ2FjeShHTF9GTE9BVCwgMywgMTIsIFJTX0tJTkRfUE9TSVRJT04sIGZhbHNlLCAodWludDMyX3QpdnR4KTsKLSAgICB2YS5hZGRMZWdhY3koR0xfRkxPQVQsIDIsIDgsIFJTX0tJTkRfVEVYVFVSRSwgZmFsc2UsICh1aW50MzJfdCl0ZXgpOwotICAgIGlmIChyc2MtPmNoZWNrVmVyc2lvbjJfMCgp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SB5KTsKLSAgICBmbG9hdCBxdiA9IHogKiAoMS4wZiAtIHkgKiBmKTsKLSAgICBmbG9hdCB0diA9IHogKiAoMS4wZiAtIHkgKiAoMS4wZiAtIGYpKTsKLQotICAgIHN3aXRjaCAoaWhmKSB7Ci0gICAgICAgIGNhc2UgMDogICAgICAgICAvLyBSZWQgaXMgdGhlIGRvbWluYW50IGNvbG9yCi0gICAgICAgICAgICByZWQgPSB6OwotICAgICAgICAgICAgZ3JlZW4gPSB0djsKLSAgICAgICAgICAgIGJsdWUgPSBwdjsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDE6ICAgICAgICAgLy8gR3JlZW4gaXMgdGhlIGRvbWluYW50IGNvbG9yCi0gICAgICAgICAgICByZWQgPSBxdjsKLSAgICAgICAgICAgIGdyZWVuID0gejsKLSAgICAgICAgICAgIGJsdWUgPSBwdjsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDI6Ci0gICAgICAgICAgICByZWQgPSBwdjsKLSAgICAgICAgICAgIGdyZWVuID0gejsKLSAgICAgICAgICAgIGJsdWUgPSB0djsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDM6ICAgICAgICAgLy8gQmx1ZSBpcyB0aGUgZG9taW5hbnQgY29sb3IKLSAgICAgICAgICAgIHJlZCA9IHB2OwotICAgICAgICAgICAgZ3JlZW4gPSBxdjsKLSAgICAgICAgICAgIGJsdWUgPSB6OwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgNDoKLSAgICAgICAgICAgIHJlZCA9IHR2OwotICAgICAgICAgICAgZ3JlZW4gPSBwdjsKLSAgICAgICAgICAgIGJsdWUgPSB6OwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgNTogICAgICAgICAvLyBSZWQgaXMgdGhlIGRvbWluYW50IGNvbG9yCi0gICAgICAgICAgICByZWQgPSB6OwotICAgICAgICAgICAgZ3JlZW4gPSBwdjsKL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gIyBib29sCisvLyAgICAgICAgICAgICAgICAgOjo9IGMgICMgY2hhcgorLy8gICAgICAgICAgICAgICAgIDo6PSBhICAjIHNpZ25lZCBjaGFyCisvLyAgICAgICAgICAgICAgICAgOjo9IGggICMgdW5zaWduZWQgY2hhcgorLy8gICAgICAgICAgICAgICAgIDo6PSBzICAjIHNob3J0CisvLyAgICAgICAgICAgICAgICAgOjo9IHQgICMgdW5zaWduZWQgc2hvcnQKKy8vICAgICAgICAgICAgICAgICA6Oj0gaSAgIyBpbnQKKy8vICAgICAgICAgICAgICAgICA6Oj0gaiAgIyB1bnNpZ25lZCBpbnQKKy8vICAgICAgICAgICAgICAgICA6Oj0gbCAgIyBsb25nCisvLyAgICAgICAgICAgICAgICAgOjo9IG0gICMgdW5zaWduZWQgbG9uZworLy8gICAgICAgICAgICAgICAgIDo6PSB4ICAjIGxvbmcgbG9uZywgX19pbnQ2NAorLy8gICAgICAgICAgICAgICAgIDo6PSB5ICAjIHVuc2lnbmVkIGxvbmcgbG9uZywgX19pbnQ2NAorLy8gICAgICAgICAgICAgICAgIDo6PSBmICAjIGZsb2F0CisvLyAgICAgICAgICAgICAgICAgOjo9IGQgICMgZG91YmxlCiAKLSAgICAvLyBtYXRoCi0gICAgeyAibW9kZiIsICh2b2lkICopJmZtb2QsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQsIGZsb2F0KSIgfSwKLSAgICB7ICJhYnMiLCAodm9pZCAqKSZhYnMsCi0gICAgICAgICJpbnQiLCAiKGludCkiIH0sCi0gICAgeyAiYWJzZiIsICh2b2lkICopJmZhYnNmLAotICAgICAgICAiZmxvYXQiLCAiKGZsb2F0KSIgfSwKLSAgICB7ICJzaW5mX2Zhc3QiLCAodm9pZCAqKSZTQ19zaW5mX2Zhc3QsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQpIiB9LAotICAgIHsgImNvc2ZfZmFzdCIsICh2b2lkICopJlNDX2Nvc2ZfZmFzdCwKLSAgICAgICAgImZsb2F0IiwgIihmbG9hdCkiIH0sCi0gICAgeyAic2luZiIsICh2b2lkICopJnNpbmYsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQpIiB9LAotICAgIHsgImNvc2YiLCAodm9pZCAqKSZjb3NmLAotICAgICAgICAiZmxvYXQiLCAiKGZsb2F0KSIgfSwKLSAgICB7ICJhc2luZiIsICh2b2lkICopJmFzaW5mLAotICAgICAgICAiZmxvYXQiLCAiKGZsb2F0KSIgfSwKLSAgICB7ICJhY29zZiIsICh2b2lkICopJmFjb3NmLAotICAgICAgICAiZmxvYXQiLCAiKGZsb2F0KSIgfSwKLSAgICB7ICJhdGFuZiIsICh2b2lkICopJmF0YW5mLAotICAgICAgICAiZmxvYXQiLCAiKGZsb2F0KSIgfSwKLSAgICB7ICJhdGFuMmYiLCAodm9pZCAqKSZhdGFuMmYsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQsIGZsb2F0KSIgfSwKLSAgICB7ICJmYWJzZiIsICh2b2lkICopJmZhYnNmLAotICAgICAgICAiZmxvYXQiLCAiKGZsb2F0KSIgfSwKLSAgICB7ICJyYW5kZiIsICh2b2lkICopJlNDX3JhbmRmLAotICAgICAgICAiZmxvYXQiLCAiKGZsb2F0KSIgfSwKLSAgICB7ICJyYW5kZjIiLCAodm9pZCAqKSZTQ19yYW5kZjIsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQsIGZsb2F0KSIgfSwKLSAgICB7ICJmbG9vcmYiLCAodm9pZCAqKSZmbG9vcmYsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQpIiB9LAotICAgIHsgImZyYWNmIiwgKHZvaWQgKikmU0NfZnJhY2YsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQpIiB9LAotICAgIHsgImNlaWxmIiwgKHZvaWQgKikmY2VpbGYsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQpIiB9LAotICAgIHsgInJvdW5kZiIsICh2b2lkICopJlNDX3JvdW5kZiwKLSAgICAgICAgImZsb2F0IiwgIihmbG9hdCkiIH0sCi0gICAgeyAiZXhwZiIsICh2b2lkICopJmV4cGYsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQpIiB9LAotICAgIHsgImxvZ2YiLCAodm9pZCAqKSZsb2dmLAotICAgICAgICAiZmxvYXQiLCAiKGZsb2F0KSIgfSwKLSAgICB7ICJwb3dmIiwgKHZvaWQgKikmcG93ZiwKLSAgICAgICAgImZsb2F0IiwgIihmbG9hdCwgZmxvYXQpIiB9LAotICAgIHsgIm1heGYiLCAodm9pZCAqKSZTQ19tYXhmLAotICAgICAgICAiZmxvYXQiLCAiKGZsb2F0LCBmbG9hdCkiIH0sCi0gICAgeyAibWluZiIsICh2b2lkICopJlNDX21pbmYsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQsIGZsb2F0KSIgfSwKLSAgICB7ICJzcXJ0IiwgKHZvaWQgKikmc3FydCwKLSAgICAgICAgImludCIsICIoaW50KSIgfSwKLSAgICB7ICJzcXJ0ZiIsICh2b2lkICopJnNxcnRmLAotICAgICAgICAiZmxvYXQiLCAiKGZsb2F0KSIgfSwKLSAgICB7ICJzcXIiLCAodm9pZCAqKSZTQ19zcXIsCi0gICAgICAgICJpbnQiLCAiKGludCkiIH0sCi0gICAgeyAic3FyZiIsICh2b2lkICopJlNDX3NxcmYsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQpIiB9LAotICAgIHsgInNpZ24iLCAodm9pZCAqKSZTQ19zaWduLAotICAgICAgICAiaW50IiwgIihpbnQpIiB9LAotICAgIHsgInNpZ25mIiwgKHZvaWQgKikmU0Nfc2lnbmYsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQpIiB9LAotICAgIHsgImNsYW1wIiwgKHZvaWQgKikmU0NfY2xhbXAsCi0gICAgICAgICJpbnQiLCAiKGludCwgaW50LCBpbnQpIiB9LAotICAgIHsgImNsYW1wZiIsICh2b2lkICopJlNDX2NsYW1wZiwKLSAgICAgICAgImZsb2F0IiwgIihmbG9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CIsICh2b2lkICopJlNDX21vbnRoLAotICAgICAgICAiaW50IiwgIigpIiB9LAotICAgIHsgInllYXIiLCAodm9pZCAqKSZTQ195ZWFyLAotICAgICAgICAiaW50IiwgIigpIiB9LAotICAgIHsgInVwdGltZU1pbGxpcyIsICh2b2lkKikmU0NfdXB0aW1lTWlsbGlzLAotICAgICAgICAiaW50IiwgIigpIiB9LCAgICAgIC8vIFRPRE86IHVzZSBsb25nIGluc3RlYWQKLSAgICB7ICJzdGFydFRpbWVNaWxsaXMiLCAodm9pZCopJlNDX3N0YXJ0VGltZU1pbGxpcywKLSAgICAgICAgImludCIsICIoKSIgfSwgICAgICAvLyBUT0RPOiB1c2UgbG9uZyBpbnN0ZWFkCi0gICAgeyAiZWxhcHNlZFRpbWVNaWxsaXMiLCAodm9pZCopJlNDX2VsYXBzZWRUaW1lTWlsbGlzLAotICAgICAgICAiaW50IiwgIigpIiB9LCAgICAgIC8vIFRPRE86IHVzZSBsb25nIGluc3RlYWQKKyAgICB7ICJyc1NlY29uZCIsICh2b2lkICopJlNDX3NlY29uZCB9LAorICAgIHsgInJzTWludXRlIiwgKHZvaWQgKikmU0NfbWludXRlIH0sCisgICAgeyAicnNIb3VyIiwgKHZvaWQgKikmU0NfaG91ciB9LAorICAgIHsgInJzRGF5IiwgKHZvaWQgKikmU0NfZGF5IH0sCisgICAgeyAicnNNb250aCIsICh2b2lkICopJlNDX21vbnRoIH0sCisgICAgeyAicnNZZWFyIiwgKHZvaWQgKikmU0NfeWVhciB9LAorICAgIHsgInJzVXB0aW1lTWlsbGlzIiwgKHZvaWQqKSZTQ191cHRpbWVNaWxsaXMyIH0sCisgICAgeyAicnNTdGFydFRpbWVNaWxsaXMiLCAodm9pZCopJlNDX3N0YXJ0VGltZU1pbGxpczIgfSwKKyAgICB7ICJyc0VsYXBzZWRUaW1lTWlsbGlzIiwgKHZvaWQqKSZTQ19lbGFwc2VkVGltZU1pbGxpczIgfSwKKworICAgIHsgInJzU2VuZFRvQ2xpZ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QgU0NfY2x6X3UzMih1aW50MzJfdCB2KSB7cmV0dXJuIF9fYnVpbHRpbl9jbHoodik7fQorc3RhdGljIHVpbnQxNl90IFNDX2Nsel91MTYodWludDE2X3Qgdikge3JldHVybiAodWludDE2X3QpX19idWlsdGluX2Nseih2KTt9CitzdGF0aWMgdWludDhfdCBTQ19jbHpfdTgodWludDhfdCB2KSB7cmV0dXJuICh1aW50OF90KV9fYnVpbHRpbl9jbHoodik7fQorc3RhdGljIGludDMyX3QgU0NfY2x6X2kzMihpbnQzMl90IHYpIHtyZXR1cm4gKGludDMyX3QpX19idWlsdGluX2NseigodWludDMyX3Qpdik7fQorc3RhdGljIGludDE2X3QgU0NfY2x6X2kxNihpbnQxNl90IHYpIHtyZXR1cm4gKGludDE2X3QpX19idWlsdGluX2Nseih2KTt9CitzdGF0aWMgaW50OF90IFNDX2Nsel9pOChpbnQ4X3Qgdikge3JldHVybiAoaW50OF90KV9fYnVpbHRpbl9jbHoodik7fQorCitzdGF0aWMgdWludDMyX3QgU0NfbWF4X3UzMih1aW50MzJfdCB2LCB1aW50MzJfdCB2Mikge3JldHVybiByc01heCh2LCB2Mik7fQorc3RhdGljIHVpbnQxNl90IFNDX21heF91MTYodWludDE2X3QgdiwgdWludDE2X3QgdjIpIHtyZXR1cm4gcnNNYXgodiwgdjIpO30KK3N0YXRpYyB1aW50OF90IFNDX21heF91OCh1aW50OF90IHYsIHVpbnQ4X3QgdjIpIHtyZXR1cm4gcnNNYXgodiwgdjIpO30KK3N0YXRpYyBpbnQzMl90IFNDX21heF9pMzIoaW50MzJfdCB2LCBpbnQzMl90IHYyKSB7cmV0dXJuIHJzTWF4KHYsIHYyKTt9CitzdGF0aWMgaW50MTZfdCBTQ19tYXhfaTE2KGludDE2X3QgdiwgaW50MTZfdCB2Mikge3JldHVybiByc01heCh2LCB2Mik7fQorc3RhdGljIGludDhfdCBTQ19tYXhfaTgoaW50OF90IHYsIGludDhfdCB2Mikge3JldHVybiByc01heCh2LCB2Mik7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8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KKworLy8gbGx2bSBuYW1lIG1hbmdsaW5nIHJlZgorLy8gIDxidWlsdGluLXR5cGU+IDo6PSB2ICAjIHZvaWQKKy8vICAgICAgICAgICAgICAgICA6Oj0gYiAgIyBib29sCisvLyAgICAgICAgICAgICAgICAgOjo9IGMgICMgY2hhcgorLy8gICAgICAgICAgICAgICAgIDo6PSBhICAjIHNpZ25lZCBjaGFyCisvLyAgICAgICAgICAgICAgICAgOjo9IGggICMgdW5zaWduZWQgY2hhcgorLy8gICAgICAgICAgICAgICAgIDo6PSBzICAjIHNob3J0CisvLyAgICAgICAgICAgICAgICAgOjo9IHQgICMgdW5zaWduZWQgc2hvcnQKKy8vICAgICAgICAgICAgICAgICA6Oj0gaSAgIyBpbnQKKy8vICAgICAgICAgICAgICAgICA6Oj0gaiAgIyB1bnNpZ25lZCBpbnQKKy8vICAgICAgICAgICAgICAgICA6Oj0gbCAgIyBsb25nCisvLyAgICAgICAgICAgICAgICAgOjo9IG0gICMgdW5zaWduZWQgbG9uZworLy8gICAgICAgICAgICAgICAgIDo6PSB4ICAjIGxvbmcgbG9uZywgX19pbnQ2NAorLy8gICAgICAgICAgICAgICAgIDo6PSB5ICAjIHVuc2lnbmVkIGxvbmcgbG9uZywgX19pbnQ2NAorLy8gICAgICAgICAgICAgICAgIDo6PSBmICAjIGZsb2F0CisvLyAgICAgICAgICAgICAgICAgOjo9IGQgICMgZG91YmxlCisKK3N0YXRpYyBTY3JpcHRDU3RhdGU6OlN5bWJvbFRhYmxlX3QgZ1N5bXNbXSA9IHsKKyAgICAvLyBPcGVuQ0wgbWF0aAorICAgIHsgIl9aNGFjb3NmIiwgKHZvaWQgKikmYWNvc2YgfSwKKyAgICB7ICJfWjVhY29zaGYiLCAodm9pZCAqKSZhY29zaGYgfSwKKyAgICB7ICJfWjZhY29zcGlmIiwgKHZvaWQgKikmU0NfYWNvc3BpIH0sCisgICAgeyAiX1o0YXNpbmYiLCA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8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisKK3N0YXRpYyB2b2lkIFNDX2JpbmRUZXh0dXJlKFJzUHJvZ3JhbUZyYWdtZW50IHZwZiwgdWludDMyX3Qgc2xvdCwgUnNBbGxvY2F0aW9uIHZhKQoreworICAgIEdFVF9UTFMoKTsKKyAgICByc2lfUHJvZ3JhbUJpbmRUZXh0dXJlKHJzYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0PFByb2dyYW1GcmFnbWVudCAqPih2cGYpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgc2xvdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0PEFsbG9jYXRpb24gKj4odmEpKTsKKworfQorCitzdGF0aWMgdm9pZCBTQ19iaW5kU2FtcGxlcihSc1Byb2dyYW1GcmFnbWVudCB2cGYsIHVpbnQzMl90IHNsb3QsIFJzU2FtcGxlciB2cykKK3sKKyAgICBHRVRfVExTKCk7CisgICAgcnNpX1Byb2dyYW1CaW5kU2FtcGxlcihyc2MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0aWNfY2FzdDxQcm9ncmFtRnJhZ21lbnQgKj4odnBmKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHNsb3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0aWNfY2FzdDxTYW1wbGVyICo+KHZzKSk7CisKK30KKworc3RhdGljIHZvaWQgU0NfYmluZFByb2dyYW1TdG9yZShSc1Byb2dyYW1TdG9yZSBwZnMpCit7CisgICAgR0VUX1RMUygpOworICAgIHJzaV9Db250ZXh0QmluZFByb2dyYW1TdG9yZShyc2MsIHBmcyk7Cit9CisKK3N0YXRpYyB2b2lkIFNDX2JpbmRQcm9ncmFtRnJhZ21lbnQoUnNQcm9ncmFtRnJhZ21lbnQgcGYpCit7CisgICAgR0VUX1RMUygpOworICAgIHJzaV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Ly8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisKK3N0YXRpYyB2b2lkIFNDX2RyYXdRdWFkVGV4Q29vcmRzKGZsb2F0IHgxLCBmbG9hdCB5MSwgZmxvYXQgejEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB1MSwgZmxvYXQgdjEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB4MiwgZmxvYXQgeTIsIGZsb2F0IHoyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdTIsIGZsb2F0IHYyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeDMsIGZsb2F0IHkzLCBmbG9hdCB6MywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHUzLCBmbG9hdCB2MywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHg0LCBmbG9hdCB5NCwgZmxvYXQgejQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB1NCwgZmxvYXQgdjQpCit7CisgICAgR0VUX1RMUygpOworICAgIGlmICghcnNjLT5zZXR1cENoZWNrKCkpIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIC8vTE9HRSgiUXVhZCIpOworICAgIC8vTE9HRSgiJTQuMmYsICU0LjJmLCAlNC4yZiIsIHgxLCB5MSwgejEpOworICAgIC8vTE9HRSgiJTQuMmYsICU0LjJmLCAlNC4yZiIsIHgyLCB5MiwgejIpOworICAgIC8vTE9HRSgiJTQuMmYsICU0LjJmLCAlNC4yZiIsIHgzLCB5MywgejMpOworICAgIC8vTE9HRSgiJTQuMmYsICU0LjJmLCAlNC4yZiIsIHg0LCB5NCwgejQpOworCisgICAgZmxvYXQgdnR4W10gPSB7eDEseTEsejEsIHgyLHkyLHoyLCB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UTFMoKTsKKyAgICBPYmplY3RCYXNlUmVmPGNvbnN0IFByb2dyYW1WZXJ0ZXg+IHRtcChyc2MtPmdldFZlcnRleCgpKTsKKyAgICByc2MtPnNldFZlcnRleChyc2MtPmdldERlZmF1bHRQcm9ncmFtVmVydGV4KCkpOworICAgIC8vcnNjLT5zZXR1cENoZWNrKCk7CisKKyAgICAvL0dMaW50IGNyb3BbNF0gPSB7MCwgaCwgdywgLWh9OworCisgICAgZmxvYXQgc2ggPSByc2MtPmdldEhlaWdodCgpOworCisgICAgU0NfZHJhd1F1YWQoeCwgICBzaCAtIHksICAgICB6LAorICAgICAgICAgICAgICAgIHgrdywgc2ggLSB5LCAgICAgeiwKKyAgICAgICAgICAgICAgICB4K3csIHNoIC0gKHkraCksIHosCisgICAgICAgICAgICAgICAgeCwgICBzaCAtICh5K2gpLCB6KTsKKyAgICByc2MtPnNldFZlcnRleCgoUHJvZ3JhbVZlcnRleCAqKXRtcC5nZXQoKSk7Cit9CisvKgorc3RhdGljIHZvaWQgU0NfZHJhd1Nwcml0ZShmbG9hdCB4LCBmbG9hdCB5LCBmbG9hdCB6LCBmbG9hdCB3LCBmbG9hdCBoKQoreworICAgIEdFVF9UTFMoKTsKKyAgICBmbG9hdCB2aW5bM10gPSB7eCwgeSwgen07CisgICAgZmxvYXQgdm91dFs0XTsKKworICAgIC8vTE9HRSgiZHMgIGluICVmICVmICVmIiwgeCwgeSwgeik7CisgICAgcnNjLT5nZXRWZXJ0ZXgoKS0+dHJhbnNmb3JtVG9TY3JlZW4ocnNjLCB2b3V0LCB2aW4pOworICAgIC8vTE9HRSgiZHMgIG91dCAlZiAlZiAlZiAlZiIsIHZvdXRbMF0sIHZvdXRbMV0sIHZvdXRbMl0sIHZvdXRbM10pOworICAgIHZvdXRbMF0gLz0gdm91dFszXTsKKyAgICB2b3V0WzFdIC89IHZvdXRbM107CisgICAgdm91dFsyXSAvPSB2b3V0WzNdOworCisgICAgdm91dFswXSAqPSByc2MtPmdldFdpZH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wbG9hZFRvVGV4dHVyZShyc2MsIHZhLCBmYWxzZSwgYmFzZU1pcExldmVsKTsKK30KK3N0YXRpYyB2b2lkIFNDX3VwbG9hZFRvVGV4dHVyZShSc0FsbG9jYXRpb24gdmEpCit7CisgICAgR0VUX1RMUygpOworICAgIHJzaV9BbGxvY2F0aW9uVXBsb2FkVG9UZXh0dXJlKHJzYywgdmEsIGZhbHNlLCAwKTsKK30KKworc3RhdGljIHZvaWQgU0NfdXBsb2FkVG9CdWZmZXJPYmplY3QoUnNBbGxvY2F0aW9uIHZhKQoreworICAgIEdFVF9UTFMoKTsKKyAgICByc2lfQWxsb2NhdGlvblVwbG9hZFRvQnVmZmVyT2JqZWN0KHJzYywgdmEpOworfQorCitzdGF0aWMgdm9pZCBTQ19DbGVhckNvbG9yKGZsb2F0IHIsIGZsb2F0IGcsIGZsb2F0IGIsIGZsb2F0IGEpCit7CisgICAgR0VUX1RMUygpOworICAgIGlmICghcnNjLT5zZXR1cENoZWNrKCkpIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGdsQ2xlYXJDb2xvcihyLCBnLCBiLCBhKTsKKyAgICBnbENsZWFyKEdMX0NPTE9SX0JVRkZFUl9CSVQpOworfQorCitzdGF0aWMgdm9pZCBTQ19DbGVhckRlcHRoKGZsb2F0IHYpCit7CisgICAgR0VUX1RMUygpOworICAgIGlmICghcnNjLT5zZXR1cENoZWNrKCkpIHsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGdsQ2xlYXJEZXB0aGYodik7CisgICAgZ2xDbGVhcihHTF9ERVBUSF9CVUZGRVJfQklUKTsKK30KKworc3RhdGljIHVpbnQzMl90IFNDX2dldFdpZHRoKCkKK3sKKyAgICBHRVRfVExTKCk7CisgICAgcmV0dXJuIHJzYy0+Z2V0V2lkdGgoKTsKK30KKworc3RhdGljIHVpbnQzMl90IFNDX2dldEhlaWdodCgpCit7CisgICAgR0VUX1RMUygpOworICAgIHJldHVybiByc2MtPmdldEhla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AgICA6Oj0gcyAgIyBzaG9ydAorLy8gICAgICAgICAgICAgICAgIDo6PSB0ICAjIHVuc2lnbmVkIHNob3J0CisvLyAgICAgICAgICAgICAgICAgOjo9IGkgICMgaW50CisvLyAgICAgICAgICAgICAgICAgOjo9IGogICMgdW5zaWduZWQgaW50CisvLyAgICAgICAgICAgICAgICAgOjo9IGwgICMgbG9uZworLy8gICAgICAgICAgICAgICAgIDo6PSBtICAjIHVuc2lnbmVkIGxvbmcKKy8vICAgICAgICAgICAgICAgICA6Oj0geCAgIyBsb25nIGxvbmcsIF9faW50NjQKKy8vICAgICAgICAgICAgICAgICA6Oj0geSAgIyB1bnNpZ25lZCBsb25nIGxvbmcsIF9faW50NjQKKy8vICAgICAgICAgICAgICAgICA6Oj0gZiAgIyBmbG9hdAorLy8gICAgICAgICAgICAgICAgIDo6PSBkICAjIGRvdWJsZQorCitzdGF0aWMgU2NyaXB0Q1N0YXRlOjpTeW1ib2xUYWJsZV90IGdTeW1zW10gPSB7CisgICAgeyAicnNnQmluZFByb2dyYW1GcmFnbWVudCIsICh2b2lkICopJlNDX2JpbmRQcm9ncmFtRnJhZ21lbnQgfSwKKyAgICB7ICJyc2dCaW5kUHJvZ3JhbVN0b3JlIiwgKHZvaWQgKikmU0NfYmluZFByb2dyYW1TdG9yZSB9LAorICAgIHsgInJzZ0JpbmRQcm9ncmFtVmVydGV4IiwgKHZvaWQgKikmU0NfYmluZFByb2dyYW1WZXJ0ZXggfSwKKyAgICB7ICJyc2dCaW5kUHJvZ3JhbVJhc3RlciIsICh2b2lkICopJlNDX2JpbmRQcm9ncmFtUmFzdGVyIH0sCisgICAgeyAicnNnQmluZFNhbXBsZXIiLCAodm9pZCAqKSZTQ19iaW5kU2FtcGxlciB9LAorICAgIHsgInJzZ0JpbmRUZXh0dXJlIiwgKHZvaWQgKikmU0NfYmluZFRleHR1cmUgfSwKKworICAgIHsgInJzZ1Byb2dyYW1WZXJ0ZXhMb2FkTW9kZWxNYXRyaXgiLCAod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KworU2lnbmFsOjpTaWduYWwoKQoreworICAgIG1TZXQgPSB0cnVlOworfQorCitTaWduYWw6On5TaWduYWwoKQoreworICAgIHB0aHJlYWRfbXV0ZXhfZGVzdHJveSgmbU11dGV4KTsKKyAgICBwdGhyZWFkX2NvbmRfZGVzdHJveSgmbUNvbmRpdGlvbik7Cit9CisKK2Jvb2wgU2lnbmFsOjppbml0KCkKK3sKKyAgICBpbnQgc3RhdHVzID0gcHRocmVhZF9tdXRleF9pbml0KCZtTXV0ZXgsIE5VTEwpOworICAgIGlmIChzdGF0dXMpIHsKKyAgICAgICAgTE9HRSgiTG9ja2xlc3NGaWZvIG11dGV4IGluaXQgZmFpbHVyZSIpOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgc3RhdHVzID0gcHRocmVhZF9jb25kX2luaXQoJm1Db25kaXRpb24sIE5VTEwpOworICAgIGlmIChzdGF0dXMpIHsKKyAgICAgICAgTE9HRSgiTG9ja2xlc3NGaWZvIGNvbmRpdGlvbiBpbml0IGZhaWx1cmUiKTsKKyAgICAgICAgcHRocmVhZF9tdXRleF9kZXN0cm95KCZtTXV0ZXgpOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgcmV0dXJuIHRydWU7Cit9CisKK3ZvaWQgU2lnbmFsOjpzZXQoKQoreworICAgIGludCBzdGF0dXM7CisKKyAgICBzdGF0dXMgPSBwdGhyZWFkX211dGV4X2xvY2soJm1NdXRleCk7CisgICAgaWYgKHN0YXR1cykgeworICAgICAgICBMT0dFKCJMb2NrbGVzc0NvbW1hbmRGaWZvOiBlcnJvciAlaSBsb2NraW5nIGZvciBzZXQgY29uZGl0aW9uLiIsIHN0YXR1cyk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBtU2V0ID0gdHJ1ZTsKKworICAgIHN0YXR1cyA9IHB0aHJlYWRfY29uZF9zaWduYWwoJm1Db25kaXRpb24pOworICAgIGlmIChzdGF0dXMpIHsKKyAgICAgICA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1N0cmVhbTo6T1N0cmVhbSh1aW50NjRfdCBsZW4sIGJvb2wgdXNlNjQpCit7CisgICAgbURhdGEgPSAodWludDhfdCopbWFsbG9jKGxlbik7CisgICAgbUxlbmd0aCA9IGxlbjsKKyAgICBtUG9zID0gMDsKKyAgICBtVXNlNjQgPSB1c2U2NDsKK30KKworT1N0cmVhbTo6fk9TdHJlYW0oKQoreworICAgIGZyZWUobURhdGEpOworfQorCit2b2lkIE9TdHJlYW06OmFkZEJ5dGVBcnJheShjb25zdCB2b2lkICpzcmMsIHNpemVfdCBudW1CeXRlcykKK3sKKyAgICAvLyBXZSBuZWVkIHRvIHBvdGVudGlhbGx5IGdyb3cgbW9yZSB0aGFuIG9uY2UgaWYgdGhlIG51bWJlciBvZiBieWVzIHdlIHdyaXRlIGlzIHN1YnN0YW50aWFsCisgICAgd2hpbGUobVBvcyArIG51bUJ5dGVzID49IG1MZW5ndGgpIHsKKyAgICAgICAgZ3Jvd1NpemUoKTsKKyAgICB9CisgICAgbWVtY3B5KG1EYXRhICsgbVBvcywgc3JjLCBudW1CeXRlcyk7CisgICAgbVBvcyArPSBudW1CeXRlczsKK30KKwordm9pZCBPU3RyZWFtOjphZGRPZmZzZXQodWludDY0X3QgdikKK3sKKyAgICBpZiAobVVzZTY0KSB7CisgICAgICAgIG1Qb3MgPSAobVBvcyArIDcpICYgKH43KTsKKyAgICAgICAgaWYobVBvcyArIHNpemVvZih2KSA+PSBtTGVuZ3RoKSB7CisgICAgICAgICAgICBncm93U2l6ZSgpOworICAgICAgICB9CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkodiAmIDB4ZmYpOworICAgICAgICBtRGF0YVttUG9zKytdID0gKHVpbnQ4X3QpKCh2ID4+IDgpICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gMTYpICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gMjQpICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gMzIpICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gNDApICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gNDgpICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gNTYpICYgMHhmZik7CisgICAgfQorICAgIGVsc2UgeworICAgICAgICBhZGRVMzIodik7CisgICAgfQorfQorCit2b2lkIE9TdHJlYW06OmFkZFN0cmluZyhTdHJpbmc4ICpzKQoreworICAgIHVpbnQzMl90IGxlbiA9IHMtPnNpemUoKTsKKyAgICBhZGRVMzIobGVuKTsKKyAgICBpZihtUG9zICsgbGVuKnNpemVvZihjaGFyKSA+PSBtTGVuZ3RoKSB7CisgICAgICAgIGdyb3dTaXplKCk7CisgICAgfQorICAgIGNoYXIgKnN0cmluZ0RhdGEgPSByZWludGVycHJldF9jYXN0PGNoYXIgKj4oJm1EYXRhW21Qb3NdKTsKKyAgICBmb3IodWludDMyX3QgaSA9IDA7IGkgPCBsZW47IGkgKyspIHsKKyAgICAgICAgc3RyaW5nRGF0YVtpXSA9IHMtPnN0cmluZygpW2ldOworICAgIH0KKyAgICBtUG9zICs9IGxlbipzaXplb2YoY2hhcik7Cit9CisKK3ZvaWQgT1N0cmVhbTo6Z3Jvd1NpemUoKQoreworICAgIHVpbnQ4X3QgKm5ld0RhdGEgPSAodWludDhfdCopbWFsbG9jKG1MZW5ndGgqMik7CisgICAgbWVtY3B5KG5ld0RhdGEsIG1EYXRhLCBtTGVuZ3RoKnNpemVvZih1aW50OF90KSk7CisgICAgbUxlbmd0aCA9IG1MZW5ndGggKiAyOworICAgIGZyZWUobURhdGEpOworICAgIG1EYXRhID0gbmV3RGF0YTsKK30KKworCmRpZmYgLS1naXQgYS9saWJzL3JzL3JzU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gdG1wOworICAgIH0KKyAgICB1aW50MTZfdCBsb2FkVTE2KCkgeworICAgICAgICBtUG9zID0gKG1Qb3MgKyAxKSAmICh+MSk7CisgICAgICAgIHVpbnQxNl90IHRtcCA9IHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgdWludDE2X3QgKj4oJm1EYXRhW21Qb3NdKVswXTsKKyAgICAgICAgbVBvcyArPSBzaXplb2YodWludDE2X3QpOworICAgICAgICByZXR1cm4gdG1wOworICAgIH0KKyAgICBpbmxpbmUgdWludDhfdCBsb2FkVTgoKSB7CisgICAgICAgIHVpbnQ4X3QgdG1wID0gcmVpbnRlcnByZXRfY2FzdDxjb25zdCB1aW50OF90ICo+KCZtRGF0YVttUG9zXSlbMF07CisgICAgICAgIG1Qb3MgKz0gc2l6ZW9mKHVpbnQ4X3QpOworICAgICAgICByZXR1cm4gdG1wOworICAgIH0KKyAgICB2b2lkIGxvYWRCeXRlQXJyYXkodm9pZCAqZGVzdCwgc2l6ZV90IG51bUJ5dGVzKTsKKyAgICB1aW50NjRfdCBsb2FkT2Zmc2V0KCk7CisgICAgdm9pZCBsb2FkU3RyaW5nKFN0cmluZzggKnMpOworICAgIHVpbnQ2NF90IGdldFBvcygpIGNvbnN0IHsKKyAgICAgICAgcmV0dXJuIG1Qb3M7CisgICAgfQorICAgIHZvaWQgcmVzZXQodWludDY0X3QgcG9zKSB7CisgICAgICAgIG1Qb3MgPSBwb3M7CisgICAgfQorICAgIHZvaWQgcmVzZXQoKSB7CisgICAgICAgIG1Qb3MgPSAwOworICAgIH0KKyAgICAKKyAgICBjb25zdCB1aW50OF90ICogZ2V0UHRyKCkgY29uc3QgeworICAgICAgICByZXR1cm4gbURhdGE7CisgICAgfQorcHJvdGVjdGVkOgorICAgIGNvbnN0IHVpbnQ4X3QgKiBtRGF0YTsKKyAgICB1aW50NjRfdCBtUG9zOworICAgIGJvb2wgbVVzZTY0OworfTsKKworY2xhc3MgT1N0cmVhbQoreworcHVibGljOgorICAgIE9TdHJlYW0odWludDY0X3QgbGVuZ3RoLCBib29sIHVzZTY0KTsKKyAgICB+T1N0cmVhbSgpOworICAgIAorICAgIHZvaWQgYWxpZ24odWludDMyX3QgYnl0ZXMpIHsKKyAgICAgICAgbVBvcyA9IChtUG9zICsgKGJ5dGVzIC0gMSkpICYgKH4oYnl0ZXMgLSAxKSk7CisgICAgICAgIGlmKG1Qb3MgPj0gbUxlbmd0aCkgeworICAgICAgICAgICAgZ3Jvd1NpemUoKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICB2b2lkIGFkZEYoZmxvYXQgdikgeworICAgICAgICB1aW50MzJfdCB1aW50ViA9ICpyZWludGVycHJldF9jYXN0PHVpbnQzMl90Kj4gKCZ2KTsKKyAgICAgICAgYWRkVTMyKHVpbnRWKTsKKyAgICB9CisgICAgdm9pZCBhZGRJMzIoaW50MzJfdCB2KSB7CisgICAgICAgIG1Qb3MgPSAobVBvcyArIDMpICYgKH4zKTsKKyAgICAgICAgaWYobVBvcyArIHNpemVvZih2KSA+PSBtTGVuZ3RoKSB7CisgICAgICAgICAgICBncm93U2l6ZSgpOworICAgICAgICB9CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkodiAmIDB4ZmYpOworICAgICAgICBtRGF0YVttUG9zKytdID0gKHVpbnQ4X3QpKCh2ID4+IDgpICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gMTYpICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gMjQpICYgMHhmZik7CisgICAgfQorICAgIHZvaWQgYWRkVTMyKHVpbnQzMl90IHYpIHsKKyAgICAgICAgbVBvcyA9IChtUG9zICsgMykgJiAofjMpOworICAgICAgICBpZihtUG9zICsgc2l6ZW9mKHYpID49IG1MZW5ndGgpIHsKKyAgICAgICAgICAgIGdyb3dTaXplKCk7CisgICAgICAgIH0KKyAgICAgICAgbURhdGFbbVBvcysrXSA9ICh1aW50OF90KSh2ICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gOCkgJiAweGZmKTsKKyAgICAgICAgbURhdGFbbVBvcysrXSA9ICh1aW50OF90KSgodiA+PiAxNikgJiAweGZmKTsKKyAgICAgICAgbURhdGFbbVBvcysrXSA9ICh1aW50OF90KSgodiA+PiAyNCkgJiAweGZmKTsKKyAgICB9CisgICAgdm9pZCBhZGRVMTYodWludDE2X3QgdikgeworICAgICAgICBtUG9zID0gKG1Qb3MgKyAxKSAmICh+MSk7CisgICAgICAgIGlmKG1Qb3MgKyBzaXplb2YodikgPj0gbUxlbmd0aCkgeworICAgICAgICAgICAgZ3Jvd1NpemUoKTsKKyAgICAgICAgfQorICAgICAgICBtRGF0YVttUG9zKytdID0gKHVpbnQ4X3QpKHYgJiAweGZmKTsKKyAgICAgICAgbURhdGFbbVBvcysrXSA9ICh1aW50OF90KSh2ID4+IDgpOworICAgIH0KKyAgICBpbmxpbmUgdm9pZCBhZGRVOCh1aW50OF90IHYpIHsKKyAgICAgICAgaWYobVBvcyArIDEgPj0gbUxlbmd0aCkgeworICAgICAgICAgICAgZ3Jvd1NpemUoKTsKKyAgICAgICAgfQorICAgICAgICByZWludGVycHJldF9jYXN0PHVpbnQ4X3QgKj4oJm1EYXRhW21Qb3NdKVswXSA9IHY7CisgICAgICAgIG1Qb3MgKys7CisgICAgfQorICAgIHZvaWQgYWRkQnl0ZUFycmF5KGNvbnN0IHZvaWQgKnNyYywgc2l6ZV90IG51bUJ5dGVzKTsKKyAgICB2b2lkIGFkZE9mZnNldCh1aW50NjRfdCB2KTsKKyAgICB2b2lkIGFkZFN0cmluZyhTdHJpbmc4ICpzKTsKKyAgICB1aW50NjRfdCBnZXRQb3MoKSBjb25zdCB7CisgICAgICAgIHJldHVybiBtUG9zOworICAgIH0KKyAgICB2b2lkIHJlc2V0KHVpbnQ2NF90IHBvcykgeworICAgICAgICBtUG9zID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AgICAgZGVsZXRlIFtdIG1MT0RzOworICAgICAgICBpZihtTE9Ecyl7CisgICAgICAgICAgICBkZWxldGUgW10gbUxPRHM7CisgICAgICAgIH0gICAgICAgIAogICAgICAgICBtTE9EcyA9IG5ldyBMT0RbbUxPRENvdW50XTsKICAgICB9CiAKQEAgLTE0MywxMzEgKzE1MCwyMiBAQAogICAgIGZvciAodWludDMyX3QgY3Q9MDsgY3QgPCBnZXRFbGVtZW50KCktPmdldEZpZWxkQ291bnQoKTsgY3QrKykgewogICAgICAgICBjb25zdCBDb21wb25lbnQgJmMgPSBnZXRFbGVtZW50KCktPmdldEZpZWxkKGN0KS0+Z2V0Q29tcG9uZW50KCk7CiAKLSAgICAgICAgc3dpdGNoKGMuZ2V0S2luZCgpKSB7Ci0gICAgICAgIGNhc2UgUlNfS0lORF9VU0VSOgotICAgICAgICAgICAgbUdMLm1Vc2VyW3VzZXJOdW1dLnNpemUgPSBjLmdldFZlY3RvclNpemUoKTsKLSAgICAgICAgICAgIG1HTC5tVXNlclt1c2VyTnVtXS5vZmZzZXQgPSBtRWxlbWVudC0+Z2V0RmllbGRPZmZzZXRCeXRlcyhjdCk7Ci0gICAgICAgICAgICBtR0wubVVzZXJbdXNlck51bV0udHlwZSA9IGMuZ2V0R0xUeXBlKCk7Ci0gICAgICAgICAgICBtR0wubVVzZXJbdXNlck51bV0ubm9ybWFsaXplZCA9IGMuZ2V0VHlwZSgpICE9IFJTX1RZUEVfRkxPQVRfMzI7Ly9jLmdldElzTm9ybWFsaXplZCgpOwotICAgICAgICAgICAgbUdMLm1Vc2VyW3VzZXJOdW1dLm5hbWUuc2V0VG8oZ2V0RWxlbWVudCgpLT5nZXRGaWVsZE5hbWUoY3QpKTsKLSAgICAgICAgICAgIHVzZXJOdW0gKys7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIFJTX0tJTkRfUE9TSVRJT046Ci0gICAgICAgICAgICByc0Fzc2VydChtR0wubVZ0eC5zaXplID09IDApOw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ICAgICAgICBtR0wubU5vcm0udHlwZSA9IGMuZ2V0R0xUeXBlKCk7Ci0gICAgICAgICAgICBtR0wubU5vcm0ubm9ybWFsaXplZCA9IGZhbHNlOwotICAgICAgICAgICAgbUdMLm1Ob3JtLm5hbWUuc2V0VG8oIk5vcm1hbCIpOwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBSU19LSU5EX1RFWFRVUkU6Ci0gICAgICAgICAgICByc0Fzc2VydChtR0wubVRleC5zaXplID09IDApOwotICAgICAgICAgICAgbUdMLm1UZXguc2l6ZSA9IGMuZ2V0VmVjdG9yU2l6ZSgpOwotICAgICAgICAgICAgbUdMLm1UZXgub2Zmc2V0ID0gbUVsZW1lbnQtPmdldEZpZWxkT2Zmc2V0Qnl0ZXMoY3QpOwotICAgICAgICAgICAgbUdMLm1UZXgudHlwZSA9IGMuZ2V0R0xUeXBlKCk7Ci0gICAgICAgICAgICBtR0wubVRleC5ub3JtYWxpemVkID0gZmFsc2U7Ci0gICAgICAgICAgICBtR0wubVRleC5uYW1lLnNldFRvKCJUZXh0dXJlIik7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIFJTX0tJTkRfUE9JTlRfU0laRToKLSAgICAgICAgICAgIHJzQXNzZXJ0KCFtR0wubVBvaW50U2l6ZS5zaXplKTsKLSAgICAgICAgICAgIG1HTC5tUG9pbnRTaXplLnNpemUgPSBjLmdldFZlY3RvclNpemUoKTsKLSAgICAgICAgICAgIG1HTC5tUG9pbnRTaXplLm9mZnNldCA9IG1FbGVtZW50LT5nZXRGaWVsZE9mZnNldEJ5dGVzKGN0KTsKLSAgICAgICAgICAgIG1HTC5tUG9pbnRTaXplLnR5cGUgPSBjLmdldEdMVHlwZSgpOwotICAgICAgICAgICAgbUdMLm1Qb2ludFNpemUubm9ybWFsaXplZCA9IGZhbHNlOwotICAgICAgICAgICAgbUdMLm1Qb2ludFNpemUubmFtZS5zZXRUbygiUG9pbnRTaXplIik7Ci0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NpemUpIHsKLSAgICAgICAgdmEtPmFkZExlZ2FjeShtR0wubVZ0eC50eXBlLAotICAgICAgICAgICAgICAgICAgICAgIG1HTC5tVnR4LnNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgc3RyaWRlLAotICAgICAgICAgICAgICAgICAgICAgIFJTX0tJTkRfUE9TSVRJT04sCi0gICAgICAgICAgICAgICAgICAgICAgZmFsc2UsCi0gICAgICAgICAgICAgICAgICAgICAgbUdMLm1WdHgub2Zmc2V0KTsKLSAgICB9Ci0KLSAgICBpZiAobUdMLm1Ob3JtLnNpemUpIHsKLSAgICAgICAgdmEtPmFkZExlZ2FjeShtR0wubU5vcm0udHlwZSwKLSAgICAgICAgICAgICAgICAgICAgIDMsCi0gICAgICAgICAgICAgICAgICAgICBzdHJpZGUsCi0gICAgICAgICAgICAgICAgICAgICBSU19LSU5EX05PUk1BTCwKLSAgICAgICAgICAgICAgICAgICAgIGZhbHNlLAotICAgICAgICAgICAgICAgICAgICAgbUdMLm1Ob3JtLm9mZnNldCk7Ci0gICAgfQotCi0gICAgaWYgKG1HTC5tQ29sb3Iuc2l6ZSkgewotICAgICAgICB2YS0+YWRkTGVnYWN5KG1HTC5tQ29sb3IudHlwZSwKLSAgICAgICAgICAgICAgICAgICAgIG1HTC5tQ29sb3Iuc2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgIHN0cmlkZSwKLSAgICAgICAgICAgICAgICAgICAgIFJTX0tJTkRfQ09MT1IsCi0gICAgICAgICAgICAgICAgICAgICB0cnVlLAotICAgICAgICAgICAgICAgICAgICAgbUdMLm1Db2xvci5vZmZzZXQpOwotICAgIH0KLQotICAgIGlmIChtR0wubVRleC5zaXplKSB7Ci0gICAgICAgIHZhLT5hZGRMZWdhY3kobUdMLm1UZXgudHlwZSwKLSAgICAgICAgICAgICAgICAgICAgIG1HTC5tVGV4LnNpemUsCi0gICAgICAgICAgICAgICAgICAgICBzdHJpZGUsCi0gICAgICAgICAgICAgICAgICAgICBSU19LSU5EX1RFWFRVUkUsCi0gICAgICAgICAgICAgICAgICAgICBmYWxzZSwKLSAgICAgICAgICAgICAgICAgICAgIG1HTC5tVGV4Lm9mZnNldCk7Ci0gICAgfQotCi0gICAgaWYgKG1HTC5tUG9pbnRTaXplLnNpemUpIHsKLSAgICAgICAgdmEtPmFkZExlZ2FjeShtR0wubVBvaW50U2l6ZS50eXBlLAotICAgICAgICAgICAgICAgICAgICAgMSwKLSAgICAgICAgICAgICAgICAgICAgIHN0cmlkZSwKLSAgICAgICAgICAgICAgICAgICAgIFJTX0tJTkRfUE9JTlRfU0laRSwKLSAgICAgICAgICAgICAgICAgICAgIGZhbHNlLAotICAgICAgICAgICAgICAgICAgICAgbUdMLm1Qb2ludFNpemUub2Zmc2V0KTsKLSAgICB9Ci0KLX0KLQotdm9pZCBUeXBlOjplbmFibGVHTFZlcnRleEJ1ZmZlcjIoVmVydGV4QXJyYXkgKnZhKSBjb25zdAotewotICAgIC8vIERvIGxlZ2FjeSBidWZmZXJzCi0gICAgZW5hYmxlR0xWZXJ0ZXhCdWZmZXIodmEpOwotCiAgICAgdWludDMyX3Qgc3RyaWRlID0gbUVsZW1lbnQtPmdldFNpemVCeXRlcygpOwogICAgIGZvciAodWludDMyX3QgY3Q9MDsgY3QgPCBSU19NQVhfQVRUUklCUzsgY3QrKykgewotICAgICAgICBpZiAobUdMLm1Vc2VyW2N0XS5zaXplKSB7Ci0gICAgICAgICAgICB2YS0+YWRkVXNlcihtR0wubVVzZXJbY3RdLCBzdHJpZGUpOworICAgICAgICBpZiAobUF0dHJpYnNbY3RdLnNpemUpIHsKKyAgICAgICAgICAgIHZhLT5hZGQobUF0dHJpYnNbY3RdLCBzdHJpZGUpOwogICAgICAgICB9CiAgICAgfQogfQpAQCAtMjgzLDYgKzE4MSw1NyBAQAogICAgIG1FbGVtZW50LT5kdW1wTE9HVihidWYpOwogfQogCit2b2lkIFR5cGU6OnNlcmlhbGl6ZShPU3RyZWFtICpzdHJlYW0pIGNvbnN0Cit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k9STUFMOgotICAgICAgICAgICAgLy9sb2dBdHRyaWIoTk9STUFMKTsKLSAgICAgICAgICAgIGdsRW5hYmxlQ2xpZW50U3RhdGUoR0xfTk9STUFMX0FSUkFZKTsKLSAgICAgICAgICAgIHJzQXNzZXJ0KG1BdHRyaWJzW2N0XS5zaXplID09IDMpOwotICAgICAgICAgICAgZ2xCaW5kQnVmZmVyKEdMX0FSUkFZX0JVRkZFUiwgbUF0dHJpYnNbY3RdLmJ1ZmZlcik7Ci0gICAgICAgICAgICBnbE5vcm1hbFBvaW50ZXIobUF0dHJpYnNbY3RdLnR5cGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUF0dHJpYnNbY3RdLnN0cmlkZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKW1BdHRyaWJzW2N0XS5vZmZzZXQpOwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBSU19LSU5EX0NPTE9SOgotICAgICAgICAgICAgLy9sb2dBdHRyaWIoQ09MT1IpOwotICAgICAgICAgICAgZ2xFbmFibGVDbGllbnRTdGF0ZShHTF9DT0xPUl9BUlJBWSk7Ci0gICAgICAgICAgICBnbEJpbmRCdWZmZXIoR0xfQVJSQVlfQlVGRkVSLCBtQXR0cmlic1tjdF0uYnVmZmVyKTsKLSAgICAgICAgICAgIGdsQ29sb3JQb2ludGVyKG1BdHRyaWJzW2N0XS5zaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgbUF0dHJpYnNbY3RdLnR5cGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBtQXR0cmlic1tjdF0uc3RyaWRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKiltQXR0cmlic1tjdF0ub2Zmc2V0KTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgUlNfS0lORF9URVhUVVJFOgotICAgICAgICAgICAgLy9sb2dBdHRyaWIoVEVYVFVSRSk7Ci0gICAgICAgICAgICBnbEVuYWJsZUNsaWVudFN0YXRlKEdMX1RFWFRVUkVfQ09PUkRfQVJSQVkpOwotICAgICAgICAgICAgZ2xCaW5kQnVmZmVyKEdMX0FSUkFZX0JVRkZFUiwgbUF0dHJpYnNbY3RdLmJ1ZmZlcik7Ci0gICAgICAgICAgICBnbFRleENvb3JkUG9pbnRlcihtQXR0cmlic1tjdF0uc2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BdHRyaWJzW2N0XS50eXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUF0dHJpYnNbY3RdLnN0cmlkZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopbUF0dHJpYnNbY3RdLm9mZnNldCk7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIFJTX0tJTkRfUE9JTlRfU0laRToKLSAgICAgICAgICAgIC8vbG9nQXR0cmliKFBPSU5UX1NJWkUpOwotICAgICAgICAgICAgZ2xFbmFibGVDbGllbnRTdGF0ZShHTF9QT0lOVF9TSVpFX0FSUkFZX09FUyk7Ci0gICAgICAgICAgICBnbEJpbmRCdWZmZXIoR0xfQVJSQVlfQlVGRkVSLCBtQXR0cmlic1tjdF0uYnVmZmVyKTsKLSAgICAgICAgICAgIGdsUG9pbnRTaXplUG9pbnRlck9FUyhtQXR0cmlic1tjdF0udHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQXR0cmlic1tjdF0uc3RyaWRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopbUF0dHJpYnNbY3RdLm9mZnNldCk7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgcnNBc3NlcnQoMCk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByc2MtPmNoZWNrRXJyb3IoIlZlcnRleEFycmF5OjpzZXR1cEdMIik7Ci19Ci0KI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IiKSB7CisgICAgICAgICAgICAgICAgc2xvdCA9IDE7CisgICAgICAgICAgICB9IGVsc2UgaWYgKG1BdHRyaWJzW2N0XS5uYW1lID09ICJub3JtYWwiKSB7CisgICAgICAgICAgICAgICAgc2xvdCA9IDI7CisgICAgICAgICAgICB9IGVsc2UgaWYgKG1BdHRyaWJzW2N0XS5uYW1lID09ICJwb2ludFNpemUiKSB7CisgICAgICAgICAgICAgICAgc2xvdCA9IDM7CisgICAgICAgICAgICB9IGVsc2UgaWYgKG1BdHRyaWJzW2N0XS5uYW1lID09ICJ0ZXh0dXJlMCIpIHsKKyAgICAgICAgICAgICAgICBzbG90ID0gNDsKKyAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBzbG90ID0gc2MtPnZ0eEF0dHJpYlNsb3QobUF0dHJpYnNbY3RdLmtpbmQpOwogICAgICAgICB9CiAKICAgICAgICAgLy9sb2dBdHRyaWIoY3QsIHNsb3QpOwogICAgICAgICBnbEVuYWJsZVZlcnRleEF0dHJpYkFycmF5KHNsb3QpOwogICAgICAgICBnbEJpbmRCdWZmZXIoR0xfQVJSQVlfQlVGRkVSLCBtQXR0cmlic1tjdF0uYnVmZmVyKTsKLQogICAgICAgICBnbFZlcnRleEF0dHJpYlBvaW50ZXIoc2xvdCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BdHRyaWJzW2N0XS5zaXplLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUF0dHJpYnNbY3RdLnR5cGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQXR0cmlic1tjdF0ubm9ybWFsaXplZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BdHRyaWJzW2N0XS5zdHJpZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKW1BdHRyaWJzW2N0XS5vZmZzZXQpOworICAgICAgICAgICAg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Y29udmVydF8jI3R5cGVvdXQjIzIodHlwZWluIyMyIHYpIHsgXAorICAgIHR5cGVvdXQjIzIgciA9IHsodHlwZW91dCl2LngsICh0eXBlb3V0KXYueX07IFwKKyAgICByZXR1cm4gcjsgXAorfSBcCitzdGF0aWMgdHlwZW91dCMjMyBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBjb252ZXJ0XyMjdHlwZW91dCMjMyh0eXBlaW4jIzMgdikgeyBcCisgICAgdHlwZW91dCMjMyByID0geyh0eXBlb3V0KXYueCwgKHR5cGVvdXQpdi55LCAodHlwZW91dCl2Lnp9OyBcCisgICAgcmV0dXJuIHI7IFwKK30gXAorc3RhdGljIHR5cGVvdXQjIzQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgY29udmVydF8jI3R5cGVvdXQjIzQodHlwZWluIyM0IHYpIHsgXAorICAgIHR5cGVvdXQjIzQgciA9IHsodHlwZW91dCl2LngsICh0eXBlb3V0KXYueSwgKHR5cGVvdXQpdi56LCAodHlwZW91dCl2Lnd9OyBcCisgICAgcmV0dXJuIHI7IFwKK30KKworI2RlZmluZSBDVlRfRlVOQyh0eXBlKSAgICAgIENWVF9GVU5DXzIodHlwZSwgdWNoYXIpIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBDVlRfRlVOQ18yKHR5cGUsIGNoYXIpIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBDVlRfRlVOQ18yKHR5cGUsIHVzaG9ydCkgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIENWVF9GVU5DXzIodHlwZSwgc2hvcnQpIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBDVlRfRlVOQ18yKHR5cGUsIGludCkgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIENWVF9GVU5DXzIodHlwZSwgdWludCkgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIENWVF9GVU5DXzIodHlwZSwgZmxvYXQpCisKK0NWVF9GVU5DKGNoYXIpCitDVlRfRlVOQyh1Y2hhcikKK0NWVF9GVU5DKHNob3J0KQorQ1ZUX0ZVTkModXNob3J0KQorQ1ZUX0ZVTkMoaW50KQorQ1ZUX0ZVTkModWludCkKK0NWVF9GVU5DKGZsb2F0KQorCisKKworLy8gRmxvYXQgb3BzLCA2LjExLjIKKworI2RlZmluZSBERUZfRlVOQ18xKGZuYykgXAorc3RhdGljIGZsb2F0MiBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBmbmMoZmxvYXQyIHYpIHsgXAorICAgIGZsb2F0MiByOyBcCisgICAgci54ID0gZm5jKHYueCk7IFwKKyAgICByLnkgPSBmbmModi55KTsgXAorICAgIHJldHVybiByOyBcCit9IFwKK3N0YXRpYyBmbG9hdDMgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgZm5jKGZsb2F0MyB2KSB7IFwKKyAgICBmbG9hdDMgcjsgXAorICAgIHIueCA9IGZuYyh2LngpOyBcCisgICAgci55ID0gZm5jKHYueSk7IFwKKyAgICByLnogPSBmbmModi56KTsgXAorICAgIHJldHVybiByOyBcCit9IFwKK3N0YXRpYyBmbG9hdDQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgZm5jKGZsb2F0NCB2KSB7IFwKKyAgICBmbG9hdDQgcjsgXAorICAgIHIueCA9IGZuYyh2LngpOyBcCisgICAgci55ID0gZm5jKHYueSk7IFwKKyAgICByLnogPSBmbmModi56KTsgXAorICAgIHIudyA9IGZuYyh2LncpOyBcCisgICAgcmV0dXJuIHI7IFwKK30KKworI2RlZmluZSBERUZfRlVOQ18yKGZuYykgXAorc3RhdGljIGZsb2F0MiBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBmbmMoZmxvYXQyIHYxLCBmbG9hdDIgdjIpIHsgXAorICAgIGZsb2F0MiByOyBcCisgICAgci54ID0gZm5jKHYxLngsIHYyLngpOyBcCisgICAgci55ID0gZm5jKHYxLnksIHYyLnkpOyBcCisgICAgcmV0dXJuIHI7IFwKK30gXAorc3RhdGljIGZsb2F0MyBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBmbmMoZmxvYXQzIHYxLCBmbG9hdDMgdjIpIHsgXAorICAgIGZsb2F0MyByOyBcCisgICAgci54ID0gZm5jKHYxLngsIHYyLngpOyBcCisgICAgci55ID0gZm5jKHYxLnksIHYyLnkpOyBcCisgICAgci56ID0gZm5jKHYxLnosIHYyLnopOyBcCisgICAgcmV0dXJuIHI7IFwKK30gXAorc3RhdGljIGZsb2F0NCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBmbmMoZmxvYXQ0IHYxLCBmbG9hdDQgdjIpIHsgXAorICAgIGZsb2F0NCByOyBcCisgICAgci54ID0gZm5jKHYxLngsIHYyLngpOyBcCisgICAgci55ID0gZm5jKHYxLnksIHYyLnkpOyBcCisgICAgci56ID0gZm5jKHYxLnosIHYyLnopOyBcCisgICAgci53ID0gZm5jKHYxLncsIHYyLnopOyBcCisgICAgcmV0dXJuIHI7IFwKK30KKworI2RlZmluZSBERUZfRlVOQ18yRihmbmMpIFwKK3N0YXRpYyBmbG9hdDIgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgZm5jKGZsb2F0MiB2MSwgZmxvYXQgdjIpIHsgXAorICAgIGZsb2F0MiByOyBcCisgICAgci54ID0gZm5jKHYxLngsIHYyKTsgXAorICAgIHIueSA9IGZuYyh2MS55LCB2Mik7IFwKKyAgICByZXR1cm4gcjsgXAorfSBcCitzdGF0aWMgZmxvYXQzIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIGZuYyhmbG9hdDMgdjEsIGZsb2F0IHYyKSB7IFwKKyAgICBmbG9hdDMgcjsgXAorICAgIHIueCA9IGZuYyh2MS54LCB2Mik7IFwKKyAgICByLnkgPSBmbmModjEueSwgdjIpOyBcCisgICAgci56ID0gZm5jKHYxLnosIHYyKTsgXAorICAg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gcmV0dXJuIGZtaW4odiAtIGksIDB4MS5mZmZmZmVwLTFmKTsKK30KK3N0YXRpYyBmbG9hdDIgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgZnJhY3QoZmxvYXQyIHYsIGZsb2F0MiAqaXB0cikgeworICAgIGZsb2F0IHRbMl07CisgICAgZmxvYXQyIHI7CisgICAgci54ID0gZnJhY3Qodi54LCAmdFswXSk7CisgICAgci55ID0gZnJhY3Qodi55LCAmdFsxXSk7CisgICAgaXB0clswXSA9IHRbMF07CisgICAgaXB0clsxXSA9IHRbMV07CisgICAgcmV0dXJuIHI7Cit9CitzdGF0aWMgZmxvYXQzIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIGZyYWN0KGZsb2F0MyB2LCBmbG9hdDMgKmlwdHIpIHsKKyAgICBmbG9hdCB0WzNdOworICAgIGZsb2F0MyByOworICAgIHIueCA9IGZyYWN0KHYueCwgJnRbMF0pOworICAgIHIueSA9IGZyYWN0KHYueSwgJnRbMV0pOworICAgIHIueiA9IGZyYWN0KHYueiwgJnRbMl0pOworICAgIGlwdHJbMF0gPSB0WzBdOworICAgIGlwdHJbMV0gPSB0WzFdOworICAgIGlwdHJbMl0gPSB0WzJdOworICAgIHJldHVybiByOworfQorc3RhdGljIGZsb2F0NCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBmcmFjdChmbG9hdDQgdiwgZmxvYXQ0ICppcHRyKSB7CisgICAgZmxvYXQgdFs0XTsKKyAgICBmbG9hdDQgcjsKKyAgICByLnggPSBmcmFjdCh2LngsICZ0WzBdKTsKKyAgICByLnkgPSBmcmFjdCh2LnksICZ0WzFdKTsKKyAgICByLnogPSBmcmFjdCh2LnosICZ0WzJdKTsKKyAgICByLncgPSBmcmFjdCh2LncsICZ0WzNdKTsKKyAgICBpcHRyWzBdID0gdFswXTsKKyAgICBpcHRyWzFdID0gdFsxXTsKKyAgICBpcHRyWzJdID0gdFsyXTsKKyAgICB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PiBoaWdoLnkgPyBoaWdoLnkgOiBhbW91bnQueSk7CisgICAgci56ID0gYW1vdW50LnogPCBsb3cueiA/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/IHYxLnggOiB2MjsKKyAgICByLnkgPSB2MS55IDwgdjIgPyB2MS55IDogdjI7CisgICAgci56ID0gdjEueiA8IHYyID8gdjEueiA6IHYyOworICAgIHJldHVybiByOworfQorc3RhdGljIGZsb2F0NCBfX2F0dHJpYnV0ZV9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0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIHNtb290aHN0ZXAoZmxvYXQsIGZsb2F0LCBmbG9hdDQpOworCitzdGF0aWMgZmxvYXQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgc2lnbihmbG9hdCB2KSB7CisgICAgaWYgKHYgPiAwKSByZXR1cm4gMS5mOworICAgIGlmICh2IDwgMCkgcmV0dXJuIC0xLmY7CisgICAgcmV0dXJuIHY7Cit9CitERUZfRlVOQ18xKHNpZ24pCisKKy8vIDYuMTEuNQorc3RhdGljIGZsb2F0MyBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBjcm9zcyhmbG9hdDMgbGhzLCBmbG9hdDMgcmhzKSB7CisgICAgZmxvYXQzIHI7CisgICAgci54ID0gbGhzLnkgKiByaHMueiAgLSBsaHMueiAqIHJocy55OworICAgIHIueSA9IGxocy56ICogcmhzLnggIC0gbGhzLnggKiByaHMuejsKKyAgICByLnogPSBsaHMueCAqIHJocy55ICAtIGxocy55ICogcmhzLng7CisgICAgcmV0dXJuIHI7Cit9CisKK3N0YXRpYyBmbG9hdDQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgY3Jvc3MoZmxvYXQ0IGxocywgZmxvYXQ0IHJocykgeworICAgIGZsb2F0NCByOworICAgIHIueCA9IGxocy55ICogcmhzLnogIC0gbGhzLnogKiByaHMueTsKKyAgICByLnkgPSBsaHMueiAqIHJocy54ICAtIGxocy54ICogcmhzLno7CisgICAgci56ID0gbGhzLnggKiByaHMueSAgLSBsaHMueSAqIHJocy54OworICAgIHIudyA9IDAuZjsKKyAgICByZXR1cm4gcjsKK30KKworc3RhdGljIGZsb2F0IF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIGRvdChmbG9hdCBsaHMsIGZsb2F0IHJocykgeworICAgIHJldHVybiBsaHMgKiByaHM7Cit9CitzdGF0aWMgZmxvYXQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgZG90KGZsb2F0MiBsaHMsIGZsb2F0MiByaHMpIHsKKyAgICByZXR1cm4gbGhzLngqcmhzLnggKyBsaHMueSpyaHMueTsKK30KK3N0YXRpYyBmbG9hdCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBkb3QoZmxvYXQzIGxocywgZmxvYXQzIHJocykgeworICAgIHJldHVybiBsaHMueCpyaHMueCArIGxocy55KnJocy55ICsgbGhzLnoqcmhzLno7Cit9CitzdGF0aWMgZmxvYXQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgZG90KGZsb2F0NCBsaHMsIGZsb2F0NCByaHMpIHsKKyAgICByZXR1cm4gbGhzLngqcmhzLnggKyBsaHMueSpyaHMueSArIGxocy56KnJocy56ICsgbGhzLncqcmhzLnc7Cit9CisKK3N0YXRpYyBmbG9hdCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBsZW5ndGgoZmxvYXQgdikgeworICAgIHJldHVybiB2OworfQorc3RhdGljIGZsb2F0IF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIGxlbmd0aChmbG9hdDIgdikgeworICAgIHJldHVybiBzcXJ0KHYueCp2LnggKyB2Lnkqdi55KTsKK30KK3N0YXRpYyBmbG9hdCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBsZW5ndGgoZmxvYXQzIHYpIHsKKyAgICByZXR1cm4gc3FydCh2Lngqdi54ICsgdi55KnYueSArIHYueip2LnopOworfQorc3RhdGljIGZsb2F0IF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIGxlbmd0aChmbG9hdDQgdikgeworICAgIHJldHVybiBzcXJ0KHYueCp2LnggKyB2Lnkqdi55ICsgdi56KnYueiArIHYudyp2LncpOworfQorCitzdGF0aWMgZmxvYXQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgZGlzdGFuY2UoZmxvYXQgbGhzLCBmb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NjcmlwdGMvcnNfY29yZS5yc2gKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNDYzNTUwZgotLS0gL2Rldi9udWxsCisrKyBiL2xpYnMvcnMvc2NyaXB0Yy9yc19jb3JlLnJzaApAQCAtMCwwICsxLDUwNSBAQAorI2lmbmRlZiBfX1JTX0NPUkVfUlNIX18KKyNkZWZpbmUgX19SU19DT1JFX1JTSF9fCisKKworc3RhdGljIHVjaGFyNCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSByc1BhY2tDb2xvclRvODg4OChmbG9hdCByLCBmbG9hdCBnLCBmbG9hdCBiKQoreworICAgIHVjaGFyNCBjOworICAgIGMueCA9ICh1Y2hhcikociAqIDI1NS5mKTsKKyAgICBjLnkgPSAodWNoYXIpKGcgKiAyNTUuZik7CisgICAgYy56ID0gKHVjaGFyKShiICogMjU1LmYpOworICAgIGMudyA9IDI1NTsKKyAgICByZXR1cm4gYzsKK30KKworc3RhdGljIHVjaGFyNCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSByc1BhY2tDb2xvclRvODg4OChmbG9hdCByLCBmbG9hdCBnLCBmbG9hdCBiLCBmbG9hdCBhKQoreworICAgIHVjaGFyNCBjOworICAgIGMueCA9ICh1Y2hhcikociAqIDI1NS5mKTsKKyAgICBjLnkgPSAodWNoYXIpKGcgKiAyNTUuZik7CisgICAgYy56ID0gKHVjaGFyKShiICogMjU1LmYpOworICAgIGMudyA9ICh1Y2hhcikoYSAqIDI1NS5mKTsKKyAgICByZXR1cm4gYzsKK30KKworc3RhdGljIHVjaGFyNCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSByc1BhY2tDb2xvclRvODg4OChmbG9hdDMgY29sb3IpCit7CisgICAgY29sb3IgKj0gMjU1LmY7CisgICAgdWNoYXI0IGMgPSB7Y29sb3IueCwgY29sb3IueSwgY29sb3IueiwgMjU1fTsKKyAgICByZXR1cm4gYzsKK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cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeEdldChjb25zdCByc19tYXRyaXg0eDQgKm0sIHVpbnQzMl90IHJvdywgdWludDMyX3QgY29sKSB7CisgICAgcmV0dXJuIG0tPm1bcm93ICogNCArIGNvbF07Cit9CisKK3N0YXRpYyB2b2lkIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeFNldChyc19tYXRyaXgzeDMgKm0sIHVpbnQzMl90IHJvdywgdWludDMyX3QgY29sLCBmbG9hdCB2KSB7CisgICAgbS0+bVtyb3cgKiAzICsgY29sXSA9IHY7Cit9CisKK3N0YXRpYyBmbG9hdCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhHZXQoY29uc3QgcnNfbWF0cml4M3gzICptLCB1aW50MzJfdCByb3csIHVpbnQzMl90IGNvbCkgeworICAgIHJldHVybiBtLT5tW3JvdyAqIDMgKyBjb2xdOworfQorCitzdGF0aWMgdm9pZCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhTZXQocnNfbWF0cml4MngyICptLCB1aW50MzJfdCByb3csIHVpbnQzMl90IGNvbCwgZmxvYXQgdikgeworICAgIG0tPm1bcm93ICogMiArIGNvbF0gPSB2OworfQorCitzdGF0aWMgZmxvYXQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkKK3JzTWF0cml4R2V0KGNvbnN0IHJzX21hdHJpeDJ4MiAqbSwgdWludDMyX3Qgcm93LCB1aW50MzJfdCBjb2wpIHsKKyAgICByZXR1cm4gbS0+bVtyb3cgKiAyICsgY29sXTsKK30KKworc3RhdGljIHZvaWQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkKK3JzTWF0cml4TG9hZElkZW50aXR5KHJzX21hdHJpeDR4NCAqbSkgeworICAgIG0tPm1bMF0gPSAxLmY7CisgICAgbS0+bVsxXSA9IDAuZjsKKyAgICB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Pm1bMV0gPSB2WzFdOworICAgIG0tPm1bMl0gPSB2WzJdOworICAgIG0tPm1bM10gPSB2WzNdOworICAgIG0tPm1bNF0gPSB2WzRdOworICAgIG0tPm1bNV0gPSB2WzVdOworICAgIG0tPm1bNl0gPSB2WzZdOworICAgIG0tPm1bN10gPSB2WzddOworICAgIG0tPm1bOF0gPSB2WzhdOworICAgIG0tPm1bOV0gPSB2WzldOworICAgIG0tPm1bMTBdID0gdlsxMF07CisgICAgbS0+bVsxMV0gPSB2WzExXTsKKyAgICBtLT5tWzEyXSA9IHZbMTJdOworICAgIG0tPm1bMTNdID0gdlsxM107CisgICAgbS0+bVsxNF0gPSB2WzE0XTsKKyAgICBtLT5tWzE1XSA9IHZbMTVdOworfQorCitzdGF0aWMgdm9pZCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhMb2FkKHJzX21hdHJpeDN4MyAqbSwgY29uc3QgZmxvYXQgKnYpIHsKKyAgICBtLT5tWzBdID0gdlswXTsKKyAgICBtLT5tWzFdID0gdlsxXTsKKyAgICBtLT5tWzJdID0gdlsyXTsKKyAgICBtLT5tWzNdID0gdlszXTsKKyAgICBtLT5tWzRdID0gdls0XTsKKyAgICBtLT5tWzVdID0gdls1XTsKKyAgICBtLT5tWzZdID0gdls2XTsKKyAgICBtLT5tWzddID0gdls3XTsKKyAgICBtLT5tWzhdID0gdls4XTsKK30KKworc3RhdGljIHZvaWQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkKK3JzTWF0cml4TG9hZChyc19tYXRyaXgyeDIgKm0sIGNvbnN0IGZsb2F0ICp2KSB7CisgICAgbS0+bVswXSA9IHZbMF07CisgICAgbS0+bVsxXSA9IHZbMV07CisgICAgbS0+bVsyXSA9IHZbMl07CisgICAgbS0+bVszXSA9IHZbM107Cit9CisKK3N0YXRpYyB2b2lkIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeExvYWQocnNf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7CisgICAgbS0+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+bVsxNV09IDE7CisgICAgcm90ICo9IChmbG9hdCkoTV9QSSAvIDE4MC4wZik7CisgICAgYyA9IGNvcyhyb3QpOworICAgIHMgPSBzaW4ocm90KTsKKworICAgIGNvbnN0IGZsb2F0IGxlbiA9IHgqeCArIHkqeSArIHoqejsKKyAgICBpZiAoIShsZW4gIT0gMSkpIHsKKyAgICAgICAgY29uc3QgZmxvYXQgcmVjaXBMZW4gPSAxLmYgLyBzcXJ0KGxlbik7CisgICAgICAgIHggKj0gcmVjaXBMZW47CisgICAgICAgIHkgKj0gcmVjaXBMZW47CisgICAgICAgIHogKj0gcmVjaXBMZW47CisgICAgfQorICAgIGNvbnN0IGZsb2F0IG5jID0gMS4wZiAtIGM7CisgICAgY29uc3QgZmxvYXQgeHkgPSB4ICogeTsKKyAgICBjb25zdCBmbG9hdCB5eiA9IHkgKiB6OworICAgIGNvbnN0IGZsb2F0IHp4ID0geiAqIHg7CisgICAgY29uc3QgZm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qbGhzLCBjb25zdCByc19tYXRyaXg0eDQgKnJocykgeworICAgIGZvciAoaW50IGk9MCA7IGk8NCA7IGkrKykgeworICAgICAgICBmbG9hdCByaTAgPSAwOworICAgICAgICBmbG9hdCByaTEgPSAwOworICAgICAgICBmbG9hdCByaTIgPSAwOworICAgICAgICBmbG9hdCByaTMgPSAwOworICAgICAgICBmb3IgKGludCBqPTAgOyBqPDQgOyBqKyspIHsKKyAgICAgICAgICAgIGNvbnN0IGZsb2F0IHJoc19paiA9IHJzTWF0cml4R2V0KHJocywgaSxqKTsKKyAgICAgICAgICAgIHJpMCArPSByc01hdHJpeEdldChsaHMsIGosIDApICogcmhzX2lqOworICAgICAgICAgICAgcmkxICs9IHJzTWF0cml4R2V0KGxocywgaiwgMSkgKiByaHNfaWo7CisgICAgICAgICAgICByaTIgKz0gcnNNYXRyaXhHZXQobGhzLCBqLCAyKSAqIHJoc19pajsKKyAgICAgICAgICAgIHJpMyArPSByc01hdHJpeEdldChsaHMsIGosIDMpICogcmhzX2lqOworICAgICAgICB9CisgICAgICAgIHJzTWF0cml4U2V0KG0sIGksIDAsIHJpMCk7CisgICAgICAgIHJzTWF0cml4U2V0KG0sIGksIDEsIHJpMSk7CisgICAgICAgIHJzTWF0cml4U2V0KG0sIGksIDIsIHJpMik7CisgICAgICAgIHJzTWF0cml4U2V0KG0sIGksIDMsIHJpMyk7CisgICAgfQorfQorCitzdGF0aWMgdm9pZCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhNdWx0aXBseShyc19tYXRyaXg0eDQgKm0sIGNvbnN0IHJzX21hdHJpeDR4NCAqcmhzKSB7CisgICAgcnNfbWF0cml4NHg0IG10OworICAgIHJzTWF0cml4TG9hZE11bHRpcGx5KCZtdCwgbSwgcmhzKTsKKyAgICByc01hdHJpeExvYWQobSwgJm10KTsKK30KKworc3RhdGljIHZvaWQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkKK3JzTWF0cml4TG9hZE11bHRpcGx5KHJzX21hdHJpeDN4MyAqbSwgY29uc3QgcnNfbWF0cml4M3gzICpsaHMsIGNvbnN0IHJzX21hdHJpeDN4MyAqcmhzKSB7CisgICAgZm9yIChpbnQgaT0wIDsgaTwzIDsgaSsrKSB7CisgICAgICAgIGZsb2F0IHJpMCA9IDA7CisgICAgICAgIGZsb2F0IHJpMSA9IDA7CisgICAgICAgIGZsb2F0IHJpMiA9IDA7CisgICAgICAgIGZvciAoaW50IGo9MCA7IGo8MyA7IGorKykgeworICAgICAgICAgICAgY29uc3QgZmxvYXQgcmhzX2lqID0gcnNNYXRyaXhHZXQocmhzLCBpLGopOworICAgICAgICAgICAgcmkwICs9IHJzTWF0cml4R2V0KGxocywgaiwgMCkgKiByaHNfaWo7CisgICAgICAgICAgICByaTEgKz0gcnNNYXRyaXhHZXQobGhzLCBqLCAxKSAqIHJoc19pajsKKyAgICAgICAgICAgIHJpMiArPSByc01hdHJpeEdldChsaHMsIGosIDIpICogcmhzX2lqOworICAgICAgICB9CisgICAgICAgIHJzTWF0cml4U2V0KG0sIGksIDAsIHJpMCk7CisgICAgICAgIHJzTWF0cml4U2V0KG0sIGksIDEsIHJpMSk7CisgICAgICAgIHJzTWF0cml4U2V0KG0sIGksIDIsIHJpMik7CisgICAgfQorfQorCitzdGF0aWMgdm9pZCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhNdWx0aXBseShyc19tYXRyaXgzeDMgKm0sIGNvbnN0IHJzX21hdHJpeDN4MyAqcmhzKSB7CisgICAgcnNfbWF0cml4M3gzIG10OworICAgIHJzTWF0cml4TG9hZE11bHRpcGx5KCZtdCwgbSwgcmhzKTsKKyAgICByc01hdHJpeExvYWQobSwgJm10KTsKK30KKworc3RhdGljIHZvaWQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkKK3JzTWF0cml4TG9hZE11bHRpcGx5KHJzX21hdHJpeDJ4MiAqbSwgY29uc3QgcnNfbWF0cml4MngyICpsaHMsIGNvbnN0IHJzX21hdHJpeDJ4MiAqcmhzKSB7CisgICAgZm9yIChpbnQgaT0wIDsgaTwyIDsgaSsrKSB7CisgICAgICAgIGZsb2F0IHJpMCA9IDA7CisgICAgICAgIGZsb2F0IHJpMSA9IDA7CisgICAgICAgIGZvciAoaW50IGo9MCA7IGo8MiA7IGorKykgeworICAgICAgICAgICAgY29uc3QgZmxvYXQgcmhzX2lqID0gcnNNYXRyaXhHZXQocmhzLCBpLGopOworICAgICAgICAgICAgcmkwICs9IHJzTWF0cml4R2V0KGxocywgaiwgMCkgKiByaHNfaWo7CisgICAgICAgICAgICByaTEgKz0gcnNNYXRyaXhHZXQobGhzLCBqLCAxKSAqIHJoc19pajsKKyAgICAgICAgfQorICAgICAgICByc01hdHJpeFNldChtLCBpLCAwLCByaTApOworICAgICAgICByc01hdHJpeFNldChtLCBpLCAxLCByaTEpOworICAgIH0KK30KKworc3RhdGljIHZvaWQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkKK3JzTWF0cml4TXVsdGlwbHkocnNfbWF0cml4MngyICptLCBjb25zdCByc19tYXRyaXgyeDIgKnJocykgeworICAgIHJzX21hdHJpeDJ4MiBtdDsKKyAgICByc01hdHJpeExvYWRNdWx0aXBseSgmbXQsIG0sIHJocyk7CisgICAgcnNNYXRyaXhMb2FkKG0sICZtdCk7Cit9CisKK3N0YXRpYyB2b2lkIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeFJvdGF0ZShyc19tYXRyaXg0eDQgKm0sIGZsb2F0IHJvdCwgZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgeikgeworICAgIHJzX21hdHJpeDR4NCBtMTsKKyAgICByc01hdHJpeExvYWRSb3RhdGUoJm0xLCByb3QsIHgsIHksIHopOworICAgIHJzTWF0cml4TXVsdGlwbHkobSwgJm0xKTsKK30KKworc3RhdGljIHZvaWQgX19hdHRyaWJ1dGVf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SAqIGluLnkpICsgKG0tPm1bMTBdICogaW4ueikgKyAobS0+bVsxNF0gKiBpbi53KTsKKyAgICByZXQudyA9IChtLT5tWzNdICogaW4ueCkgKyAobS0+bVs3XSAqIGluLnkpICsgKG0tPm1bMTFdICogaW4ueikgKyAobS0+bVsxNV0gKiBpbi53KTsKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgZmxvYXQ0IF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeE11bHRpcGx5KHJzX21hdHJpeDR4NCAqbSwgZmxvYXQzIGluKSB7CisgICAgZmxvYXQ0IHJldDsKKyAgICByZXQueCA9IChtLT5tWzBdICogaW4ueCkgKyAobS0+bVs0XSAqIGluLnkpICsgKG0tPm1bOF0gKiBpbi56KSArIG0tPm1bMTJdOworICAgIHJldC55ID0gKG0tPm1bMV0gKiBpbi54KSArIChtLT5tWzVdICogaW4ueSkgKyAobS0+bVs5XSAqIGluLnopICsgbS0+bVsxM107CisgICAgcmV0LnogPSAobS0+bVsyXSAqIGluLngpICsgKG0tPm1bNl0gKiBpbi55KSArIChtLT5tWzEwXSAqIGluLnopICsgbS0+bVsxNF07CisgICAgcmV0LncgPSAobS0+bVszXSAqIGluLngpICsgKG0tPm1bN10gKiBpbi55KSArIChtLT5tWzExXSAqIGluLnopICsgbS0+bVsxNV07CisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGZsb2F0NCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhNdWx0aXBseShyc19tYXRyaXg0eDQgKm0sIGZsb2F0MiBpbikgeworICAgIGZsb2F0NCByZXQ7CisgICAgcmV0LnggPSAobS0+bVswXSAqIGluLngpICsgKG0tPm1bNF0gKiBpbi55KSArIG0tPm1bMTJdOworICAgIHJldC55ID0gKG0tPm1bMV0gKiBpbi54KSArIChtLT5tWzVdICogaW4ueSkgKyBtLT5tWzEzXTsKKyAgICByZXQueiA9IChtLT5tWzJdICogaW4ueCkgKyAobS0+bVs2XSAqIGluLnkpICsgbS0+bVsxNF07CisgICAgcmV0LncgPSAobS0+bVszXSAqIGluLngpICsgKG0tPm1bN10gKiBpbi55KSArIG0tPm1bMTVdOworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBmbG9hdDMgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkKK3JzTWF0cml4TXVsdGlwbHkocnNfbWF0cml4M3gzICptLCBmbG9hdDMgaW4pIHsKKyAgICBmbG9hdDMgcmV0OworICAgIHJldC54ID0gKG0tPm1bMF0gKiBpbi54KSArIChtLT5tWzNdICogaW4ueSkgKyAobS0+bVs2XSAqIGluLnopOworICAgIHJldC55ID0gKG0tPm1bMV0gKiBpbi54KSArIChtLT5tWzRdICogaW4ueSkgKyAobS0+bVs3XSAqIGluLnopOworICAgIHJldC56ID0gKG0tPm1bMl0gKiBpbi54KSArIChtLT5tWzVdICogaW4ueSkgKyAobS0+bVs4XSAqIGluLnopOworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBmbG9hdDMgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkKK3JzTWF0cml4TXVsdGlwbHkocnNfbWF0cml4M3gzICptLCBmbG9hdDIgaW4pIHsKKyAgICBmbG9hdDMgcmV0OworICAgIHJldC54ID0gKG0tPm1bMF0gKiBpbi54KSArIChtLT5tWzNdICogaW4ueSk7CisgICAgcmV0LnkgPSAobS0+bVsxXSAqIGluLngpICsgKG0tPm1bNF0gKiBpbi55KTsKKyAgICByZXQueiA9IChtLT5tWzJdICogaW4ueCkgKyAobS0+bVs1XSAqIGluLnkpOworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBmbG9hdDIgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkKK3JzTWF0cml4TXVsdGlwbHkocnNfbWF0cml4MngyICptLCBmbG9hdDIgaW4pIHsKKyAgICBmbG9hdDIgcmV0OworICAgIHJld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U7CiAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyBjaGVjayBpbnZhcmlhbnQ6IHN0eWxlcyBzdGFydHMgYmVmb3JlIGVuZCBvZiBkYXRhCisgICAgICAgICAgICBpZiAobUhlYWRlci0+c3R5bGVzU3RhcnQgPj0gKG1IZWFkZXItPmhlYWRlci5zaXplLXNpemVvZih1aW50MTZfdCkpKSB7CisgICAgICAgICAgICAgICAgTE9HVygiQmFkIHN0eWxlIGJsb2NrOiBzdHlsZSBibG9jayBzdGFydHMgYXQgJWQgcGFzdCBkYXRhIHNpemUgb2YgJWRcbiIsCisgICAgICAgICAgICAgICAgICAgIChpbnQpbUhlYWRlci0+c3R5bGVzU3RhcnQsIChpbnQpbUhlYWRlci0+aGVhZGVyLnNpemUpOworICAgICAgICAgICAgICAgIHJldHVybiAobUVycm9yPUJBRF9UWVBFKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgICAgIC8vIGNoZWNrIGludmFyaWFudDogc3R5bGVzIGZvbGxvdyB0aGUgc3RyaW5ncwogICAgICAgICAgICAgaWYgKG1IZWFkZXItPnN0eWxlc1N0YXJ0IDw9IG1IZWFkZXItPnN0cmluZ3NTdGFydCkgewogICAgICAgICAgICAgICAgIExPR1coIkJhZCBzdHlsZSBibG9jazogc3R5bGUgYmxvY2sgc3RhcnRzIGF0ICVkLCBiZWZvcmUgc3RyaW5ncyBhdCAlZFxuIiwKQEAgLTE4NzgsNiArMTg4NCwxMiBAQAogICAgICAgICBvdXROYW1lLT50eXBlID0gZ3JwLT5iYXNlUGFja2FnZS0+dHlwZVN0cmluZ3Muc3RyaW5nQXQodCwgJm91dE5hbWUtPnR5cGVMZW4pOwogICAgICAgICBvdXROYW1lLT5uYW1lID0gZ3JwLT5iYXNlUGFja2FnZS0+a2V5U3RyaW5ncy5zdHJpbmdBdCgKICAgICAgICAgICAgIGR0b2hsKGVudHJ5LT5rZXkuaW5kZXgpLCAmb3V0TmFtZS0+bmFtZUxlbik7CisKKyAgICAgICAgLy8gSWYgd2UgaGF2ZSBhIGJhZCBpbmRleCBmb3Igc29tZSByZWFzb24sIHdlIHNob3VsZCBhYm9ydC4KKyAgICAgICAgaWYgKG91dE5hbWUtPnR5cGUgPT0gTlVMTCB8fCBvdXROYW1lLT5uYW1lID09IE5VTEwpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCiAgICAgICAgIHJldHVybiB0cnVlOwogICAgIH0KIApAQCAtMjYwOSw2ICsyNjIxLDI0IEBACiAgICAgICAgICpvdXRUeXBlID0gKmRlZlR5cGU7CiAgICAgfQogICAgICpvdXROYW1lID0gU3RyaW5nMTYocCwgZW5kLXApOworICAgIGlmKCoqb3V0UGFja2FnZSA9PSAwKSB7CisgICAgICAgIGlmKG91dEVycm9yTXNnKSB7CisgICAgICAgICAgICAqb3V0RXJyb3JNc2cgPSAiUmVzb3VyY2UgcGFja2FnZSBjYW5ub3QgYmUgYW4gZW1wdHkgc3RyaW5nIjsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorICAgIGlmKCoqb3V0VHlwZSA9PSAwKSB7CisgICAgICAgIGlmKG91dEVycm9yTXNnKSB7CisgICAgICAgICAgICAqb3V0RXJyb3JNc2cgPSAiUmVzb3VyY2UgdHlwZSBjYW5ub3QgYmUgYW4gZW1wdHkgc3RyaW5nIjsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorICAgIGlmKCoqb3V0TmFtZSA9PSAwKSB7CisgICAgICAgIGlmKG91dEVycm9yTXNnKSB7CisgICAgICAgICAgICAqb3V0RXJyb3JNc2cgPSAiUmVzb3VyY2UgaWQgY2Fubm90IGJlIGFuIGVtcHR5IHN0cmluZyI7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KICAgICByZXR1cm4gdHJ1ZTsKIH0KIApAQCAtNDEyNywxMyArNDE1NywxNiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAoMHgwMGZmMDAwMCAmICgodHlwZUluZGV4KzEpPDwxNikpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICgweDAwMDBmZmZmICYgKGVudHJ5SW5kZXgpKTsKICAgICAgICAgICAgICAgICAgICAgICAgIHJlc291cmNlX25hbWUgcmVzTmFtZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMtPmdldFJlc291cmNlTmFtZShyZXNJRCwgJnJlc05hbWUpOwotICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCIgICAgICBzcGVjIHJlc291cmNlIDB4JTA4eCAlczolcy8lczogZmxhZ3M9MHglMDh4XG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc0lELAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIENIQVIxNl9UT19DU1RSKHJlc05hbWUucGFja2FnZSwgcmVzTmFtZS5wYWNrYWdlTGVuKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBDSEFSMTZfVE9fQ1NUUihyZXNOYW1lLnR5cGUsIHJlc05hbWUudHlwZUxlbiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hBUjE2X1RPX0NTVFIocmVzTmFtZS5uYW1lLCByZXNOYW1lLm5hbWVMZW4pLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGR0b2hsKHR5cGVDb25maWdzLT50eXBlU3BlY0ZsYWdzW2VudHJ5SW5kZXhdKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy0+Z2V0UmVzb3VyY2VOYW1lKHJlc0lELCAmcmVzTmFtZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGYoIiAgICAgIHNwZWMgcmVzb3VyY2UgMHglMDh4ICVzOiVzLyVzOiBmbGFncz0weCUwOHhcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc0lELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDSEFSMTZfVE9fQ1NUUihyZXNOYW1lLnBhY2thZ2UsIHJlc05hbWUucGFja2FnZUxlbiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENIQVIxNl9UT19DU1RSKHJlc05hbWUudHlwZSwgcmVzTmFtZS50eXBlTGVuKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hBUjE2X1RPX0NTVFIocmVzTmFtZS5uYW1lLCByZXNOYW1lLm5hbWVMZW4pLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkdG9obCh0eXBlQ29uZmlncy0+dHlwZVNwZWNGbGFnc1tlbnRyeUluZGV4XSkpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGYoIiAgICAgIElOVkFMSUQgVFlQRSBDT05GSUcgRk9SIFJFU09VUkNFIDB4JTA4eFxuIiwgcmVzSUQpOworICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGZvciAoc2l6ZV90IGNvbmZpZ0luZGV4PTA7IGNvbmZpZ0luZGV4PE5UQzsgY29uZmlnSW5kZXgrKykgewpAQCAtNDM0MCwxMSArNDM3MywxNCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAoMHgwMGZmMDAwMCAmICgodHlwZUluZGV4KzEpPDwxNikpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICgweDAwMDBmZmZmICYgKGVudHJ5SW5kZXgpKTsKICAgICAgICAgICAgICAgICAgICAgICAgIHJlc291cmNlX25hbWUgcmVzTmFtZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMtPmdldFJlc291cmNlTmFtZShyZXNJRCwgJnJlc05hbWUpOwotICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCIgICAgICAgIHJlc291cmNlIDB4JTA4eCAlczolcy8lczogIiwgcmVzSUQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENIQVIxNl9UT19DU1RSKHJlc05hbWUucGFja2FnZSwgcmVzTmFtZS5wYWNrYWdlTGVuKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hBUjE2X1RPX0NTVFIocmVzTmFtZS50eXBlLCByZXNOYW1lLnR5cGVMZW4pLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDSEFSMTZfVE9fQ1NUUihyZXNOYW1lLm5hbWUsIHJlc05hbWUubmFtZUxlbikpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMtPmdldFJlc291cmNlTmFtZShyZXNJRCwgJnJlc05hbWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCIgICAgICAgIHJlc291cmNlIDB4JTA4eCAlczolcy8lczogIiwgcmVzSUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDSEFSMTZfVE9fQ1NUUihyZXNOYW1lLnBhY2thZ2UsIHJlc05hbWUucGFja2FnZUxlbiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDSEFSMTZfVE9fQ1NUUihyZXNOYW1lLnR5cGUsIHJlc05hbWUudHlwZUxlbiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDSEFSMTZfVE9fQ1NUUihyZXNOYW1lLm5hbWUsIHJlc05hbWUubmFtZUxlbikpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGYoIiAgICAgICAgSU5WQUxJRCBSRVNPVVJDRSAweCUwOHg6ICIsIHJlc0lEKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodGhpc09mZnNldCYweDMpICE9IDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGYoIk5PTi1JTlRFR0VSIE9GRlNFVDogJXBcbiIsICh2b2lkKil0aGlzT2Zmc2V0KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKQEAgLTQ0MDIsMTggKzQ0MzgsMTkgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRfdmFsdWUocGtnLCB2YWx1ZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChiYWdQdHIgIT0gTlVMTCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBpbnQgTiA9IGR0b2hsKGJhZ1B0ci0+Y291bnQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBSZXNUYWJsZV9tYXAqIG1hcFB0ciA9IChjb25zdCBSZXNUYWJsZV9tYXAqKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKGNvbnN0IHVpbnQ4X3QqKWVudCkgKyBlc2l6ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHVpbnQ4X3QqIGJhc2VNYXBQdHIgPSAoY29uc3QgdWludDhfdCopZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplX3QgbWFwT2Zmc2V0ID0gZXNpemU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFJlc1RhYmxlX21hcCogbWFwUHRyID0gKFJlc1RhYmxlX21hcCopKGJhc2VNYXBQdHIrbWFwT2Zmc2V0KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCIgICAgICAgICAgUGFyZW50PTB4JTA4eCwgQ291bnQ9JWRcbiIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkdG9obChiYWdQdHItPnBhcmVudC5pZGVudCksIE4pOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOICYmIG1hcE9mZnNldCA8ICh0eXBlU2l6ZS1zaXplb2YoUmVzVGFibGVfbWFwKSk7IGkrKykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCIgICAgICAgICAgIyVpIChLZXk9MHglMDh4KTogIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpLCBkdG9obChtYXBQdHItPm5hbWUuaWRlbnQpKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlLmNvcHlGcm9tX2R0b2gobWFwUHRyLT52YWx1ZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludF92YWx1ZShwa2csIHZhbHVlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNpemVfdCBzaXplID0gZHRvaHMobWFwUHRyLT52YWx1ZS5zaXplKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcFB0ciA9IChSZXNUYWJsZV9tYXAqKSgoKGNvbnN0IHVpbnQ4X3QqKW1hcFB0cikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBzaXplICsgc2l6ZW9mKCptYXBQdHIpLXNpemVvZihtYXBQdHItPnZhbHVlKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXBPZmZzZXQgKz0gc2l6ZSArIHNpemVvZigqbWFwUHRyKS1zaXplb2YobWFwUHRyLT52YWx1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXBQdHIgPSAoUmVzVGFibGVfbWFwKikoYmFzZU1hcFB0cittYXBPZmZzZXQpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9C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aWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAorICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKi8KKworcGFja2FnZSBhbmRyb2lkLm1lZGlhOworCitpbXBvcnQgYW5kcm9pZC51dGlsLkxvZzsKKworLyoqCisgKiB7QGhpZGV9CisgKi8KK3B1YmxpYyBjbGFzcyBNdHBDbGllbnQgeworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3RyaW5nIFRBRyA9ICJNdHBDbGllbnQiOworCisgICAgcHJpdmF0ZSBmaW5hbCBMaXN0ZW5lciBtTGlzdGVuZXI7CisKKyAgICBzdGF0aWMgeworICAgICAgICBTeXN0ZW0ubG9hZExpYnJhcnkoIm1lZGlhX2puaSIpOworICAgIH0KKworICAgIHB1YmxpYyBNdHBDbGllbnQoTGlzdGVuZXIgbGlzdGVuZXIpIHsKKyAgICAgICAgbmF0aXZlX3NldHVwKCk7CisgICAgICAgIGlmIChsaXN0ZW5lciA9PSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgTnVsbFBvaW50ZXJFeGNlcHRpb24oIk10cENsaWVudDogbGlzdGVuZXIgaXMgbnVsbCIpOworICAgICAgICB9CisgICAgICAgIG1MaXN0ZW5lciA9IGxpc3RlbmVyOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIGZpbmFsaXplKCkgeworICAgICAgICBuYXRpdmVfZmluYWxpemUoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzdGFydCgpIHsKKyAgICAgICAgbUV2ZW50VGhyZWFkID0gbmV3IE10cEV2ZW50VGhyZWFkKCk7CisgICAgICAgIG1FdmVudFRocmVhZC5zdGFydCgpOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGRlbGV0ZU9iamVjdChpbnQgZGV2aWNlSUQsIGludCBvYmplY3RJRCkgeworICAgICAgICByZXR1cm4gbmF0aXZlX2RlbGV0ZV9vYmplY3QoZGV2aWNlSUQsIG9iamVjdElEKTsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldFBhcmVudChpbnQgZGV2aWNlSUQsIGludCBvYmplY3RJRCkgeworICAgICAgICByZXR1cm4gbmF0aXZlX2dldF9wYXJlbnQoZGV2aWNlSUQsIG9iamVjdElEKTsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldFN0b3JhZ2VJRChpbnQgZGV2aWNlSUQsIGludCBvYmplY3RJRCkgeworICAgICAgICByZXR1cm4gbmF0aXZlX2dldF9zdG9yYWdlX2lkKGRldmljZUlELCBvYmplY3RJRCk7CisgICAgfQorCisgICAgcHJpdmF0ZSBjbGFzcyBNdHBFdmVudFRocmVhZCBleHRlbmRzIFRocmVhZCB7CisKKyAgICAgICAgcHJpdmF0ZSBib29sZWFuIG1Eb25lOworCisgICAgICAgIHB1YmxpYyBNdHBFdmVudFRocmVhZCgpIHsKKyAgICAgICAgICAgIHN1cGVyKCJNdHBFdmVudFRocmVhZCIpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgTG9nLmQoVEFHLCAiTXRwRXZlbnRUaHJlYWQgc3RhcnRpbmciKTsKKyAgICAgICAgICAgIHdoaWxlICghbURvbmUpIHsKKyAgICAgICAgICAgICAgICAvLyB0aGlzIHdpbGwgd2FpdCBmb3IgYW4gZXZlbnQgZnJvbSBhbiBNVFAgZGV2aWNlCisgICAgICAgICAgICAgICAgbmF0aXZlX3dhaXRfZm9yX2V2ZW50KCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBMb2cuZChUQUcsICJNdHBFdmVudFRocmVhZCBleGl0aW5nIik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgaW50ZXJmYWNlIExpc3RlbmVyIHsKKyAgICAgICAgLy8gY2FsbGVkIHdoZW4gYSBuZXcgTVRQIGR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AgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgU1RPUkFHRV9JRCAgICAgICAgICA9IDQ7CisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgT0JKRUNUICAgICAgICAgICAgICA9IDU7CisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgT0JKRUNUX0lEICAgICAgICAgICA9IDY7CisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgU1RPUkFHRV9DSElMRFJFTiAgICA9IDc7CisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgT0JKRUNUX0NISUxEUkVOICAgICA9IDg7CisKKyAgICBwcml2YXRlIGludCBtUXVlcnlUeXBlOworICAgIHByaXZhdGUgaW50IG1EZXZpY2VJRDsKKyAgICBwcml2YXRlIGludCBtU3RvcmFnZUlEOworICAgIHByaXZhdGUgaW50IG1RYmplY3RJRDsKKworICAgIC8qKiBUaGUgbmFtZXMgb2YgdGhlIGNvbHVtbnMgaW4gdGhlIHByb2plY3Rpb24gKi8KKyAgICBwcml2YXRlIFN0cmluZ1tdIG1Db2x1bW5zOworCisgICAgLyoqIFRoZSBudW1iZXIgb2Ygcm93cyBpbiB0aGUgY3Vyc29yICovCisgICAgcHJpdmF0ZSBpbnQgbUNvdW50ID0gTk9fQ09VTlQ7CisKKyAgICBwcml2YXRlIGZpbmFsIE10cENsaWVudCBtQ2xpZW50OworCisgICAgcHVibGljIE10cEN1cnNvcihNdHBDbGllbnQgY2xpZW50LCBpbnQgcXVlcnlUeXBlLCBpbnQgZGV2aWNlSUQsIGludCBzdG9yYWdlSUQsIGludCBvYmplY3RJRCwKKyAgICAgICAgICAgIFN0cmluZ1tdIHByb2plY3Rpb24pIHsKKworICAgICAgICBtQ2xpZW50ID0gY2xpZW50OworICAgICAgICBtUXVlcnlUeXBlID0gcXVlcnlUeXBlOworICAgICAgICBtRGV2aWNlSUQgPSBkZXZpY2VJRDsKKyAgICAgICAgbVN0b3JhZ2VJRCA9IHN0b3JhZ2VJRDsKKyAgICAgICAgbVFiamVjdElEID0gb2JqZWN0SUQ7CisgICAgICAgIG1Db2x1bW5zID0gcHJvamVjdGlvbjsKKworICAgICAgICBIYXNoTWFwPFN0cmluZywgSW50ZWdlcj4gbWFwOworICAgICAgICBzd2l0Y2ggKHF1ZXJ5VHlwZSkgeworICAgICAgICAgICAgY2FzZSBERVZJQ0U6CisgICAgICAgICAgICBjYXNlIERFVklDRV9JRDoKKyAgICAgICAgICAgICAgICBtYXAgPSBzRGV2aWNlUHJvamVjdGlvbk1hcDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU1RPUkFHRToKKyAgICAgICAgICAgIGNhc2UgU1RPUkFHRV9JRDoKKyAgICAgICAgICAgICAgICBtYXAgPSBzU3RvcmFnZVByb2plY3Rpb25NYXA7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVDoKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX0lEOgorICAgICAgICAgICAgY2FzZSBTVE9SQUdFX0NISUxEUkVOOgorICAgICAgICAgICAgY2FzZSBPQkpFQ1RfQ0hJTERSRU46CisgICAgICAgICAgICAgICAgbWFwID0gc09iamVjdFByb2plY3Rpb25NYXA7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oInVua25vd24gcXVlcnkgdHlwZSAiICArIHF1ZXJ5VHlwZSk7CisgICAgICAgIH0KKworICAgICAgICBpbnRbXSBjb2x1bW5zID0gbmV3IGludFtwcm9qZWN0aW9uLmxlbmd0aF07CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgcHJvamVjdGlvbi5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgSW50ZWdlciBpZCA9IG1hcC5nZXQocHJvamVjdGlvbltpXSk7CisgICAgICAgICAgICBpZiAoaWQgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oInVua25vd24gY29sdW1uICIgICsgcHJvamVjdGlvbltpXSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjb2x1bW5zW2ldID0gaWQuaW50VmFsdWUoKTsKKyAgICAgICAgfQorICAgICAgICBuYXRpdmVfc2V0dXAoY2xpZW50LCBxdWVyeVR5cGUsIGRldmljZUlELCBzdG9yYWdlSUQsIG9iamVjdElELCBjb2x1bW5zKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBmaW5hbGl6ZSgpIHsKKyAgICAgICAgbmF0aXZlX2ZpbmFsaXplKCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGludCBnZXRDb3VudCgpIHsKKyAgICAgICAgaWYgKG1Db3VudCA9PSBOT19DT1VOVCkgeworICAgICAgICAgICAgZmlsbFdpbmRvdygwKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbUNvdW50OworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIHJlcXVlcnkoKSB7CisgICAgICAgIExvZy5kKFRBRywgInJlcXVlcnkiKTsKKyAgICAgICAgbUNvdW50ID0gTk9fQ09VTlQ7CisgICAgICAgIGlmIChtV2luZG93ICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1XaW5kb3cuY2xlYXIoKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gc3VwZXIucmVxdWVyeSgpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBmaWxsV2luZG93KGludCBzdGFydFBvcykgeworICAgICAgICBpZiAobVdpbmRvdyA9PSBudWxsKSB7CisgICAgICAgICAgICAvLyBJZiB0aGVyZSBpc24ndCBhIHdpbmRvdyBzZXQgYWxyZWFkeSBpdCB3aWxsIG9ubHkgYmUgYWNjZXNzZWQgbG9jYWxseQorICAgICAgICAgICAgbVdpbmRvdyA9IG5ldyBDdXJzb3JXaW5kb3codHJ1ZSAvKiB0aGUgd2luZG93IGlzIGxvY2FsIG9ubHkgKi8pOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1XaW5kb3cuY2xlYXIoKTsKKyAgICAgICAgfQorICAgICAgICBtV2luZG93LnNldFN0YXJ0UG9zaXRpb24oc3RhcnRQb3MpOworICAgICAgICBtQ291bnQgPSBuYXRpdmVfZmlsbF93aW5kb3cobVdpbmRvdywgc3RhcnRQb3MpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBTdHJpbmdbXSBnZXRDb2x1bW5OYW1lcygpIHsKKyAgICAgICAgTG9nLmQoVEFHLCAiZ2V0Q29sdW1uTmFtZXMgcmV0dXJuaW5nICIgKyBtQ29sdW1ucyk7CisgICAgICAgIHJldHVybiBtQ29sdW1uczsKKyAgICB9CisKKyAgICAvKiBEZXZpY2UgQ29sdW1uIElEcyAqLworICAgICAvKiBUaGVzZSBtdXN0IG1hdGNoIHRoZSB2YWx1ZXMgaW4gTXRwQ3Vyc29yLmNwcCAqLworICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IERFVklDRV9ST1dfSUQgICAgICAgICAgPSAxOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBERVZJQ0VfTUFOVUZBQ1RVUkVSICAgID0gMjsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgREVWSUNFX01PREVMICAgICAgICAgICA9IDM7CisKKyAgICAvKiBTdG9yYWdlIENvbHVtbiBJRHMgKi8KKyAgICAvKiBUaGVzZSBtdXN0IG1hdGNoIHRoZSB2YWx1ZXMgaW4gTXRwQ3Vyc29yLmNwcCAqLworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBTVE9SQUdFX1JPV19JRCAgICAgICAgID0gMTAxOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCB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AgICAvLyBwYXRoIHRvbyBsb25nIQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKyAgICAgICAgc3RyY3B5KGZpbGVTcG90LCBuYW1lKTsKKwogICAgICAgICBpbnQgdHlwZSA9IGVudHJ5LT5kX3R5cGU7CiAgICAgICAgIGlmICh0eXBlID09IERUX1VOS05PV04pIHsKICAgICAgICAgICAgIC8vIElmIHRoZSB0eXBlIGlzIHVua25vd24sIHN0YXQoKSB0aGUgZmlsZSBpbnN0ZWFkLgpAQCAtMTUwLDE2ICsxNTcsNyBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIGlmICh0eXBlID09IERUX1JFRyB8fCB0eXBlID09IERUX0RJUikgewotICAgICAgICAgICAgaW50IG5hbWVMZW5ndGggPSBzdHJsZW4obmFtZSk7Ci0gICAgICAgICAgICBib29sIGlzRGlyZWN0b3J5ID0gKHR5cGUgPT0gRFRfRElSKTsKLQotICAgICAgICAgICAgaWYgKG5hbWVMZW5ndGggPiBwYXRoUmVtYWluaW5nIHx8IChpc0RpcmVjdG9yeSAmJiBuYW1lTGVuZ3RoICsgMSA+IHBhdGhSZW1haW5pbmcpKSB7Ci0gICAgICAgICAgICAgICAgLy8gcGF0aCB0b28gbG9uZyEKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgc3RyY3B5KGZpbGVTcG90LCBuYW1lKTsKLSAgICAgICAgICAgIGlmIChpc0RpcmVjdG9yeSkgeworICAgICAgICAgICAgaWYgKHR5cGUgPT0gRFRfRElSKSB7CiAgICAgICAgICAgICAgICAgLy8gaWdub3JlIGRpcmVjdG9yaWVzIHdpdGggYSBuYW1lIHRoYXQgc3RhcnRzIHdpdGggJy4nCiAgICAgICAgICAgICAgICAgLy8gZm9yIGV4YW1wbGUsIHRoZSBNYWMgIi5UcmFzaGVzIiBkaXJlY3RvcnkKICAgICAgICAgICAgICAgICBpZiAobmFtZVswXSA9PSAnLic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JChjYWxsIG15LWRpcikKKworaWZuZXEgKCQoVEFSR0VUX1NJTVVMQVRPUiksdHJ1ZSkKKworaW5jbHVkZSAkKENMRUFSX1ZBUlMpCisKK0xPQ0FMX1NSQ19GSUxFUzo9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgbXRwdGVzdC5jcHAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBEYXRhYmFzZS5jcHAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cERhdGFQYWNrZXQuY3BwICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwRGVidWcuY3BwICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBNZWRpYVNjYW5uZXIuY3BwICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cFBhY2tldC5jcHAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwUmVxdWVzdFBhY2tldC5jcHAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBSZXNwb25zZVBhY2tldC5jcHAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cFNlcnZlci5jcHAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwU3RyaW5nQnVmZmVyLmNwcCAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBTdG9yYWdlLmNwcCAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cFV0aWxzLmNwcCAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgU3FsaXRlRGF0YWJhc2UuY3BwICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBTcWxpdGVTdGF0ZW1lbnQuY3BwICAgICAgICAgICAgICAgICAgIFwKKworTE9DQUxfTU9EVUxFOj0gbXRwdGVzdAorCitMT0NBTF9DX0lOQ0xVREVTIDo9IGV4dGVybmFsL3NxbGl0ZS9kaXN0CisKK0xPQ0FMX0NGTEFHUyA6PSAtRE1UUF9ERVZJQ0UKKworTE9DQUxfU0hBUkVEX0xJQlJBUklFUyA6PSBsaWJ1dGlscyBsaWJzcWxpdGUgbGlic3RhZ2VmcmlnaHQgbGliY3V0aWxzIFwKKwlsaWJtZWRpYQorCitpbmNsdWRlICQoQlVJTERfRVhFQ1VUQUJMRSkKKworZW5kaWYKKworaW5jbHVkZSAkKENMRUFSX1ZBUlMpCisKK0xPQ0FMX01PRFVMRSA6PSBsaWJtdHBob3N0CisKK0xPQ0FMX1NSQ19GSUxFUzo9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwQ2xpZW50LmNwcCAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBDdXJzb3IuY3BwICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cERhdGFQYWNrZXQuY3BwICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwRGVidWcuY3BwICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBEZXZpY2UuY3BwICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cERldmljZUluZm8uY3BwICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0SW5mby5jcHAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBQYWNrZXQuY3BwICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cFByb3BlcnR5LmNwcCAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwUmVxdWVzdFBhY2tldC5jcHAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBSZXNwb25zZVBhY2tldC5jcHAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cFN0b3JhZ2VJbmZvLmNwcCAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwU3RyaW5nQnVmZmVyLmNwcCAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBVdGlscy5jcHAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKworCitMT0NBTF9DRkxBR1MgOj0gLWcgLURNVFBfSE9TVAorTE9DQUxfTERGTEFHUyA6PSAtZworCitpbmNsdWRlICQoQlVJTERfU1RBVElDX0xJQlJBUlkpCisKK2luY2x1ZGUgJChDTEVBUl9WQVJTKQorCitMT0NBTF9NT0RVTEUgOj0gc2NhbnRlc3QKK0xPQ0FMX1NSQ19GSUxFUzo9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgc2NhbnRlc3QuY3BwICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBNZWRpYVNjYW5uZXIuY3BwICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cERhdGFiYXNlLmNwcCAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwRGF0YVBhY2tldC5jcHAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBQYWNrZXQuY3BwICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cFN0cmluZ0J1ZmZlci5jcHAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwVXRpbHMuY3BwICAgICAgICAgICAgIC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kZBQ0UpIHsKKyAgICAgICAgICAgIHN0cnVjdCB1c2JfaW50ZXJmYWNlX2Rlc2NyaXB0b3IgKmludGVyZmFjZSA9IChzdHJ1Y3QgdXNiX2ludGVyZmFjZV9kZXNjcmlwdG9yICopZGVzYzsKKworICAgICAgICAgICAgaWYgKGludGVyZmFjZS0+YkludGVyZmFjZUNsYXNzID09IFVTQl9DTEFTU19TVElMTF9JTUFHRSAmJgorICAgICAgICAgICAgICAgIGludGVyZmFjZS0+YkludGVyZmFjZVN1YkNsYXNzID09IDEgJiYgLy8gU3RpbGwgSW1hZ2UgQ2FwdHVyZQorICAgICAgICAgICAgICAgIGludGVyZmFjZS0+YkludGVyZmFjZVByb3RvY29sID09IDEpICAgICAvLyBQaWN0dXJlIFRyYW5zZmVyIFByb3RvY29sIChQSU1BIDE1NDcwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIExPR0QoIkZvdW5kIGNhbWVyYTogXCIlc1wiIFwiJXNcIlxuIiwgdXNiX2RldmljZV9nZXRfbWFudWZhY3R1cmVyX25hbWUoZGV2aWNlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHVzYl9kZXZpY2VfZ2V0X3Byb2R1Y3RfbmFtZShkZXZpY2UpKTsKKworICAgICAgICAgICAgICAgIC8vIGludGVyZmFjZSBzaG91bGQgYmUgZm9sbG93ZWQgYnkgdGhyZWUgZW5kcG9pbnRzCisgICAgICAgICAgICAgICAgc3RydWN0IHVzYl9lbmRwb2ludF9kZXNjcmlwdG9yICplcDsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgdXNiX2VuZHBvaW50X2Rlc2NyaXB0b3IgKmVwX2luX2Rlc2MgPSBOVUxMOworICAgICAgICAgICAgICAgIHN0cnVjdCB1c2JfZW5kcG9pbnRfZGVzY3JpcHRvciAqZXBfb3V0X2Rlc2MgPSBOVUxMOworICAgICAgICAgICAgICAgIHN0cnVjdCB1c2JfZW5kcG9pbnRfZGVzY3JpcHRvciAqZXBfaW50cl9kZXNjID0gTlVMTDsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IDM7IGkrKykgeworICAgICAgICAgICAgICAgICAgICBlcCA9IChzdHJ1Y3QgdXNiX2VuZHBvaW50X2Rlc2NyaXB0b3IgKil1c2JfZGVzY3JpcHRvcl9pdGVyX25leHQoJml0ZXIpOworICAgICAgICAgICAgICAgICAgICBpZiAoIWVwIHx8IGVwLT5iRGVzY3JpcHRvclR5cGUgIT0gVVNCX0RUX0VORFBPSU5UKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMT0dFKCJlbmRwb2ludHMgbm90IGZvdW5kXG4iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoZXAtPmJtQXR0cmlidXRlcyA9PSBVU0JfRU5EUE9JTlRfWEZFUl9CVUxLKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXAtPmJFbmRwb2ludEFkZHJlc3MgJiBVU0JfRU5EUE9JTlRfRElSX01BU0spCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXBfaW5fZGVzYyA9IGVwOworICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVwX291dF9kZXNjID0gZXA7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXAtPmJtQXR0cmlidXRlcyA9PSBVU0JfRU5EUE9JTlRfWEZFUl9JTlQgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIGVwLT5iRW5kcG9pbnRBZGRyZXNzICYgVVNCX0VORFBPSU5UX0RJUl9NQVNLKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlcF9pbnRyX2Rlc2MgPSBlcDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIWVwX2luX2Rlc2MgfHwgIWVwX291dF9kZXNjIHx8ICFlcF9pbnRyX2Rlc2MpIHsKKyAgICAgICAgICAgICAgICAgICAgTE9HRSgiZW5kcG9pbnRzIG5vdCBmb3VuZFxuIik7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgdXNiX2VuZHBvaW50ICplcF9pbiA9IHVzYl9lbmRwb2ludF9vcGVuKGRldmljZSwgZXBfaW5fZGVzYyk7CisgICAgICAgICAgICAgICAgc3RydWN0IHVzYl9lbmRwb2ludCAqZXBfb3V0ID0gdXNiX2VuZHBvaW50X29wZW4oZGV2aWNlLCBlcF9vdXRfZGVzYyk7CisgICAgICAgICAgICAgICAgc3RydWN0IHVzYl9lbmRwb2ludCAqZXBfaW50ciA9IHVzYl9lbmRwb2ludF9vcGVuKGRldmljZSwgZXBfaW50cl9kZXNjKTsKKworICAgICAgICAgICAgICAgIGlmICh1c2JfZGV2aWNlX2NsYWltX2ludGVyZmFjZShkZXZpY2UsIGludGVyZmFjZS0+YkludGVyZmFjZU51bWJlcikpIHsKKyAgICAgICAgICAgICAgICAgICAgTE9HRSgidXNiX2RldmljZV9jbGFpbV9pbnRlcmZhY2UgZmFpbGVkXG4iKTsKKyAgICAgICAgICAgICAgICAgICAgdXNiX2VuZHBvaW50X2Nsb3NlKGVwX2luKTsKKyAgICAgICAgICAgICAgICAgICAgdXNiX2VuZHBvaW50X2Nsb3NlKGVwX291dCk7CisgICAgICAgICAgICAgICAgICAgIHVzYl9lbmRwb2ludF9jbG9zZShlcF9pbnRyKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIE10cERldmljZSogbXRwRGV2aWNlID0gbmV3IE10cERldmljZShkZXZpY2UsIGludGVyZmFjZS0+YkludGVyZmFjZU51bWJlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlcF9pbiwgZXBfb3V0LCBlcF9pbnRyKTsKKyAgICAgICAgICAgICAgICBtRGV2aWNlTGlzdC5hZGQobXRwRGV2aWNlKTsKKyAgICAgICAgICAgICAgICBtdHBEZXZpY2UtPmluaXRpYWxpemUoKTsKKyAgICAgICAgICAgICAgICBkZXZpY2VBZGRlZChtdHBEZXZpY2UpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHVzYl9kZXZpY2VfY2xvc2UoZGV2aWNlKTsKK30KKworTXRwRGV2aWNlKiBNdHBDbGllbnQ6OmdldERldmljZShpbnQgaWQpIHsKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IG1EZXZpY2VMaXN0LnNpemUoKTsgaSsrKSB7CisgICAgICAgIE10cERldmljZSogZGV2aWNlID0gbURldmljZUxpc3RbaV07CisgICAgICAgIGlmIChkZXZpY2UtPmdldElEKCkgPT0gaWQpCisgICAgICAgICAgICByZXR1cm4gZGV2aWNlOworICAgIH0KKyAgICByZXR1cm4gTlVMTDsKK30KKwordm9pZCBNdHBDbGllbnQ6OnVzYkRldmljZVJlbW92ZWQoY29uc3QgY2hhciAqZGV2bmFtZSkgeworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbURldmljZUxpc3Quc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgTXRwRGV2aWNlKiBkZXZpY2UgPSBtRGV2aWNlTGlzdFtpXTsKKyAgICAgICAgaWYgKCFzdHJjbXAoZGV2bmFtZSwgZGV2aWNlLT5nZXREZXZpY2VOYW1lKCkpKSB7CisgICAgICAgICAgICBkZXZpY2VSZW1vdmVkKGRldmljZSk7CisgICAgICAgICAgICBtRGV2aWNlTGlzdC5yZW1vdmVBdChpKTsKKyAgICAgICAgICAgIGRlbGV0ZSBkZXZpY2U7CisgICAgICAgICAgICBMT0dEKCJDYW1lcmEgcmVtb3ZlZCFcbiIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9Cit9CisKK3Z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S5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqLworCisjaWZuZGVmIF9NVFBfQ0xJRU5UX0gKKyNkZWZpbmUgX01UUF9DTElFTlRfSAorCisjaW5jbHVkZSAiTXRwVHlwZXMuaCIKKworbmFtZXNwYWNlIGFuZHJvaWQgeworCitjbGFzcyBNdHBDbGllbnQgeworcHJpdmF0ZToKKyAgICBNdHBEZXZpY2VMaXN0ICAgICAgICAgICBtRGV2aWNlTGlzdDsKKyAgICBib29sICAgICAgICAgICAgICAgICAgICBtU3RhcnRlZDsKKworcHVibGljOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cENsaWVudCgpOworICAgIHZpcnR1YWwgICAgICAgICAgICAgICAgIH5NdHBDbGllbnQoKTsKKworICAgIGJvb2wgICAgICAgICAgICAgICAgICAgIHN0YXJ0KCk7CisKKyAgICBpbmxpbmUgTXRwRGV2aWNlTGlzdCYgICBnZXREZXZpY2VMaXN0KCkgeyByZXR1cm4gbURldmljZUxpc3Q7IH0KKyAgICBNdHBEZXZpY2UqICAgICAgICAgICAgICBnZXREZXZpY2UoaW50IGlkKTsKKworCisgICAgdmlydHVhbCB2b2lkICA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luZSBPQkpFQ1RfSU1BR0VfREVQVEggICAgICAgICAgMjEyCisjZGVmaW5lIE9CSkVDVF9QQVJFTlQgICAgICAgICAgICAgICAyMTMKKyNkZWZpbmUgT0JKRUNUX0FTU09DSUFUSU9OX1RZUEUgICAgIDIxNAorI2RlZmluZSBPQkpFQ1RfQVNTT0NJQVRJT05fREVTQyAgICAgMjE1CisjZGVmaW5lIE9CSkVDVF9TRVFVRU5DRV9OVU1CRVIgICAgICAyMTYKKyNkZWZpbmUgT0JKRUNUX05BTUUgICAgICAgICAgICAgICAgIDIxNworI2RlZmluZSBPQkpFQ1RfREFURV9DUkVBVEVEICAgICAgICAgMjE4CisjZGVmaW5lIE9CSkVDVF9EQVRFX01PRElGSUVEICAgICAgICAyMTkKKyNkZWZpbmUgT0JKRUNUX0tFWVdPUkRTICAgICAgICAgICAgIDIyMAorI2RlZmluZSBPQkpFQ1RfVEhVTUIgICAgICAgICAgICAgICAgMjIxCisKK010cEN1cnNvcjo6TXRwQ3Vyc29yKE10cENsaWVudCogY2xpZW50LCBpbnQgcXVlcnlUeXBlLCBpbnQgZGV2aWNlSUQsCisgICAgICAgICAgICAgICAgaW50IHN0b3JhZ2VJRCwgaW50IG9iamVjdElELCBpbnQgY29sdW1uQ291bnQsIGludCogY29sdW1ucykKKyAgICAgICAgOiAgIG1DbGllbnQoY2xpZW50KSwKKyAgICAgICAgICAgIG1RdWVyeVR5cGUocXVlcnlUeXBlKSwKKyAgICAgICAgICAgIG1EZXZpY2VJRChkZXZpY2VJRCksCisgICAgICAgICAgICBtU3RvcmFnZUlEKHN0b3JhZ2VJRCksCisgICAgICAgICAgICBtUWJqZWN0SUQob2JqZWN0SUQpLAorICAgICAgICAgICAgbUNvbHVtbkNvdW50KGNvbHVtbkNvdW50KSwKKyAgICAgICAgICAgIG1Db2x1bW5zKE5VTEwpCit7CisgICAgaWYgKGNvbHVtbnMpIHsKKyAgICAgICAgbUNvbHVtbnMgPSBuZXcgaW50W2NvbHVtbkNvdW50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ICAgICAgY2FzZSBPQkpFQ1RfQ0hJTERSRU46CisgICAgICAgICAgICByZXR1cm4gZmlsbE9iamVjdHMod2luZG93LCBtUWJqZWN0SUQsIHN0YXJ0UG9zKTsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIExPR0UoIk10cEN1cnNvcjo6ZmlsbFdpbmRvdzogdW5rbm93biBxdWVyeSB0eXBlICVkXG4iLCBtUXVlcnlUeXBlKTsKKyAgICAgICAgICAgIHJldHVybiAwOworICAgIH0KK30KKworaW50IE10cEN1cnNvcjo6ZmlsbERldmljZXMoQ3Vyc29yV2luZG93KiB3aW5kb3csIGludCBzdGFydFBvcykgeworICAgIGludCBjb3VudCA9IDA7CisgICAgTXRwRGV2aWNlTGlzdCYgZGV2aWNlTGlzdCA9IG1DbGllbnQtPmdldERldmljZUxpc3QoKTsKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IGRldmljZUxpc3Quc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgTXRwRGV2aWNlKiBkZXZpY2UgPSBkZXZpY2VMaXN0W2ldOworICAgICAgICBpZiAoZmlsbERldmljZSh3aW5kb3csIGRldmljZSwgc3RhcnRQb3MpKSB7CisgICAgICAgICAgICBjb3VudCsrOworICAgICAgICAgICAgc3RhcnRQb3MrKzsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybiBjb3VudDsKK30KKworaW50IE10cEN1cnNvcjo6ZmlsbERldmljZShDdXJzb3JXaW5kb3cqIHdpbmRvdywgaW50IHN0YXJ0UG9zKSB7CisgICAgTXRwRGV2aWNlKiBkZXZpY2UgPSBtQ2xpZW50LT5nZXREZXZpY2UobURldmljZUlEKTsKKyAgICBpZiAoZGV2aWNlICYmIGZpbGxEZXZpY2Uod2luZG93LCBkZXZpY2UsIHN0YXJ0UG9zKSkKKyAgICAgICAgcmV0dXJuIDE7CisgICAgZWxzZQorICAgICAgICByZXR1cm4gMDsKK30KKworaW50IE10cEN1cnNvcjo6ZmlsbFN0b3JhZ2VzKEN1cnNvcldpbmRvdyogd2luZG93LCBpbnQgc3RhcnRQb3MpIHsKKyAgICBpbnQgY291bnQgPSAwOworICAgIE10cERldmljZSogZGV2aWNlID0gbUNsaWVudC0+Z2V0RGV2aWNlKG1EZXZpY2VJRCk7CisgICAgaWYgKCFkZXZpY2UpCisgICAgICAgIHJldHVybiAwOworICAgIE10cFN0b3JhZ2VJRExpc3QqIHN0b3JhZ2VJRHMgPSBkZXZpY2UtPmdldFN0b3JhZ2VJRHMoKTsKKyAgICBpZiAoIXN0b3JhZ2VJRHMpCisgICAgICAgIHJldHVybiAwOworCisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzdG9yYWdlSURzLT5zaXplKCk7IGkrKykgeworICAgICAgICBNdHBTdG9yYWdlSUQgc3RvcmFnZUlEID0gKCpzdG9yYWdlSURzKVtpXTsKKyAgICAgICAgaWYgKGZpbGxTdG9yYWdlKHdpbmRvdywgZGV2aWNlLCBzdG9yYWdlSUQsIHN0YXJ0UG9zKSkgeworICAgICAgICAgICAgY291bnQrKzsKKyAgICAgICAgICAgIHN0YXJ0UG9zKys7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgICBkZWxldGUgc3RvcmFnZUlEczsKKyAgICByZXR1cm4gY291bnQ7Cit9CisKK2ludCBNdHBDdXJzb3I6OmZpbGxTdG9yYWdlKEN1cnNvcldpbmRvdyogd2luZG93LCBpbnQgc3RhcnRQb3MpIHsKKyAgICBNdHBEZXZpY2UqIGRldmljZSA9IG1DbGllbnQtPmdldERldmljZShtRGV2aWNlSUQpOworICAgIGlmIChkZXZpY2UgJiYgZmlsbFN0b3JhZ2Uod2luZG93LCBkZXZpY2UsIG1TdG9yYWdlSUQsIHN0YXJ0UG9zKSkKKyAgICAgICAgcmV0dXJuIDE7CisgICAgZWxzZQorICAgICAgICByZXR1cm4gMDsKK30KKworaW50IE10cEN1cnNvcjo6ZmlsbE9iamVjdHMoQ3Vyc29yV2luZG93KiB3aW5kb3csIGludCBwYXJlbnQsIGludCBzdGFydFBvcykgeworICAgIGludCBjb3VudCA9IDA7CisgICAgTXRwRGV2aWNlKiBkZXZpY2UgPSBtQ2xpZW50LT5nZXREZXZpY2UobURldmljZUlEKTsKKyAgICBpZiAoIWRldmljZSkKKyAgICAgICAgcmV0dXJuIDA7CisgICAgTXRwT2JqZWN0SGFuZGxlTGlzdCogaGFuZGxlcyA9IGRldmljZS0+Z2V0T2JqZWN0SGFuZGxlcyhtU3RvcmFnZUlELCAwLCBwYXJlbnQpOworICAgIGlmICghaGFuZGxlcykKKyAgICAgICAgcmV0dXJuIDA7CisKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IGhhbmRsZXMtPnNpemUoKTsgaSsrKSB7CisgICAgICAgIE10cE9iamVjdEhhbmRsZSBoYW5kbGUgPSAoKmhhbmRsZXMpW2ldOworICAgICAgICBpZiAoZmlsbE9iamVjdCh3aW5kb3csIGRldmljZSwgaGFuZGxlLCBzdGFydFBvcykpIHsKKyAgICAgICAgICAgIGNvdW50Kys7CisgICAgICAgICAgICBzdGFydFBvcysrOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisgICAgZGVsZXRlIGhhbmRsZXM7CisgICAgcmV0dXJuIGNvdW50OworfQorCitpbnQgTXRwQ3Vyc29yOjpmaWxsT2JqZWN0KEN1cnNvcldpbmRvdyogd2luZG93LCBpbnQgc3RhcnRQb3MpIHsKKyAgICBNdHBEZXZpY2UqIGRldmljZSA9IG1DbGllbnQtPmdldERldmljZShtRGV2aWNlSUQpOworICAgIGlmIChkZXZpY2UgJiYgZmlsbE9iamVjdCh3aW5kb3csIGRldmljZSwgbVFiamVjdElELCBzdGFydFBvcykpCisgICAgICAgIHJldHVybiAxOworICAgIGVsc2UKKyAgICAgICAgcmV0dXJuIDA7Cit9CisKK2Jvb2wgTXRwQ3Vyc29yOjpmaWxsRGV2aWNlKEN1cnNvcldpbmRvdyogd2luZG93LCBNdHBEZXZpY2UqIGRldmljZSwgaW50IHJvdykgeworICAgIE10cERldmljZUluZm8qIGRldmljZUluZm8gPSBkZXZpY2UtPmdldERldmljZUluZm8oKTsKKyAgICBpZiAoIWRldmljZUluZm8pCisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICBpZiAoIXByZXBhcmVSb3cod2luZG93KSkKKyAgICAgICAgcmV0dXJuIGZhbHNlOworCisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtQ29sdW1uQ291bnQ7IGkrKykgeworICAgICAgICBzd2l0Y2ggKG1Db2x1bW5zW2ldKSB7CisgICAgICAgICAgICBjYXNlIERFVklDRV9ST1dfSUQ6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgZGV2aWNlLT5nZXRJRCgpLCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBERVZJQ0VfTUFOVUZBQ1RVUkVSOgorICAgICAgICAgICAgICAgIGlmICghcHV0U3RyaW5nKHdpbmRvdywgZGV2aWNlSW5mby0+bU1hbnVmYWN0dXJlciwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgREVWSUNFX01PREVMOgorICAgICAgICAgICAgICAgIGlmICghcHV0U3RyaW5nKHdpbmRvdywgZGV2aWNlSW5mby0+bU1vZGVsLCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBMT0dFKCJmaWxsRGV2aWNlOiB1bmtub3duIGNvbHVtbiAlZFxuIiwgbUNvbHVtbnNbaV0pOworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiB0cnVlOworfQorCitib29sIE10cEN1cnNvcjo6ZmlsbFN0b3JhZ2UoQ3Vyc29yV2luZG93KiB3aW5kb3csIE10cERldmljZSogZGV2aWNlLAorICAgICAgICBNdHBTdG9yYWdlSUQgc3RvcmFnZUlELCBpbnQgcm93KSB7CisKK0xPR0QoImZpbGxTdG9yYWdlICVkXG4iLCBzdG9yYWdlSUQpOworCisgICAgTXRwU3RvcmFnZUluZm8qIHN0b3JhZ2VJbmZvID0gZGV2aWNlLT5nZXRTdG9yYWdlSW5mbyhzdG9yYWdlSUQpOworICAgIGlmICghc3RvcmFnZUluZm8pCisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICBpZiAoIXByZXBhcmVSb3cod2luZG93KSkgeworICAgICAgICBkZWxldGUgc3RvcmFnZUluZm87CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBjb25zdCBjaGFyKiB0ZXh0OworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbUNvbHVtbkNvdW50OyBpKyspIHsKKyAgICAgICAgc3dpdGNoIChtQ29sdW1uc1tpXSkgeworICAgICAgICAgICAgY2FzZSBTVE9SQUdFX1JPV19JRDoKKyAgICAgICAgICAgICAgICBpZiAoIXB1dExvbmcod2luZG93LCBzdG9yYWdlSUQsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNUT1JBR0VfSURFTlRJRklFUjoKKyAgICAgICAgICAgICAgICB0ZXh0ID0gc3RvcmFnZUluZm8tPm1Wb2x1bWVJZGVudGlmaWVyOworICAgICAgICAgICAgICAgIGlmICghdGV4dCB8fCAhdGV4dFswXSkKKyAgICAgICAgICAgICAgICAgICAgdGV4dCA9ICJDYW1lcmEgU3RvcmFnZSI7CisgICAgICAgICAgICAgICAgaWYgKCFwdXRTdHJpbmcod2luZG93LCB0ZXh0LCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTVE9SQUdFX0RFU0NSSVBUSU9OOgorICAgICAgICAgICAgICAgIHRleHQgPSBzdG9yYWdlSW5mby0+bVN0b3JhZ2VEZXNjcmlwdGlvbjsKKyAgICAgICAgICAgICAgICBpZiAoIXRleHQgfHwgIXRleHRbMF0pCisgICAgICAgICAgICAgICAgICAgIHRleHQgPSAiU3RvcmFnZSBEZXNjcmlwdGlvbiI7CisgICAgICAgICAgICAgICAgaWYgKCFwdXRTdHJpbmcod2luZG93LCB0ZXh0LCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBMT0dFKCJmaWxsU3RvcmFnZTogdW5rbm93biBjb2x1bW4gJWRcbiIsIG1Db2x1bW5zW2ldKTsKKyAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBkZWxldGUgc3RvcmFnZUluZm87CisgICAgcmV0dXJuIHRydWU7CisKK2ZhaWw6CisgICAgZGVsZXRlIHN0b3JhZ2VJbmZvOworICAgIHJldHVybiBmYWxzZTsKK30KKworYm9vbCBNdHBDdXJzb3I6OmZpbGxPYmplY3QoQ3Vyc29yV2luZG93KiB3aW5kb3csIE10cERldmljZSogZGV2aWNlLAorICAgICAgICBNdHBPYmplY3RIYW5kbGUgb2JqZWN0SUQsIGludCByb3cpIHsKKworICAgIE10cE9iamVjdEluZm8qIG9iamVjdEluZm8gPSBkZXZpY2UtPmdldE9iamVjdEluZm8ob2JqZWN0SUQpOworICAgIGlmICghb2JqZWN0SW5mbykKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIC8vIG9iamVjdEluZm8tPnByaW50KCk7CisgICAgaWYgKCFwcmVwYXJlUm93KHdpbmRvdykpIHsKKyAgICAgICAgZGVsZXRlIG9iamVjdEluZm87CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IG1Db2x1bW5Db3VudDsgaSsrKSB7CisgICAgICAgIHN3aXRjaCAobUNvbHVtbnNbaV0pIHsKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX1JPV19JRDoKKyAgICAgICAgICAgICAgICBpZiAoIXB1dExvbmcod2luZG93LCBvYmplY3RJRCwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX1NUT1JBR0VfSUQ6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bVN0b3JhZ2VJRCwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX0ZPUk1BVDoKKyAgICAgICAgICAgICAgICBpZiAoIXB1dExvbmcod2luZG93LCBvYmplY3RJbmZvLT5tRm9ybWF0LCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBPQkpFQ1RfUFJPVEVDVElPTl9TVEFUVVM6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bVByb3RlY3Rpb25TdGF0dXMsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9TSVpFOgorICAgICAgICAgICAgICAgIGlmICghcHV0TG9uZyh3aW5kb3csIG9iamVjdEluZm8tPm1Db21wcmVzc2VkU2l6ZSwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX1RIVU1CX0ZPUk1BVDoKKyAgICAgICAgICAgICAgICBpZiAoIXB1dExvbmcod2luZG93LCBvYmplY3RJbmZvLT5tVGh1bWJGb3JtYXQsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9USFVNQl9TSVpFOgorICAgICAgICAgICAgICAgIGlmICghcHV0TG9uZyh3aW5kb3csIG9iamVjdEluZm8tPm1UaHVtYkNvbXByZXNzZWRTaXplLCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBPQkpFQ1RfVEhVTUJfV0lEVEg6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bVRodW1iUGl4V2lkdGgsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9USFVNQl9IRUlHSFQ6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bVRodW1iUGl4SGVpZ2h0LCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBPQkpFQ1RfSU1BR0VfV0lEVEg6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bUltYWdlUGl4V2lkdGgsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9JTUFHRV9IRUlHSFQ6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bUltYWdlUGl4SGVpZ2h0LCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBPQkpFQ1RfSU1BR0VfREVQVEg6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bUltYWdlUGl4RGVwdGgsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9QQVJFTlQ6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bVBhcmVudCwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX0FTU09DSUFUSU9OX1RZUEU6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bUFzc29jaWF0aW9uVHlwZSwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX0FTU09DSUFUSU9OX0RFU0M6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bUFzc29jaWF0aW9uRGVzYywgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX1NFUVVFTkNFX05VTUJFUjoKKyAgICAgICAgICAgICAgICBpZiAoIXB1dExvbmcod2luZG93LCBvYmplY3RJbmZvLT5tU2VxdWVuY2VOdW1iZXIsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9OQU1FOgorICAgICAgICAgICAgICAgIGlmICghcHV0U3RyaW5nKHdpbmRvdywgb2JqZWN0SW5mby0+bU5hbWUsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9EQVRFX0NSRUFURUQ6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bURhdGVDcmVhdGVkLCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBPQkpFQ1RfREFURV9NT0RJRklFRDoKKyAgICAgICAgICAgICAgICBpZiAoIXB1dExvbmcod2luZG93LCBvYmplY3RJbmZvLT5tRGF0ZU1vZGlmaWVkLCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBPQkpFQ1RfS0VZV09SRFM6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRTdHJpbmcod2luZG93LCBvYmplY3RJbmZvLT5tS2V5d29yZHMsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9USFVNQjoKKyAgICAgICAgICAgICAgICBpZiAoIXB1dFRodW1ibmFpbCh3aW5kb3csIG9iamVjdElELCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIExPR0UoImZpbGxTdG9yYWdlOiB1bmtub3duIGNvbHVtbiAlZFxuIiwgbUNvbHVtbnNbaV0pOworICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgfQorICAgIH0KKworICAgIGRlbGV0ZSBvYmplY3RJbmZvOworICAgIHJldHVybiB0cnVlOworCitmYWlsOgorICAgIGRlbGV0ZSBvYmplY3RJbmZvOworICAgIHJldHVybiBmYWxzZTsKK30KKworYm9vbCBNdHBDdXJzb3I6OnByZXBhcmVSb3coQ3Vyc29yV2luZG93KiB3aW5kb3cpIHsKKyAgICBpZiAoIXdpbmRvdy0+c2V0TnVtQ29sdW1ucyhtQ29sdW1uQ291bnQpKSB7CisgICAgICAgIExPR0UoIkZhaWxlZCB0byBjaGFuZ2UgY29sdW1uIGNvdW50IGZyb20gJWQgdG8gJWQiLCB3aW5kb3ctPmdldE51bUNvbHVtbnMoKSwgbUNvbHVtbkNvdW50KTsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKyAgICBmaWVsZF9zbG90X3QgKiBmaWVsZERpciA9IHdpbmRvdy0+YWxsb2NSb3coKTsKKyAgICBpZiAoIWZpZWxkRGlyKSB7CisgICAgICAgIExPR0UoIkZhaWxlZCBhbGxvY2F0aW5nIGZpZWxkRGlyIik7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisgICAgcmV0dXJuIHRydWU7Cit9CisKKworYm9vbCBNdHBDdXJzb3I6OnB1dExvbmcoQ3Vyc29yV2luZG93KiB3aW5kb3csIG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0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAorICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKi8KKworI2lmbmRlZiBfTVRQX0NVUlNPUl9ICisjZGVmaW5lIF9NVFBfQ1VSU09SX0gKKworI2luY2x1ZGUgIk10cFR5cGVzLmgiCisKK25hbWVzcGFjZSBhbmRyb2lkIHsKKworY2xhc3MgQ3Vyc29yV2luZG93OworCitjbGFzcyBNdHBDdXJzb3IgeworcHJpdmF0ZToKKyAgICBlbnVtIHsKKyAgICAgICAgREVWSUNFICAgICAgICAgICAgICA9IDEsCisgICAgICAgIERFVklDRV9JRCAgICAgICAgICAgPSAyLAorICAgICAgICBTVE9SQUdFICAgICAgICAgICAgID0gMywKKyAgICAgICAgU1RPUkFHRV9JRCAgICAgICAgICA9IDQsCisgICAgICAgIE9CSkVDVCAgICAgICAgICAgICAgPSA1LAorICAgICAgICBPQkpFQ1RfSUQgICAgICAgICAgID0gNiwKKyAgICAgICAgU1RPUkFHRV9DSElMRFJFTiAgICA9IDcsCisgICAgICAgIE9CSkVDVF9DSElMRFJFTiAgICAgPSA4LAorICAgIH07CisKKyAgICBNdHBDbGllbnQqICBtQ2xpZW50OworICAgIGludCAgICAgICAgIG1RdWVyeVR5cGU7CisgICAgaW50ICAgICAgICAgbURldmljZUlEOworICAgIGludCAgICAgICAgIG1TdG9yYWdlSUQ7CisgICAgaW50ICAgICAgICAgbVFiamVjdElEOworICAgIGludCAgICAgICAgIG1Db2x1bW5Db3VudDsKKyAgICBpbnQqICAgICAgICBtQ29sdW1uczsKKworcHVibGljOgorICAgICAgICAgICAgICAgIE10cEN1cnNvcihNdHBDbGllbnQqIGNsaWVudCwgaW50IHF1ZXJ5VHlwZSwgaW50IGRldmljZUlELAorICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0b3JhZ2VJRCwgaW50IG9iamVjdElELCBpbnQgY29sdW1uQ291bnQsIGludCogY29sdW1ucyk7CisgICAgdmlydHVhbCAgICAgfk10cEN1cnNvcigpOworCisgICAgaW50ICAgICAgICAgZmlsbFdpbmRvdyhDdXJzb3JXaW5kb3cqIHdpbmRvdywgaW50IHN0YXJ0UG9zKTsKKworcHJpdmF0ZToKKyAgICBpbnQgICAgICAgICBmaWxsRGV2aWNlcyhDdXJzb3JXaW5kb3cqIHdpbmRvdywgaW50IHN0YXJ0UG9zKTsKKyAgICBpbnQgICAgICAgICBmaWxsRGV2aWNlKEN1cnNvcldpbmRvdyogd2luZG93LCBpbnQgc3RhcnRQb3MpOworICAgIGludCAgICAgICAgIGZpbGxTdG9yYWdlcyhDdXJzb3JXaW5kb3cqIHdpbmRvdywgaW50IHN0YXJ0UG9zKTsKKyAgICBpbnQgICAgICAgICBmaWxsU3RvcmFnZShDdXJzb3JXaW5kb3cqIHdpbmRvdywgaW50IHN0YXJ0UG9zKTsKKyAgICBpbnQgICAgICAgICBmaWxsT2JqZWN0cyhDdXJzb3JXaW5kb3cqIHdpbmRvdywgaW50IHBhcmVudCwgaW50IHN0YXJ0UG9zKTsKKyAgICBpbnQgICAgICAgICBmaWxsT2JqZWN0KEN1cnNvcldpbmRvdyogd2luZG93LCBpbnQgc3RhcnRQb3MpOworCisgICAgYm9vbCAgICAgICAgZmlsbERldmljZShDdXJzb3JXaW5kb3cqIHdpbmRvdywgTXRwRGV2aWNlKiBkZXZpY2UsIGludCBzdGFydFBvcyk7CisgICAgYm9vbCAgICAgICAgZmlsbFN0b3JhZ2UoQ3Vyc29yV2luZG93KiB3aW5kb3csIE10cERldmljZSogZGV2aWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgTXRwU3RvcmFnZUlEIHN0b3JhZ2VJRCwgaW50IHJvdyk7CisgICAgYm9vb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gaSA9IDA7IGkgPCBjb3VudDsgaSsrKQorICAgICAgICByZXN1bHQtPnB1c2goZ2V0SW50OCgpKTsKKyAgICByZXR1cm4gcmVzdWx0OworfQorCitVSW50OExpc3QqIE10cERhdGFQYWNrZXQ6OmdldEFVSW50OCgpIHsKKyAgICBVSW50OExpc3QqIHJlc3VsdCA9IG5ldyBVSW50OExpc3Q7CisgICAgaW50IGNvdW50ID0gZ2V0VUludDMyKCk7CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKQorICAgICAgICByZXN1bHQtPnB1c2goZ2V0VUludDgoKSk7CisgICAgcmV0dXJuIHJlc3VsdDsKK30KKworSW50MTZMaXN0KiBNdHBEYXRhUGFja2V0OjpnZXRBSW50MTYoKSB7CisgICAgSW50MTZMaXN0KiByZXN1bHQgPSBuZXcgSW50MTZMaXN0OworICAgIGludCBjb3VudCA9IGdldFVJbnQzMigpOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykKKyAgICAgICAgcmVzdWx0LT5wdXNoKGdldEludDE2KCkpOworICAgIHJldHVybiByZXN1bHQ7Cit9CisKK1VJbnQxNkxpc3QqIE10cERhdGFQYWNrZXQ6OmdldEFVSW50MTYoKSB7CisgICAgVUludDE2TGlzdCogcmVzdWx0ID0gbmV3IFVJbnQxNkxpc3Q7CisgICAgaW50IGNvdW50ID0gZ2V0VUludDMyKCk7CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKQorICAgICAgICByZXN1bHQtPnB1c2goZ2V0VUludDE2KCkpOworICAgIHJldHVybiByZXN1bHQ7Cit9CisKK0ludDMyTGlzdCogTXRwRGF0YVBhY2tldDo6Z2V0QUludDMyKCkgeworICAgIEludDMyTGlzdCogcmVzdWx0ID0gbmV3IEludDMyTGlzdDsKKyAgICBpbnQgY291bnQgPSBnZXRVSW50MzIoKTsKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspCisgICAgICAgIHJlc3VsdC0+cHVzaChnZXRJbnQzMigpKTsKKyAgICByZXR1cm4gcmVzdWx0OworfQorCitVSW50MzJMaXN0KiBNdHBEYXRhUGFja2V0OjpnZXRBVUludDMyKCkgeworICAgIFVJbnQzMkxpc3QqIHJlc3VsdCA9IG5ldyBVSW50MzJMaXN0OworICAgIGludCBjb3VudCA9IGdldFVJbnQzMigpOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykKKyAgICAgICAgcmVzdWx0LT5wdXNoKGdldFVJbnQzMigpKTsKKyAgICByZXR1cm4gcmVzdWx0OworfQorCitJbnQ2NExpc3QqIE10cERhdGFQYWNrZXQ6OmdldEFJbnQ2NCgpIHsKKyAgICBJbnQ2NExpc3QqIHJlc3VsdCA9IG5ldyBJbnQ2NExpc3Q7CisgICAgaW50IGNvdW50ID0gZ2V0VUludDMyKCk7CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKQorICAgICAgICByZXN1bHQtPnB1c2goZ2V0SW50NjQoKSk7CisgICAgcmV0dXJuIHJlc3VsdDsKK30KKworVUludDY0TGlzdCogTXRwRGF0YVBhY2tldDo6Z2V0QVVJbnQ2NCgpIHsKKyAgICBVSW50NjRMaXN0KiByZXN1bHQgPSBuZXcgVUludDY0TGlzdDsKKyAgICBpbnQgY291bnQgPSBnZXRVSW50MzIoKTsKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspCisgICAgICAgIHJlc3VsdC0+cHVzaChnZXRVSW50NjQoKSk7CisgICAgcmV0dXJuIHJlc3VsdDsKK30KKwordm9pZCBNdHBEYXRhUGFja2V0OjpwdXRJbnQ4KGludDhfdCB2YWx1ZSkgeworICAgIGFsbG9jYXRlKG1PZmZzZXQgKyAxKTsKKyAgICBtQnVmZmVyW21PZmZzZXQrK10gPSAodWludDhfdCl2YWx1ZTsKKyAgICBpZiAobVBhY2tldFNpemUgPCBtT2Zmc2V0KQorICAgICAgICBtUGF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GF0YVBhY2tldDo6cHV0QUludDE2KGNvbnN0IGludDE2X3QqIHZhbHVlcywgaW50IGNvdW50KSB7CisgICAgcHV0VUludDMyKGNvdW50KTsKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspCisgICAgICAgIHB1dEludDE2KCp2YWx1ZXMrKyk7Cit9CisKK3ZvaWQgTXRwRGF0YVBhY2tldDo6cHV0QVVJbnQxNihjb25zdCB1aW50MTZfdCogdmFsdWVzLCBpbnQgY291bnQpIHsKKyAgICBwdXRVSW50MzIoY291bnQpOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykKKyAgICAgICAgcHV0VUludDE2KCp2YWx1ZXMrKyk7Cit9CisKK3ZvaWQgTXRwRGF0YVBhY2tldDo6cHV0QUludDMyKGNvbnN0IGludDMyX3QqIHZhbHVlcywgaW50IGNvdW50KSB7CisgICAgcHV0VUludDMyKGNvdW50KTsKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspCisgICAgICAgIHB1dEludDMyKCp2YWx1ZXMrKyk7Cit9CisKK3ZvaWQgTXRwRGF0YVBhY2tldDo6cHV0QVVJbnQzMihjb25zdCB1aW50MzJfdCogdmFsdWVzLCBpbnQgY291bnQpIHsKKyAgICBwdXRVSW50MzIoY291bnQpOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykKKyAgICAgICAgcHV0VUludDMyKCp2YWx1ZXMrKyk7Cit9CisKK3ZvaWQgTXRwRGF0YVBhY2tldDo6cHV0QVVJbnQzMihjb25zdCBVSW50MzJMaXN0KiBsaXN0KSB7CisgICAgaWYgKCFsaXN0KSB7CisgICAgICAgIHB1dEVtcHR5QXJyYXkoKTsKKyAgICB9IGVsc2UgeworICAgICAgICBzaXplX3Qgc2l6ZSA9IGxpc3QtPnNpemUoKTsKKyAgICAgICAgcHV0VUludDMyKHNpemUpOworICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8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BREVSX1NJWkUpCisgICAgICAgIHJldHVybiAtMTsKKyAgICAvLyB0aGVuIHRoZSBmb2xsb3dpbmcgZGF0YQorICAgIGludCB0b3RhbCA9IE10cFBhY2tldDo6Z2V0VUludDMyKE1UUF9DT05UQUlORVJfTEVOR1RIX09GRlNFVCk7CisgICAgaW50IHJlbWFpbmluZyA9IHRvdGFsIC0gTVRQX0NPTlRBSU5FUl9IRUFERVJfU0laRTsKK3ByaW50ZigidG90YWw6ICVkLCByZW1haW5pbmc6ICVkXG4iLCB0b3RhbCwgcmVtYWluaW5nKTsKKyAgICByZXQgPSA6OnJlYWQoZmQsICZtQnVmZmVyWzBdICsgTVRQX0NPTlRBSU5FUl9IRUFERVJfU0laRSwgcmVtYWluaW5nKTsKK3ByaW50ZigiTXRwRGF0YVBhY2tldDo6cmVhZCAyIHJldHVybmVkICVkXG4iLCByZXQpOworICAgIGlmIChyZXQgIT0gcmVtYWluaW5nKQorICAgICAgICByZXR1cm4gLTE7CisKKyAgICBtUGFja2V0U2l6ZSA9IHRvdGFsOworICAgIG1PZmZzZXQgPSBNVFBfQ09OVEFJTkVSX0hFQURFUl9TSVpFOworICAgIHJldHVybiB0b3RhbDsKK30KKworaW50IE10cERhdGFQYWNrZXQ6OnJlYWREYXRhSGVhZGVyKGludCBmZCkgeworICAgIGludCByZXQgPSA6OnJlYWQoZmQsIG1CdWZmZXIsIE1UUF9DT05UQUlORVJfSEVBREVSX1NJWkUpOworICAgIGlmIChyZXQgPiAwKQorICAgICAgICBtUGFja2V0U2l6ZSA9IHJldDsKKyAgICBlbHNlCisgICAgICAgIG1QYWNrZXRTaXplID0gMDsKKyAgICByZXR1cm4gcmV0OworfQorCitpbnQgTXRwRGF0YVBhY2tldDo6d3JpdGUoaW50IGZkKSB7CisgICAgTXRwUGFja2V0OjpwdXRVSW50MzIoTVRQX0NPTlRBSU5FUl9MRU5HVEhfT0ZGU0VULCBtUGFja2V0U2l6ZSk7CisgICAgTXRwUGFja2V0OjpwdXRVS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09OVEFJTkVSX1RZUEVfREFUQSk7CisKKyAgICAvLyBzZW5kIGhlYWRlciBzZXBhcmF0ZWx5IGZyb20gZGF0YQorICAgIGludCByZXQgPSB0cmFuc2ZlcihlcCwgbUJ1ZmZlciwgTVRQX0NPTlRBSU5FUl9IRUFERVJfU0laRSk7CisgICAgaWYgKHJldCA9PSBNVFBfQ09OVEFJTkVSX0hFQURFUl9TSVpFKQorICAgICAgICByZXQgPSB0cmFuc2ZlcihlcCwgbUJ1ZmZlciArIE1UUF9DT05UQUlORVJfSEVBREVSX1NJWkUsCisgICAgICAgICAgICAgICAgICAgICAgICBtUGFja2V0U2l6ZSAtIE1UUF9DT05UQUlORVJfSEVBREVSX1NJWkUpOworICAgIHJldHVybiAocmV0IDwgMCA/IHJldCA6IDApOworfQorCisjZW5kaWYgLy8gTVRQX0hPU1QKKwordm9pZCogTXRwRGF0YVBhY2tldDo6Z2V0RGF0YShpbnQmIG91dExlbmd0aCkgY29uc3QgeworICAgIGludCBsZW5ndGggPSBtUGFja2V0U2l6ZSAtIE1UUF9DT05UQUlORVJfSEVBREVSX1NJWkU7CisgICAgaWYgKGxlbmd0aCA+IDApIHsKKyAgICAgICAgdm9pZCogcmVzdWx0ID0gbWFsbG9jKGxlbmd0aCk7CisgICAgICAgIGlmIChyZXN1bHQpIHsKKyAgICAgICAgICAgIG1lbWNweShyZXN1bHQsIG1CdWZmZXIgKyBNVFBfQ09OVEFJTkVSX0hFQURFUl9TSVpFLCBsZW5ndGgpOworICAgICAgICAgICAgb3V0TGVuZ3RoID0gbGVuZ3RoOworICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICAgICAgfQorICAgIH0KKyAgICBvdXRMZW5ndGggPSAwOworICAgIHJldHVybiBOVUxMOworfQorCit9ICAvLyBuYW1lc3BhY2UgYW5kcm9pZApkaWZmIC0tZ2l0IGEvbWVkaWEvbXRwL010cERhdGFQYWNrZXQuaCBiL21lZGlhL210cC9NdHBEYXRhUGFja2V0LmgKb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hY2tldC5oIgorI2luY2x1ZGUgIm10cC5oIgorCituYW1lc3BhY2UgYW5kcm9pZCB7CisKK2NsYXNzIE10cERhdGFQYWNrZXQgOiBwdWJsaWMgTXRwUGFja2V0IHsKK3ByaXZhdGU6CisgICAgLy8gY3VycmVudCBvZmZzZXQgZm9yIGdldC9wdXQgbWV0aG9kcworICAgIGludCAgICAgICAgICAgICAgICAgbU9mZnNldDsKKworcHVibGljOgorICAgICAgICAgICAgICAgICAgICAgICAgTXRwRGF0YVBhY2tldCgpOworICAgIHZpcnR1YWwgICAgICAgICAgICAgfk10cERhdGFQYWNrZXQoKTsKKworICAgIHZpcnR1YWwgdm9pZCAgICAgICAgcmVzZXQoKTsKKworICAgIHZvaWQgICAgICAgICAgICAgICAgc2V0T3BlcmF0aW9uQ29kZShNdHBPcGVyYXRpb25Db2RlIGNvZGUpOworICAgIHZvaWQgICAgICAgICAgICAgICAgc2V0VHJhbnNhY3Rpb25JRChNdHBUcmFuc2FjdGlvbklEIGlkKTsKKworICAgIGlubGluZSB1aW50OF90ICAgICAgZ2V0VUludDgoKSB7IHJldHVybiAodWludDhfdCltQnVmZmVyW21PZmZzZXQrK107IH0KKyAgICBpbmxpbmUgaW50OF90ICAgICAgIGdldEludDgoKSB7IHJldHVybiAoaW50OF90KW1CdWZmZXJbbU9mZnNldCsrXTsgfQorICAgIHVpbnQxNl90ICAgICAgICAgICAgZ2V0VUludDE2KCk7CisgICAgaW5saW5lIGludDE2X3QgICAgICBnZXRJbnQxNigpIHsgcmV0dXJuIChpbnQxNl90KWdldFVJbnQxNigpOyB9CisgICAgdWludDMyX3QgICAgICAgICAgICBnZXRVSW50MzIoKTsKKyAgICBpbmxpbmUgaW50MzJfdCAgICAgIGdldEludDMyKCkgeyByZXR1cm4gKGludDMyX3QpZ2V0VUludDMyKCk7IH0KKyAgICB1aW50NjRfdCAgICAgICAgICAgIGdldFVJbnQ2NCgpOworICAgIGlubGluZSBpbnQ2NF90ICAgICAgZ2V0SW50NjQoKSB7IHJldHVybiAoaW50NjRfdClnZXRVSW50NjQoKTsgfQorICAgIHZvaWQgICAgICAgICAgICAgICAgZ2V0VUludDEyOCh1aW50MTI4X3QmIHZhbHVlKTsKKyAgICBpbmxpbmUgdm9pZCAgICAgICAgIGdldEludDEyOChpbnQxMjhfdCYgdmFsdWUpIHsgZ2V0VUludDEyOCgodWludDEyOF90Jil2YWx1ZSk7IH0KKyAgICB2b2lkICAgICAgICAgICAgICAgIGdldFN0cmluZyhNdHBTdHJpbmdCdWZmZXImIHN0cmluZyk7CisKKyAgICBJbnQ4TGlzdCogICAgICAgICAgIGdldEFJbnQ4KCk7CisgICAgVUludDhMaXN0KiAgICAgICAgICBnZXRBVUludDgoKTsKKyAgICBJbnQxNkxpc3QqICAgICAgICAgIGdldEFJbnQxNigpOworICAgIFVJbnQxNkxpc3QqICAgICAgICAgZ2V0QVVJbnQxNigpOworICAgIEludDMyTGlzdCogICAgICAgICAgZ2V0QUludDMyKCk7CisgICAgVUludDMyTGlzdCogICAgICAgICBnZXRBVUludDMyKCk7CisgICAgSW50NjRMaXN0KiAgICAgICAgICBnZXRBSW50NjQoKTsKKyAgICBVSW50NjRMaXN0KiAgICAgICAgIGdldEFVSW50NjQoKTsKKworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0SW50OChpbnQ4X3QgdmFsdWUpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0VUludDgodWludDhfdCB2YWx1ZSk7CisgICAgdm9pZCAgICAgICAgICAgICAgICBwdXRJbnQxNihpbnQxNl90IHZhbHVlKTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dFVJbnQxNih1aW50MTZfdCB2YWx1ZSk7CisgICAgdm9pZCAgICAgICAgICAgICAgICBwdXRJbnQzMihpbnQzMl90IHZhbHVlKTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dFVJbnQzMih1aW50MzJfdCB2YWx1ZSk7CisgICAgdm9pZCAgICAgICAgICAgICAgICBwdXRJbnQ2NChpbnQ2NF90IHZhbHVlKTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dFVJbnQ2NCh1aW50NjRfdCB2YWx1ZSk7CisgICAgdm9pZCAgICAgICAgICAgICAgICBwdXRJbnQxMjgoY29uc3QgaW50MTI4X3QmIHZhbHVlKTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dFVJbnQxMjgoY29uc3QgdWludDEyOF90JiB2YWx1ZSk7CisKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dEFJbnQ4KGNvbnN0IGludDhfdCogdmFsdWVzLCBpbnQgY291bnQpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0QVVJbnQ4KGNvbnN0IHVpbnQ4X3QqIHZhbHVlcywgaW50IGNvdW50KTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dEFJbnQxNihjb25zdCBpbnQxNl90KiB2YWx1ZXMsIGludCBjb3VudCk7CisgICAgdm9pZCAgICAgICAgICAgICAgICBwdXRBVUludDE2KGNvbnN0IHVpbnQxNl90KiB2YWx1ZXMsIGludCBjb3VudCk7CisgICAgdm9pZCAgICAgICAgICAgICAgICBwdXRBSW50MzIoY29uc3QgaW50MzJfdCogdmFsdWVzLCBpbnQgY291bnQpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0QVVJbnQzMihjb25zdCB1aW50MzJfdCogdmFsdWVzLCBpbnQgY291bnQpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0QVVJbnQzMihjb25zdCBVSW50MzJMaXN0KiBsaXN0KTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dEFJbnQ2NChjb25zdCBpbnQ2NF90KiB2YWx1ZXMsIGludCBjb3VudCk7CisgICAgdm9pZCAgICAgICAgICAgICAgICBwdXRBVUludDY0KGNvbnN0IHVpbnQ2NF90KiB2YWx1ZXMsIGludCBjb3VudCk7CisgICAgdm9pZCAgICAgICAgICAgICAgICBwdXRTdHJpbmcoY29uc3QgTXRwU3RyaW5nQnVmZmVyJiBzdHJpbmcpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0U3RyaW5nKGNvbnN0IGNoYXIqIHN0cmluZyk7CisgICAgaW5saW5lIHZvaWQgICAgICAgICBwdXRFbXB0eVN0cmluZygpIHsgcHV0VUludDE2KDApOyB9CisgICAgaW5saW5lIHZvaWQgICAgICAgICBwdXRFbXB0eUFycmF5KCkgeyBwdXRVSW50MzIoMCk7IH0KKworCisjaWZkZWYgTVRQX0RFVklDRQorICAgIC8vIGZpbGwgb3VyIGJ1ZmZlciB3aXRoIGRhdGEgZnJvbSB0aGUgZ2l2ZW4gZmlsZSBkZXNjcmlwdG9yCisgICAgaW50ICAgICAgICAgICAgICAgICByZWFkKGludCBmZCk7CisgICAgaW50ICAgICAgICAgICAgICAgICByZWFkRGF0YUhlYWRlcihpbnQgZmQpOworCisgICAgLy8gd3JpdGUgb3VyIGRhdGEgdG8gdGhlIGdpdmVuIGZpbGUgZGVzY3JpcHRvcgorICAgIGludCAgICAgICAgICAgICAgICAgd3JpdGUoaW50IGZkKTsKKyAgICBpbnQgICAgICAgICAgICAgICAgIHdyaXRlRGF0YUhlYWRlcihpbnQgZmQsIHVpbnQzMl90IGxlbmd0aCk7CisjZW5kaWYKKworI2lmZGVmIE1UUF9IT1NUCisgICAgaW50ICAgICAgICAgICAgICAgICByZWFkKHN0cnVjdCB1c2JfZW5kcG9pbnQgKmVwKTsKKyAgICBpbnQgICAgICAgICAgICAgICAgIHdyaXRlKHN0cnVjdCB1c2JfZW5kcG9pbnQgKmVwKTsKKyNlbmRpZgorCisgICAgaW5saW5lIGJvb2wgICAgICAgICBoYXNEYXRhKCkgY29uc3QgeyByZXR1cm4gbVBhY2tldFNpemUgPiBNVFBfQ09OVEFJTkVSX0hFQURFUl9TSVpFOyB9CisgICAgdm9pZCogICAgICAgICAgICAgICBnZXREYXRhKGludCYgb3V0TGVuZ3RoKSBjb25zdDsKK307CisKK307IC8vIG5hbWVzcGFjZSBhbmRyb2lkCis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ICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKi8KKworI2luY2x1ZGUgIk10cERhdGFiYXNlLmgiCisjaW5jbHVkZSAiTXRwRGF0YVBhY2tldC5oIgorI2luY2x1ZGUgIk10cFV0aWxzLmgiCisjaW5jbHVkZSAiU3FsaXRlRGF0YWJhc2UuaCIKKyNpbmNsdWRlICJTcWxpdGVTdGF0ZW1lbnQuaCIKKworI2luY2x1ZGUgPHN0ZGlvLmg+CisjaW5jbHVkZSA8c3RkbGliLmg+CisjaW5jbHVkZSA8c3FsaXRlMy5oPgorCituYW1lc3BhY2UgYW5kcm9pZCB7CisKKyNkZWZpbmUgRklMRV9JRF9DT0xVTU4gICAgICAgICAgICAgICAgICAxCisjZGVmaW5lIEZJTEVfUEFUSF9DT0xVTU4gICAgICAgICAgICAgICAgMgorI2RlZmluZSBGSUxFX0ZPUk1BVF9DT0xVTU4gICAgICAgICAgICAgIDMKKyNkZWZpbmUgRklMRV9QQVJFTlRfQ09MVU1OICAgICAgICAgICAgICA0CisjZGVmaW5lIEZJTEVfU1RPUkFHRV9DT0xVTU4gICAgICAgICAgICAgNQorI2RlZmluZSBGSUxFX1NJWkVfQ09MVU1OICAgICAgICAgICAgICAgIDYKKyNkZWZpbmUgRklMRV9NT0RJRklFRF9DT0xVTU4gICAgICAgICAgICA3CisKKyNkZWZpbmUgQVVESU9fSURfQ09MVU1OICAgICAgICAgICAgICAgICAxCisjZGVmaW5lIEFVRElPX1RJVExFX0NPTFVNTiAgICAgICAgICAgICAgMgorI2RlZmluZSBBVURJT19BUlRJU1RfQ09MVU1OICAgICAgICAgICAgIDMKKyNkZWZpbmUgQVVESU9fQUxCVU1fQ09MVU1OICAgICAgICAgICAgICA0CisjZGVmaW5lIEFVRElPX0FMQlVNX0FSVElTVF9DT0xVTU4gICAgICAgNQorI2RlZmluZSBBVURJT19HRU5SRV9DT0xVTU4gICAgICAgICAgICAgIDYKKyNkZWZpbmUgQVVESU9fQ09NUE9TRVJfQ09MVU1OICAgICAgICAgICA3CisjZGVmaW5lIEFVRElPX1RSQUNLX05VTUJFUl9DT0xVTU4gICAgICAgOAorI2RlZmluZSBBVURJT19ZRUFSX0NPTFVNTiAgICAgICAgICAgICAgIDkKKyNkZWZpbmUgQVVESU9fRFVSQVRJT05fQ09MVU1OICAgICAgICAgICAxMAorI2RlZmluZSBBVURJT19VU0VfQ09VTlRfQ09MVU1OICAgICAgICAgIDExCisjZGVmaW5lIEFVRElPX1NBTVBMRV9SQVRFX0NPTFVNTiAgICAgICAgMTIKKyNkZWZpbmUgQVVESU9fTlVNX0NIQU5ORUxTX0NPTFVNTiAgICAgICAxMworI2RlZmluZSBBVURJT19BVURJT19XQVZFX0NPREVDX0NPTFVNTiAgIDE0CisjZGVmaW5lIEFVRElPX0FVRElPX0JJVF9SQVRFX0NPTFVNTiAgICAgMTUKKworI2RlZmluZSBGSUxFX1RBQkxFX0NSRUFURSAgICAiQ1JFQVRFIFRBQkxFIElGIE5PVCBFWElTVFMgZmlsZXMgKCIgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgIl9pZCBJTlRFR0VSIFBSSU1BUlkgS0VZLCIgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICJwYXRoIFRFWFQsIiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAiZm9ybWF0IElOVEVHRVIsIiAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgInBhcmVudCBJTlRFR0VSLCIgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICJzdG9yYWdlIElOVEVHRVIsIiAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAic2l6ZSBJTlRFR0VSLCIgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgImRhdGVfbW9kaWZpZWQgSU5URUdFUiIgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgIik7IgorCisjZGVmaW5lIEFVRElPX1RBQkxFX0NSRUFURSAgICAiQ1JFQVRFIFRBQkxFIElGIE5PVCBFWElTVFMgYXVkaW8gKCIgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgImlkIElOVEVHRVIgUFJJTUFSWSBLRVksIiAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICJ0aXRsZSBURVhULCIgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAiYXJ0aXN0IFRFWFQsIiAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgImFsYnVtIFRFWFQsIiAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICJhbGJ1bV9hcnRpc3QgVEVYVCwiICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAiZ2VucmUgVEVYVCwiICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgImNvbXBvc2VyIFRFWFQsIiAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICJ0cmFja19udW1iZXIgSU5URUdFUiwiICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAieWVhciBJTlRFR0VSLCIgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgImR1cmF0aW9uIElOVEVHRVIsIiAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICJ1c2VfY291bnQgSU5URUdFUiwiICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAic2FtcGxlX3JhdGUgSU5URUdFUiwiICAgICAgICAgICAgICAgICAgXAorICAgICAgIC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swXSk7CisgICAgY29uc3QgUHJvcGVydHlUYWJsZUVudHJ5KiBlbnRyeSA9IGtQcm9wZXJ0eVRhYmxlOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKywgZW50cnkrKykgeworICAgICAgICBpZiAoZW50cnktPnByb3BlcnR5ID09IHByb3BlcnR5KSB7CisgICAgICAgICAgICB0eXBlID0gZW50cnktPnR5cGU7CisgICAgICAgICAgICBjb2x1bW5OYW1lID0gZW50cnktPmNvbHVtbk5hbWU7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gZmFsc2U7Cit9CisKKworCitNdHBEYXRhYmFzZTo6TXRwRGF0YWJhc2UoKQorICAgIDogICBtRmlsZUlkUXVlcnkoTlVMTCksCisgICAgICAgIG1GaWxlUGF0aFF1ZXJ5KE5VTEwpLAorICAgICAgICBtT2JqZWN0SW5mb1F1ZXJ5KE5VTEwpLAorICAgICAgICBtRmlsZUluc2VydGVyKE5VTEwpLAorICAgICAgICBtRmlsZURlbGV0ZXIoTlVMTCksCisgICAgICAgIG1BdWRpb0luc2VydGVyKE5VTEwpLAorICAgICAgICBtQXVkaW9EZWxldGVyKE5VTEwpCit7Cit9CisKK010cERhdGFiYXNlOjp+TXRwRGF0YWJhc2UoKSB7Cit9CisKK2Jvb2wgTXRwRGF0YWJhc2U6Om9wZW4oY29uc3QgY2hhciogcGF0aCwgYm9vbCBjcmVhdGUpIHsKKyAgICBpZiAoIVNxbGl0ZURhdGFiYXNlOjpvcGVuKHBhdGgsIGNyZWF0ZSkpCisgICAgICAgIHJldHVybiBmYWxzZTsKKworICAgIC8vIGNyZWF0ZSB0YWJsZXMgYW5kIGluZGljZXMgaWYgbmVjZXNzYXJ5CisgICAgaWYgKCFleGVjKEZJTEVfVEFCTEVfQ1JFQVRFKSkgeworICAgICAgICBmcHJpbnRmKHN0ZGVyciwgImNvdWxkIG5vdCBjcmVhdGUgZmlsZSB0YWJsZVxuIik7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisgICAgaWYgKCFleGVjKFBBVEhfSU5ERVhfQ1JFQVRFKSkgeworICAgICAgICBmcHJpbnRmKHN0ZGVyciwgImNvdWxkIG5vdCBwYXRoIGluZGV4IG9uIGZpbGUgdGFibGVcbiIpOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorICAgIGlmICghZXhlYyhBVURJT19UQUJMRV9DUkVBVEUpKSB7CisgICAgICAgIGZwcmludGYoc3RkZXJyLCAiY291bGQgbm90IGNyZWF0ZSBmaWxlIHRhYmxlXG4iKTsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIGlmICghbUZpbGVJZFF1ZXJ5KSB7CisgICAgICAgIG1GaWxlSWRRdWVyeSA9IG5ldyBTcWxpdGVTdGF0ZW1lbnQodGhpcyk7CisgICAgICAgIGlmICghbUZpbGVJZFF1ZXJ5LT5wcmVwYXJlKEZJTEVfSURfUVVFUlkpKSB7CisgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgImNvdWxkIG5vdCBjb21waWxlIEZJTEVfSURfUVVFUllcbiIpOworICAgICAgICAgICAgZXhpdCgtMSk7CisgICAgICAgIH0KKyAgICB9CisgICAgaWYgKCFtRmlsZVBhdGhRdWVyeSkgeworICAgICAgICBtRmlsZVBhdGhRdWVyeSA9IG5ldyBTcWxpdGVTdGF0ZW1lbnQodGhpcyk7CisgICAgICAgIGlmICghbUZpbGVQYXRoUXVlcnktPnByZXBhcmUoRklMRV9QQVRIX1FVRVJZKSkgeworICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJjb3VsZCBub3QgY29tcGlsZSBGSUxFX1BBVEhfUVVFUllcbiIpOworICAgICAgICAgICAgZXhpdCgtMSk7CisgICAgICAgIH0KKyAgICB9CisgICAgaWYgKCFtT2JqZWN0SW5mb1F1ZXJ5KSB7CisgICAgICAgIG1PYmplY3RJbmZvUXVlcnkgPSBuZXcgU3FsaXRlU3RhdGVtZW50KHRoaXMpOworICAgICAgICBpZiAoIW1PYmplY3RJbmZvUXVlcnktPnByZXBhcmUoR0VUX09CSkVDVF9JTkZPX1FVRVJZKSkgeworICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJjb3VsZCBub3QgY29tcGlsZSBHRVRfT0JKRUNUX0lORk9fUVVFUllcbiIpOworICAgICAgICAgICAgZXhpdCgtMSk7CisgICAgICAgIH0KKyAgICB9CisgICAgaWYgKCFtRmlsZUluc2VydGVyKSB7CisgICAgICAgIG1GaWxlSW5zZXJ0ZXIgPSBuZXcgU3FsaXRlU3RhdGVtZW50KHRoaXMpOworICAgICAgICBpZiAoIW1GaWxlSW5zZXJ0ZXItPnByZXBhcmUoRklMRV9JTlNFUlQpKSB7CisgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgImNvdWxkIG5vdCBjb21waWxlIEZJTEVfSU5TRVJUXG4iKTsKKyAgICAgICAgICAgIGV4aXQoLTEpOworICAgICAgICB9CisgICAgfQorICAgIGlmICghbUZpbGVEZWxldGVyKSB7CisgICAgICAgIG1GaWxlRGVsZXRlciA9IG5ldyBTcWxpdGVTdGF0ZW1lbnQodGhpcyk7CisgICAgICAgIGlmICghbUZpbGVEZWxldGVyLT5wcmVwYXJlKEZJTEVfREVMRVRFKSkgeworICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJjb3VsZCBub3QgY29tcGlsZSBGSUxFX0RFTEVURVxuIik7CisgICAgICAgICAgICBleGl0KC0xKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBpZiAoIW1BdWRpb0luc2VydGVyKSB7CisgICAgICAgIG1BdWRpb0luc2VydGVyID0gbmV3IFNxbGl0ZVN0YXRlbWVudCh0aGlzKTsKKyAgICAgICAgaWYgKCFtQXVkaW9JbnNlcnRlci0+cHJlcGFyZShBVURJT19JTlNFUlQpKSB7CisgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgImNvdWxkIG5vdCBjb21waWxlIEFVRElPX0lOU0VSVFxuIik7CisgICAgICAgICAgICBleGl0KC0xKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBpZiAoIW1BdWRpb0RlbGV0ZXIpIHsKKyAgICAgICAgbUF1ZGlvRGVsZXRlciA9IG5ldyBTcWxpdGVTdGF0ZW1lbnQodGhpcyk7CisgICAgICAgIGlmICghbUF1ZGlvRGVsZXRlci0+cHJlcGFyZShBVURJT19ERUxFVEUpKSB7CisgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgImNvdWxkIG5vdCBjb21waWxlIEFVRElPX0RFTEVURVxuIik7CisgICAgICAgICAgICBleGl0KC0xKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiB0cnVlOworfQorCit1aW50MzJfdCBNdHBEYXRhYmFzZTo6Z2V0VGFibGVGb3JGaWxlKE10cE9iamVjdEZvcm1hdCBmb3JtYXQpIHsKKyAgICBzd2l0Y2ggKGZvcm1hdCkgeworICAgICAgICBjYXNlIE1UUF9GT1JNQVRfQUlGRjoKKyAgICAgICAgY2FzZSBNVFBfRk9STUFUX1dBVjoKKyAgICAgICAgY2FzZSBNVFBfRk9STUFUX01QMzoKKyAgICAgICAgY2FzZSBNVFBfRk9STUFUX0ZMQUM6CisgICAgICAgIGNhc2UgTVRQX0ZPUk1BVF9VTkRFRklORURfQVVESU86CisgICAgICAgIGNhc2UgTVRQX0ZPUk1BVF9XTUE6CisgICAgICAgIGNhc2UgTVRQX0ZPUk1BVF9PR0c6CisgICAgICAgIGNhc2UgTVRQX0ZPUk1BVF9BQUM6CisgICAgICAgIGNhc2UgTVRQX0ZPUk1BVF9BVURJQkxFOgorICAgICAgICAgICAgcmV0dXJuIGtPYmplY3RIYW5kbGVUYWJsZUF1ZGlvOworICAgICAgICBjYXNlIE1UUF9GT1JNQVRfQVZJOgorICAgICAgICBjYXNlIE1UUF9GT1JNQVRfTVBFRzoKKyAgICAgICAgY2FzZSBNVFBfRk9STUFUX0FTRjoKKyAgICAgICAgY2F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QVlMSVNUOgorICAgICAgICBjYXNlIE1UUF9GT1JNQVRfQUJTVFJBQ1RfQVZfUExBWUxJU1Q6CisgICAgICAgIGNhc2UgTVRQX0ZPUk1BVF9BQlNUUkFDVF9WSURFT19QTEFZTElTVDoKKyAgICAgICAgY2FzZSBNVFBfRk9STUFUX1dQTF9QTEFZTElTVDoKKyAgICAgICAgY2FzZSBNVFBfRk9STUFUX00zVV9QTEFZTElTVDoKKyAgICAgICAgY2FzZSBNVFBfRk9STUFUX01QTF9QTEFZTElTVDoKKyAgICAgICAgY2FzZSBNVFBfRk9STUFUX0FTWF9QTEFZTElTVDoKKyAgICAgICAgY2FzZSBNVFBfRk9STUFUX1BMU19QTEFZTElTVDoKKyAgICAgICAgICAgIHJldHVybiBrT2JqZWN0SGFuZGxlVGFibGVQbGF5bGlzdDsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIHJldHVybiBrT2JqZWN0SGFuZGxlVGFibGVGaWxlOworICAgIH0KK30KKworTXRwT2JqZWN0SGFuZGxlIE10cERhdGFiYXNlOjpnZXRPYmplY3RIYW5kbGUoY29uc3QgY2hhciogcGF0aCkgeworICAgIG1GaWxlSWRRdWVyeS0+cmVzZXQoKTsKKyAgICBtRmlsZUlkUXVlcnktPmJpbmQoMSwgcGF0aCk7CisgICAgaWYgKG1GaWxlSWRRdWVyeS0+c3RlcCgpKSB7CisgICAgICAgIGludCByb3cgPSBtRmlsZUlkUXVlcnktPmdldENvbHVtbkludCgwKTsKKyAgICAgICAgaWYgKHJvdyA+IDApIHsKKyAgICAgICAgICAgIE10cE9iamVjdEZvcm1hdCBmb3JtYXQgPSBtRmlsZUlkUXVlcnktPmdldENvbHVtbkludCgxKTsKKyAgICAgICAgICAgIHJvdyB8PSBnZXRUYWJsZUZvckZpbGUoZm9ybWF0KTsKKyAgICAgICAgICAgIHJldHVybiByb3c7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gMDsKK30KKworTXRwT2JqZWN0SGFuZGxlIE10cERhdGFiYXNlOjphZGRGaWxlKGNvbnN0IGNoYXIqIHBhdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RGb3JtYXQgZm9ybWF0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0SGFuZGxlIHBhcmVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cFN0b3JhZ2VJRCBzdG9yYWdlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDY0X3Qgc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVfdCBtb2RpZmllZCkgeworICAgIG1GaWxlSW5zZXJ0ZXItPmJpbmQoRklMRV9QQVRIX0NPTFVNTiwgcGF0aCk7CisgICAgbUZpbGVJbnNlcnRlci0+YmluZChGSUxFX0ZPUk1BVF9DT0xVTU4sIGZvcm1hdCk7CisgICAgbUZpbGVJbnNlcnRlci0+YmluZChGSUxFX1BBUkVOVF9DT0xVTU4sIHBhcmVudCk7CisgICAgbUZpbGVJbnNlcnRlci0+YmluZChGSUxFX1NUT1JBR0VfQ09MVU1OLCBzdG9yYWdlKTsKKyAgICBtRmlsZUluc2VydGVyLT5iaW5kKEZJTEVfU0laRV9DT0xVTU4sIHNpemUpOworICAgIG1GaWxlSW5zZXJ0ZXItPmJpbmQoRklMRV9NT0RJRklFRF9DT0xVTU4sIG1vZGlmaWVkKTsKKyAgICBtRmlsZUluc2VydGVyLT5zdGVwKCk7CisgICAgbUZpbGVJbnNlcnRlci0+cmVzZXQoKTsKKyAgICBpbnQgcmVzdWx0ID0gbGFzdEluc2VydGVkUm93KCk7CisgICAgcmV0dXJuIChyZXN1bHQgPD0gMCA/IGtJbnZhbGlkT2JqZWN0SGFuZGxlIDogcmVzdWx0KTsKK30KKworTXRwT2JqZWN0SGFuZGxlIE10cERhdGFiYXNlOjphZGRBdWRpb0ZpbGUoTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSkgeworICAgIG1BdWRpb0luc2VydGVyLT5iaW5kKEFVRElPX0lEX0NPTFVNTiwgaGFuZGxlKTsKKyAgICBtQXVkaW9JbnNlcnRlci0+c3RlcCgpOworICAgIG1BdWRpb0luc2VydGVyLT5yZXNldCgpOworICAgIGludCByZXN1bHQgPSBsYXN0SW5zZXJ0ZWRSb3coKTsKKyAgICBoYW5kbGUgfD0ga09iamVjdEhhbmRsZVRhYmxlQXVkaW87CisgICAgcmV0dXJuIChyZXN1bHQgPiAwID8gaGFuZGxlIDoga0ludmFsaWRPYmplY3RIYW5kbGUpOworfQorCitNdHBPYmplY3RIYW5kbGUgTXRwRGF0YWJhc2U6OmFkZEF1ZGlvRmlsZShNdHBPYmplY3RIYW5kbGUgaGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciogdGl0bGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyKiBhcnRpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyKiBhbGJ1bSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIqIGFsYnVtQXJ0aXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciogZ2VucmUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyKiBjb21wb3NlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIqIG1pbWVUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHRyYWNrLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHllYXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZHVyYXRpb24pIHsK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hhbmRsZTsKKyAgICByZXN1bHQgfD0ga09iamVjdEhhbmRsZVRhYmxlQXVkaW87CisgICAgcmV0dXJuIHJlc3VsdDsKK30KKworTXRwT2JqZWN0SGFuZGxlTGlzdCogTXRwRGF0YWJhc2U6OmdldE9iamVjdExpc3QoTXRwU3RvcmFnZUlEIHN0b3JhZ2VJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdEZvcm1hdCBmb3JtYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RIYW5kbGUgcGFyZW50KSB7CisgICAgYm9vbCAgICAgICAgICAgICAgICB3aGVyZVN0b3JhZ2UgPSAoc3RvcmFnZUlEICE9IDB4RkZGRkZGRkYpOworICAgIGJvb2wgICAgICAgICAgICAgICAgd2hlcmVGb3JtYXQgPSAoZm9ybWF0ICE9IDApOworICAgIGJvb2wgICAgICAgICAgICAgICAgd2hlcmVQYXJlbnQgPSAocGFyZW50ICE9IDApOworICAgIGNoYXIgICAgICAgICAgICAgICAgaW50QnVmZmVyWzIwXTsKKworICAgIE10cFN0cmluZyAgcXVlcnkoIlNFTEVDVCBfaWQsZm9ybWF0IEZST00gZmlsZXMiKTsKKyAgICBpZiAod2hlcmVTdG9yYWdlIHx8IHdoZXJlRm9ybWF0IHx8IHdoZXJlUGFyZW50KQorICAgICAgICBxdWVyeSArPSAiIFdIRVJFIjsKKyAgICBpZiAod2hlcmVTdG9yYWdlKSB7CisgICAgICAgIHNucHJpbnRmKGludEJ1ZmZlciwgc2l6ZW9mKGludEJ1ZmZlciksICIlZCIsIHN0b3JhZ2VJRCk7CisgICAgICAgIHF1ZXJ5ICs9ICIgc3RvcmFnZSA9ICI7CisgICAgICAgIHF1ZXJ5ICs9IGludEJ1ZmZlcjsKKyAgICB9CisgICAgaWYgKHdoZXJlRm9ybWF0KSB7CisgICAgICAgIHNucHJpbnRmKGludEJ1ZmZlciwgc2l6ZW9mKGludEJ1ZmZlciksICIlZCIsIGZvcm1hdCk7CisgICAgICAgIGlmICh3aGVyZVN0b3JhZ2UpCisgICAgICAgICAgICBxdWVyeSArPSAiIEFORCI7CisgICAgICAgIHF1ZXJ5ICs9ICIgZm9ybWF0ID0gIjsKKyAgICAgICAgcXVlcnkgKz0gaW50QnVmZmVyOworICAgIH0KKyAgICBpZiAod2hlcmVQYXJlbnQpIHsKKyAgICAgICAgaWYgKHBhcmVudCAhPSBNVFBfUEFSRU5UX1JPT1QpCisgICAgICAgICAgICBwYXJlbnQgJj0ga09iamVjdEhhbmRsZUluZGV4TWFzazsKKyAgICAgICAgc25wcmludGYoaW50QnVmZmVyLCBzaXplb2YoaW50QnVmZmVyKSwgIiVkIiwgcGFyZW50KTsKKyAgICAgICAgaWYgKHdoZXJlU3RvcmFnZSB8fCB3aGVyZUZvcm1hdCkKKyAgICAgICAgICAgIHF1ZXJ5ICs9ICIgQU5EIjsKKyAgICAgICAgcXVlcnkgKz0gIiBwYXJlbnQgPSAiOworICAgICAgICBxdWVyeSArPSBpbnRCdWZmZXI7CisgICAgfQorICAgIHF1ZXJ5ICs9ICI7IjsKKworICAgIFNxbGl0ZVN0YXRlbWVudCBzdG10KHRoaXMpOworICAgIHByaW50ZigiJXNcbiIsIChjb25zdCBjaGFyICopcXVlcnkpOworICAgIHN0bXQucHJlcGFyZShxdWVyeSk7CisKKyAgICBNdHBPYmplY3RIYW5kbGVMaXN0KiBsaXN0ID0gbmV3IE10cE9iamVjdEhhbmRsZUxpc3QoKTsKKyAgICB3aGlsZSAoIXN0bXQuaXNEb25lKCkpIHsKKyAgICAgICAgaWYgKHN0bXQuc3RlcCgpKSB7CisgICAgICAgICAgICBpbnQgaW5kZXggPSBzdG10LmdldENvbHVtbkludCgwKTsKKyAgICAgICAgICAgIHByaW50Zigic3RtdC5nZXRDb2x1bW5JbnQgcmV0dXJuZWQgJWRcbiIsIGluZGV4KTsKKyAgICAgICAgICAgIGlmIChpbmRleCA+IDApIHsKKyAgICAgICAgICAgICAgICBNdHBPYmplY3RGb3JtYXQgZm9ybWF0ID0gc3RtdC5nZXRDb2x1bW5JbnQoMSk7CisgICAgICAgICAgICAgICAgaW5kZXggfD0gZ2V0VGFibGVGb3JGaWxlKGZvcm1hdCk7CisgICAgICAgICAgICAgICAgbGlzdC0+cHVzaChpbmRleCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgcHJpbnRmKCJsaXN0IHNpemU6ICVkXG4iLCBsaXN0LT5zaXplKCkpOworICAgIHJldHVybiBsaXN0OworfQorCisKK010cFJlc3BvbnNlQ29kZSBNdHBEYXRhYmFzZTo6Z2V0T2JqZWN0UHJvcGVydHkoTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdFByb3BlcnR5IHByb3BlcnR5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwRGF0YVBhY2tldCYgcGFja2V0KSB7CisgICAgaW50ICAgICAgICAgdHlwZTsKKyAgICBjb25zdCBjaGFyKiBjb2x1bW5OYW1lOworICAgIGNoYXIgICAgICAgIGludEJ1ZmZlclsyMF07CisKKyAgICBpZiAoaGFuZGxlICE9IE1UUF9QQVJFTlRfUk9PVCkKKyAgICAgICAgaGFuZGxlICY9IGtPYmplY3RIYW5kbGVJbmRleE1hc2s7CisKKyAgICBpZiAoIWdldFByb3BlcnR5SW5mbyhwcm9wZXJ0eSwgdHlwZSwgY29sdW1uTmFtZSkpCisgICAgICAgIHJldHVybiBNVFBfUkVTUE9OU0VfSU5WQUxJRF9PQkpFQ1RfUFJPUF9DT0RFOworICAgIHNucHJpbnRmKGludEJ1ZmZlciwgc2l6ZW9mKGludEJ1ZmZlciksICIlZCIsIGhhbmRsZSk7CisKKyAgICBNdHBTdHJpbmcgIHF1ZXJ5KCJTRUxFQ1QgIik7CisgICAgcXVlcnkgKz0gY29sdW1uTmFtZTsKKyAgICBxdWVyeSArPSAiIEZST00gZmlsZXMgV0hFUkUgX2lkID0gIjsKKyAgICBxdWVyeSArPSBpbnRCdWZmZXI7CisgICAgcXVlcnkgKz0gIjsiOworCisgICAgU3FsaXRlU3RhdGVtZW50IHN0bXQodGhpcyk7CisgICAgcHJpbnRmKCIlc1xuIiwgKGNvbnN0IGNoYXIgKilxdWVyeSk7CisgICAgc3RtdC5wcmVwYXJlKHF1ZXJ5KTsKKworICAgIGlmICghc3RtdC5zdGVwKCkpCisgICAgICAgIHJldHVybiBNVFBfUkVTUE9OU0VfSU5WQUxJRF9PQkpFQ1RfSEFORExFOworCisgICAgc3dpdGNoICh0eXBlKSB7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UODoKKyAgICAgICAgICAgIHBhY2tldC5wdXRJbnQ4KHN0bXQuZ2V0Q29sdW1uSW50KDApKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQ4OgorICAgICAgICAgICAgcGFja2V0LnB1dFVJbnQ4KHN0bXQuZ2V0Q29sdW1uSW50KDApKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX0lOVDE2OgorICAgICAgICAgICAgcGFja2V0LnB1dEludDE2KHN0bXQuZ2V0Q29sdW1uSW50KDApKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQxNjoKKyAgICAgICAgICAgIHBhY2tldC5wdXRVSW50MTYoc3RtdC5nZXRDb2x1bW5JbnQoMCkpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UMzI6CisgICAgICAgICAgICBwYWNrZXQucHV0SW50MzIoc3RtdC5nZXRDb2x1bW5JbnQoMCkpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDMyOgorICAgICAgICAgICAgcGFja2V0LnB1dFVJbnQzMihzdG10LmdldENvbHVtbkludCgwKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQ2NDoKKyAgICAgICAgICAgIHBhY2tldC5wdXRJbnQ2NChzdG10LmdldENvbHVtbkludDY0KDApKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQ2NDoKKyAgICAgICAgICAgIHBhY2tldC5wdXRVSW50NjQoc3RtdC5nZXRDb2x1bW5JbnQ2NCgwKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9TVFI6CisgICAgICAgICAgICBwYWNrZXQucHV0U3RyaW5nKHN0bXQuZ2V0Q29sdW1uU3RyaW5nKDApKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJ1bnN1cHBvcnRlZCBvYmplY3QgdHlwZVxuIik7CisgICAgICAgICAgICByZXR1cm4gTVRQX1JFU1BPTlNFX0lOVkFMSURfT0JKRUNUX0hBTkRMRTsKKyAgICB9CisgICAgcmV0dXJuIE1UUF9SRVNQT05TRV9PSzsKK30KKworTXRwUmVzcG9uc2VDb2RlIE10cERhdGFiYXNlOjpnZXRPYmplY3RJbmZvKE10cE9iamVjdEhhbmRsZSBoYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwRGF0YVBhY2tldCYgcGFja2V0KSB7CisgICAgY2hhciAgICBkYXRlWzIwXTsKKworICAgIGlmIChoYW5kbGUgIT0gTVRQX1BBUkVOVF9ST09UKQorICAgICAgICBoYW5kbGUgJj0ga09iamVjdEhhbmRsZUluZGV4TWFzazsKKworICAgIG1PYmplY3RJbmZvUXVlcnktPnJlc2V0KCk7CisgICAgbU9iamVjdEluZm9RdWVyeS0+YmluZCgxLCBoYW5kbGUpOworICAgIGlmICghbU9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N0bXQyLnByZXBhcmUoIlNFTEVDVCBfaWQsZm9ybWF0IEZST00gZmlsZXM7Iik7CisKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CisgICAgICAgICAgICBpZiAoIXN0bXQyLnN0ZXAoKSkgeworICAgICAgICAgICAgICAgIHByaW50ZigiZ2V0RmlsZUxpc3QgZW5kZWQgZWFybHlcbiIpOworICAgICAgICAgICAgICAgIGNvdW50ID0gaTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIE10cE9iamVjdEhhbmRsZSBoYW5kbGUgPSBzdG10Mi5nZXRDb2x1bW5JbnQoMCk7CisgICAgICAgICAgICBNdHBPYmplY3RGb3JtYXQgZm9ybWF0ID0gc3RtdDIuZ2V0Q29sdW1uSW50KDEpOworICAgICAgICAgICAgaGFuZGxlIHw9IGdldFRhYmxlRm9yRmlsZShmb3JtYXQpOworICAgICAgICAgICAgcmVzdWx0W2ldID0gaGFuZGxlOworICAgICAgICB9CisgICAgfQorICAgIG91dENvdW50ID0gY291bnQ7CisgICAgcmV0dXJuIHJlc3VsdDsKK30KKworLyoKKyAgICBmb3IgZ2V0T2JqZWN0UHJvcERlc2MKKworICAgIHBhY2tldC5wdXRVSW50MTYocHJvcGVydHkpOworICAgIHBhY2tldC5wdXRVSW50MTYoZGF0YVR5cGUpOworICAgIHBhY2tldC5wdXRVSW50OChnZXRTZXQpOworICAgIC8vIGRlZmF1bHQgdmFsdWUgRFRTCisgICAgcGFja2V0LnB1dFVJbnQzMihncm91cENvZGUpOworICAgIHBhY2tldC5wdXRVSW50OChmb3JtRmxhZyk7CisgICAgLy8gZm9ybSwgdmFyaWFibGUKKyovCisKK30gIC8vIG5hbWVzcGFjZSBhbmRyb2lkCmRpZmYgLS1naXQgYS9tZWRpYS9tdHAvTXRwRGF0YWJhc2UuaCBiL21lZGlhL210cC9NdHBEYXRhYmFzZS5oCm5ldyBmaWxlIG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2luY2x1ZGUgIlNxbGl0ZURhdGFiYXNlLmgiCisKK25hbWVzcGFjZSBhbmRyb2lkIHsKKworY2xhc3MgTXRwRGF0YVBhY2tldDsKK2NsYXNzIFNxbGl0ZVN0YXRlbWVudDsKKworY2xhc3MgTXRwRGF0YWJhc2UgOiBwdWJsaWMgU3FsaXRlRGF0YWJhc2UgeworcHJpdmF0ZToKKyAgICBTcWxpdGVTdGF0ZW1lbnQqICAgICAgICBtRmlsZUlkUXVlcnk7CisgICAgU3FsaXRlU3RhdGVtZW50KiAgICAgICAgbUZpbGVQYXRoUXVlcnk7CisgICAgU3FsaXRlU3RhdGVtZW50KiAgICAgICAgbU9iamVjdEluZm9RdWVyeTsKKyAgICBTcWxpdGVTdGF0ZW1lbnQqICAgICAgICBtRmlsZUluc2VydGVyOworICAgIFNxbGl0ZVN0YXRlbWVudCogICAgICAgIG1GaWxlRGVsZXRlcjsKKyAgICBTcWxpdGVTdGF0ZW1lbnQqICAgICAgICBtQXVkaW9JbnNlcnRlcjsKKyAgICBTcWxpdGVTdGF0ZW1lbnQqICAgICAgICBtQXVkaW9EZWxldGVyOworCitwdWJsaWM6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwRGF0YWJhc2UoKTsKKyAgICB2aXJ0dWFsICAgICAgICAgICAgICAgICB+TXRwRGF0YWJhc2UoKTsKKworICAgIHN0YXRpYyB1aW50MzJfdCAgICAgICAgIGdldFRhYmxlRm9yRmlsZShNdHBPYmplY3RGb3JtYXQgZm9ybWF0KTsKKworICAgIGJvb2wgICAgICAgICAgICAgICAgICAgIG9wZW4oY29uc3QgY2hhciogcGF0aCwgYm9vbCBjcmVhdGUpOworICAgIE10cE9iamVjdEhhbmRsZSAgICAgICAgIGdldE9iamVjdEhhbmRsZShjb25zdCBjaGFyKiBwYXRoKTsKKyAgICBNdHBPYmplY3RIYW5kbGUgICAgICAgICBhZGRGaWxlKGNvbnN0IGNoYXIqIHBhdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RGb3JtYXQgZm9ybWF0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0SGFuZGxlIHBhcmVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cFN0b3JhZ2VJRCBzdG9yYWdlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDY0X3Qgc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVfdCBtb2RpZmllZCk7CisKKyAgICBNdHBPYmplY3RIYW5kbGUgICAgICAgICBhZGRBdWRpb0ZpbGUoTXRwT2JqZWN0SGFuZGxlIGlkKTsKKworICAgIE10cE9iamVjdEhhbmRsZSAgICAgICAgIGFkZEF1ZGlvRmlsZShNdHBPYmplY3RIYW5kbGUgaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyKiB0aXRsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIqIGFydGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIqIGFsYnVtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciogYWxidW1BcnRpc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyKiBnZW5yZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIqIGNvbXBvc2VyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciogbWltZVR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdHJhY2ssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeWVhciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBkdXJhdGlvbik7CisKKyAgICBNdHBPYmplY3RIYW5kbGVMaXN0KiAgICBnZXRPYmplY3RMaXN0KE10cFN0b3JhZ2VJRCBzdG9yYWdlSUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RGb3JtYXQgZm9ybWF0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0SGFuZGxlIHBhcmVudCk7CisKKyAgICBNdHBSZXNwb25zZUNvZGUgICAgICAgICBnZXRPYmplY3RQcm9wZXJ0eShNdHBPYmplY3RIYW5kbGUgaGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0UHJvcGVydHkgcHJvcGVydHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBEYXRhUGFja2V0JiBwYWNrZXQpOworCisgICAgTXRwUmVzcG9uc2VDb2RlICAgICAgICAgZ2V0T2JqZWN0SW5mbyhNdHBPYmplY3RIYW5kbGUgaGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwRGF0YVBhY2tldCYgcGFja2V0KTsKKworICAgIGJvb2wgICAgICAgICAgICAgICAgICAgIGdldE9iamVjdEZpbGVQYXRoKE10cE9iamVjdEhhbmRsZSBoYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBTdHJpbmcmIGZpbGVQYXRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50NjRfdCYgZmlsZUxlbmd0aCk7CisgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgZGVsZXRlRmlsZShNdHBPYmplY3RIYW5kbGUgaGFuZGxlKTsKKworICAgIC8vIGhlbHBlciBmb3IgbWVkaWEgc2Nhbm5lcgorICAgIE10cE9iamVjdEhhbmRsZSogICAgICAgIGdldEZpbGVMaXN0KGludCYgb3V0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RlIDx1c2Job3N0L3VzYmhvc3QuaD4KKworI2luY2x1ZGUgIk10cERldmljZS5oIgorI2luY2x1ZGUgIk10cERlYnVnLmgiCisjaW5jbHVkZSAiTXRwRGV2aWNlSW5mby5oIgorI2luY2x1ZGUgIk10cE9iamVjdEluZm8uaCIKKyNpbmNsdWRlICJNdHBQcm9wZXJ0eS5oIgorI2luY2x1ZGUgIk10cFN0b3JhZ2VJbmZvLmgiCisjaW5jbHVkZSAiTXRwU3RyaW5nQnVmZmVyLmgiCisKK25hbWVzcGFjZSBhbmRyb2lkIHsKKworTXRwRGV2aWNlOjpNdHBEZXZpY2Uoc3RydWN0IHVzYl9kZXZpY2UqIGRldmljZSwgaW50IGludGVyZmFjZSwKKyAgICAgICAgICAgIHN0cnVjdCB1c2JfZW5kcG9pbnQgKmVwX2luLCBzdHJ1Y3QgdXNiX2VuZHBvaW50ICplcF9vdXQsCisgICAgICAgICAgICBzdHJ1Y3QgdXNiX2VuZHBvaW50ICplcF9pbnRyKQorICAgIDogICBtRGV2aWNlKGRldmljZSksCisgICAgICAgIG1JbnRlcmZhY2UoaW50ZXJmYWNlKSwKKyAgICAgICAgbUVuZHBvaW50SW4oZXBfaW4pLAorICAgICAgICBtRW5kcG9pbnRPdXQoZXBfb3V0KSwKKyAgICAgICAgbUVuZHBvaW50SW50cihlcF9pbnRyKSwKKyAgICAgICAgbURldmljZUluZm8oTlVMTCksCisgICAgICAgIG1JRCh1c2JfZGV2aWNlX2dldF91bmlxdWVfaWQoZGV2aWNlKSksCisgICAgICAgIG1TZXNzaW9uSUQoMCksCisgICAgICAgIG1UcmFuc2FjdGlvbklEKDApCit7Cit9CisKK010cERldmljZTo6fk10cERldmljZSgpIHsKKyAgICBjbG9zZSgpOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbURldmljZVByb3BlcnRpZXMuc2l6ZSgpOyBpKyspCisgICAgICAgIGRlbGV0ZSBtRGV2aWNlUHJvcGVydGllc1tpXTsKK30KKwordm9pZCBNdHBEZXZpY2U6OmluaXRpYWxpemUoKSB7CisgICAgb3BlblNlc3Npb24oKTsKKyAgICBtRGV2aWNlSW5mbyA9IGdldERldmljZUluZm8oKTsKKyAgICBpZiAobURldmljZUluZm8pIHsKKyAgICAgICAgbURldmljZUluZm8tPnByaW50KCk7CisKKyAgICAgICAgaWYgKG1EZXZpY2VJbmZvLT5tRGV2aWNlUHJvcGVydGllcykgeworICAgICAgICAgICAgaW50IGNvdW50ID0gbURldmljZUluZm8tPm1EZXZpY2VQcm9wZXJ0aWVzLT5zaXplKCk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgICAgICAgICBNdHBEZXZpY2VQcm9wZXJ0eSBwcm9wQ29kZSA9ICgqbURldmljZUluZm8tPm1EZXZpY2VQcm9wZXJ0aWVzKVtpXTsKKyAgICAgICAgICAgICAgICBNdHBQcm9wZXJ0eSogcHJvcGVydHkgPSBnZXREZXZpY2VQcm9wRGVzYyhwcm9wQ29kZSk7CisgICAgICAgICAgICAgICAgaWYgKHByb3BlcnR5KSB7CisgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5LT5wcmludCgpOworICAgICAgICAgICAgICAgICAgICBtRGV2aWNlUHJvcGVydGllcy5wdXNoKHByb3BlcnR5KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cit9CisKK3ZvaWQgTXRwRGV2aWNlOjpjbG9zZSgpIHsKKyAgICBpZiAobURldmljZSkgeworICAgICAgICB1c2JfZGV2aWNlX3JlbGVhc2VfaW50ZXJmYWNlKG1EZXZpY2UsIG1JbnRlcmZhY2UpOworICAgICAgICB1c2JfZGV2aWNlX2Nsb3NlKG1EZXZpY2UpOworICAgICAgICBtRGV2aWNlID0gTlVMTDsKKyAgICB9Cit9CisKK2NvbnN0IGNoYXIqIE10cERldmljZTo6Z2V0RGV2aWNlTmFtZSgpIHsKKyAgICBpZiAobURldmljZSk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OVUxMOworICAgIGlmICghcmVhZERhdGEoKSkKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgTXRwUmVzcG9uc2VDb2RlIHJldCA9IHJlYWRSZXNwb25zZSgpOworICAgIGlmIChyZXQgPT0gTVRQX1JFU1BPTlNFX09LKSB7CisgICAgICAgIE10cERldmljZUluZm8qIGluZm8gPSBuZXcgTXRwRGV2aWNlSW5mbzsKKyAgICAgICAgaW5mby0+cmVhZChtRGF0YSk7CisgICAgICAgIHJldHVybiBpbmZvOworICAgIH0KKyAgICByZXR1cm4gTlVMTDsKK30KKworTXRwU3RvcmFnZUlETGlzdCogTXRwRGV2aWNlOjpnZXRTdG9yYWdlSURzKCkgeworICAgIG1SZXF1ZXN0LnJlc2V0KCk7CisgICAgaWYgKCFzZW5kUmVxdWVzdChNVFBfT1BFUkFUSU9OX0dFVF9TVE9SQUdFX0lEUykpCisgICAgICAgIHJldHVybiBOVUxMOworICAgIGlmICghcmVhZERhdGEoKSkKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgTXRwUmVzcG9uc2VDb2RlIHJldCA9IHJlYWRSZXNwb25zZSgpOworICAgIGlmIChyZXQgPT0gTVRQX1JFU1BPTlNFX09LKSB7CisgICAgICAgIHJldHVybiBtRGF0YS5nZXRBVUludDMyKCk7CisgICAgfQorICAgIHJldHVybiBOVUxMOworfQorCitNdHBTdG9yYWdlSW5mbyogTXRwRGV2aWNlOjpnZXRTdG9yYWdlSW5mbyhNdHBTdG9yYWdlSUQgc3RvcmFnZUlEKSB7CisgICAgbVJlcXVlc3QucmVzZXQoKTsKKyAgICBtUmVxdWVzdC5zZXRQYXJhbWV0ZXIoMSwgc3RvcmFnZUlEKTsKKyAgICBpZiAoIXNlbmRSZXF1ZXN0KE1UUF9PUEVSQVRJT05fR0VUX1NUT1JBR0VfSU5GTykpCisgICAgICAgIHJldHVybiBOVUxMOworICAgIGlmICghcmVhZERhdGEoKSkKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICA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dHBEZXZpY2U6OmRlbGV0ZU9iamVjdChNdHBPYmplY3RIYW5kbGUgaGFuZGxlKSB7CisgICAgbVJlcXVlc3QucmVzZXQoKTsKKyAgICBtUmVxdWVzdC5zZXRQYXJhbWV0ZXIoMSwgaGFuZGxlKTsKKyAgICBpZiAoc2VuZFJlcXVlc3QoTVRQX09QRVJBVElPTl9ERUxFVEVfT0JKRUNUKSkgeworICAgICAgICBNdHBSZXNwb25zZUNvZGUgcmV0ID0gcmVhZFJlc3BvbnNlKCk7CisgICAgICAgIGlmIChyZXQgPT0gTVRQX1JFU1BPTlNFX09LKQorICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorICAgIHJldHVybiBmYWxzZTsKK30KKworTXRwT2JqZWN0SGFuZGxlIE10cERldmljZTo6Z2V0UGFyZW50KE10cE9iamVjdEhhbmRsZSBoYW5kbGUpIHsKKyAgICBNdHBPYmplY3RJbmZvKiBpbmZvID0gZ2V0T2JqZWN0SW5mbyhoYW5kbGUpOworICAgIGlmIChpbmZvKQorICAgICAgICByZXR1cm4gaW5mby0+bVBhcmVudDsKKyAgICBlbHNlCisgICAgICAgIHJldHVybiAtMTsKK30KKworTXRwT2JqZWN0SGFuZGxlIE10cERldmljZTo6Z2V0U3RvcmFnZUlEKE10cE9iamVjdEhhbmRsZSBoYW5kbGUpIHsKKyAgICBNdHBPYmplY3RJbmZvKiBpbmZvID0gZ2V0T2JqZWN0SW5mbyhoYW5kbGUpOworICAgIGlmIChpbmZvKQorICAgICAgICByZXR1cm4gaW5mby0+bVN0b3JhZ2VJRDsKKyAgICBlbHNlCisgICAgICAgIHJldHVybiAtMTsKK30KKworTXRwUHJvcGVydHkqIE10cERldmljZTo6Z2V0RGV2aWNlUHJvcERlc2MoTXRwRGV2aWNlUHJvcGVydHkgY29kZSkgeworICAgIG1SZXF1ZXN0LnJlc2V0KCk7CisgICAgbVJlcXVlc3Quc2V0UGFyYW1ldGVyKDEsIGNvZGUpOworICAgIGlmICghc2VuZFJlcXVlc3QoTVRQX09QRVJBVElPTl9HRVRfREVWSUNFX1BST1BfREVTQykpCisgICAgICAgIHJldHVybiBOVUxMOworICAgIGlmICghcmVhZERhdGEoKSkKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgTXRwUmVzcG9uc2VDb2RlIHJldCA9IHJlYWRSZXNwb25zZSgpOworICAgIGlmIChyZXQgPT0gTVRQX1JFU1BPTlNFX09LKSB7CisgICAgICAgIE10cFByb3BlcnR5KiBwcm9wZXJ0eSA9IG5ldyBNdHBQcm9wZXJ0eTsKKyAgICAgICAgcHJvcGVydHktPnJlYWQobURhdGEpOworICAgICAgICByZXR1cm4gcHJvcGVydHk7CisgICAgfQorICAgIHJldHVybiBOVUxMOworfQorCisKK2Jvb2wgTXRwRGV2aWNlOjpzZW5kUmVxdWVzdChNdHBPcGVyYXRpb25Db2RlIG9wZXJhdGlvbikgeworICAgIExPR0QoInNlbmRSZXF1ZXN0OiAlc1xuIiwgTXRwRGVidWc6OmdldE9wZXJhdGlvbkNvZGVOYW1lKG9wZXJhdGlvbikpOworICAgIG1SZXF1ZXN0LnNldE9wZXJhdGlvbkNvZGUob3BlcmF0aW9uKTsKKyAgICBpZiAobVRyYW5zYWN0aW9uSUQgPiAwKQorICAgICAgICBtUmVxdWVzdC5zZXRUcmFuc2FjdGlvbklEKG1UcmFuc2FjdGlvbklEKyspOworICAgIGludCByZXQgPSBtUmVxdWVzdC53cml0ZShtRW5kcG9pbnRPdXQpOworICAgIG1SZXF1ZXN0LmR1bXAoKTsKKyAgICByZXR1cm4gKHJldCA+IDApOworfQorCitib29sIE10cERldmljZTo6c2VuZERhdGEoTXRwT3BlcmF0aW9uQ29kZSBvcGVyYXRpb24pIHsKKyAgICBMT0dEKCJzZW5kRGF0YVxuIik7CisgICAgbURhdGEuc2V0T3BlcmF0aW9uQ29kZShtUmVxdWVzdC5nZXRPcGVyYXRpb25Db2RlKCkpOworICAgIG1EYXRhLnNldFRyYW5zYWN0aW9uSUQobVJlcXVlc3QuZ2V0VHJhbnNhY3Rpb25JRCgpKTsKKyAgICBpbnQgcmV0ID0gbURhdGEud3JpdGUobUVuZHBvaW50T3V0KTsKKyAgICBtRGF0YS5kdW1wKCk7CisgICAgcmV0dXJuIChyZXQgPiAwKTsKK30KKworYm9vbCBNdHBEZXZpY2U6OnJlYWREYXRhKCkgeworICAgIG1EYXRhLnJlc2V0KCk7CisgICAgaW50IHJldCA9IG1EYXRhLnJlYWQobUVuZHBvaW50SW4pOworICAgIExPR0QoInJlYWREYXRhIHJldHVybmVkICVkXG4iLCByZXQpOworICAgIGlmIChyZXQgPj0gTVRQX0NPTlRBSU5FUl9IRUFERVJfU0laRSkgeworICAgICAgICBtRGF0YS5kdW1wKCk7CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKyAgICBlbHNlIHsKKyAgICAgICAgTE9HRCgicmVhZFJlc3BvbnNlIGZhaWxlZFxuIik7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9Cit9CisKK010cFJlc3BvbnNlQ29kZSBNdHBEZXZpY2U6OnJlYWRSZXNwb25zZSgpIHsKKyAgICBMT0dEKCJyZWFkUmVzcG9uc2VcbiIpOworICAgIGludCByZXQgPSBtUmVzcG9uc2UucmVhZChtRW5kcG9pbnRJbik7CisgICAgaWYgKHJldCA+PSBNVFBfQ09OVEFJTkVSX0hFQURFUl9TSVpFKSB7CisgICAgICAgIG1SZXNwb25zZS5kdW1wKCk7CisgICAgICAgIHJldHVybiBtUmVzcG9uc2UuZ2V0UmVzcG9uc2VDb2RlKCk7CisgICAgfQorICAgIGVsc2UgeworICAgICAgICBMT0dEKCJyZWFkUmVzcG9uc2UgZmFpbGVkXG4iKTsKKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KK30KKworfSAgLy8gbmFtZXNwYWNlIGFuZHJvaWQKZGlmZiAtLWdpdCBhL21lZGlhL210cC9NdHBEZXZpY2UuaCBiL21lZGlhL210cC9NdHBEZXZpY2UuaApuZXcgZmlsZSBt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Ik10cERhdGFQYWNrZXQuaCIKKyNpbmNsdWRlICJNdHBSZXNwb25zZVBhY2tldC5oIgorI2luY2x1ZGUgIk10cFR5cGVzLmgiCisKK25hbWVzcGFjZSBhbmRyb2lkIHsKKworY2xhc3MgTXRwRGV2aWNlSW5mbzsKK2NsYXNzIE10cE9iamVjdEluZm87CitjbGFzcyBNdHBTdG9yYWdlSW5mbzsKKworY2xhc3MgTXRwRGV2aWNlIHsKK3ByaXZhdGU6CisgICAgc3RydWN0IHVzYl9kZXZpY2UqICAgICAgbURldmljZTsKKyAgICBpbnQgICAgICAgICAgICAgICAgICAgICBtSW50ZXJmYWNlOworICAgIHN0cnVjdCB1c2JfZW5kcG9pbnQqICAgIG1FbmRwb2ludEluOworICAgIHN0cnVjdCB1c2JfZW5kcG9pbnQqICAgIG1FbmRwb2ludE91dDsKKyAgICBzdHJ1Y3QgdXNiX2VuZHBvaW50KiAgICBtRW5kcG9pbnRJbnRyOworICAgIE10cERldmljZUluZm8qICAgICAgICAgIG1EZXZpY2VJbmZvOworICAgIE10cFByb3BlcnR5TGlzdCAgICAgICAgIG1EZXZpY2VQcm9wZXJ0aWVzOworCisgICAgLy8gYSB1bmlxdWUgSUQgZm9yIHRoZSBkZXZpY2UKKyAgICBpbnQgICAgICAgICAgICAgICAgICAgICBtSUQ7CisKKyAgICAvLyBjdXJyZW50IHNlc3Npb24gSUQKKyAgICBNdHBTZXNzaW9uSUQgICAgICAgICAgICBtU2Vzc2lvbklEOworICAgIC8vIGN1cnJlbnQgdHJhbnNhY3Rpb24gSUQKKyAgICBNdHBUcmFuc2FjdGlvbklEICAgICAgICBtVHJhbnNhY3Rpb25JRDsKKworICAgIE10cFJlcXVlc3RQYWNrZXQgICAgICAgIG1SZXF1ZXN0OworICAgIE10cERhdGFQYWNrZXQgICAgICAgICAgIG1EYXRhOworICAgIE10cFJlc3BvbnNlUGFja2V0ICAgICAgIG1SZXNwb25zZTsKKworcHVibGljOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cERldmljZShzdHJ1Y3QgdXNiX2RldmljZSogZGV2aWNlLCBpbnQgaW50ZXJmYWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHVzYl9lbmRwb2ludCAqZXBfaW4sIHN0cnVjdCB1c2JfZW5kcG9pbnQgKmVwX291dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB1c2JfZW5kcG9pbnQgKmVwX2ludHIpOworICAgIHZpcnR1YWwgICAgICAgICAgICAgICAgIH5NdHBEZXZpY2UoKTsKKworICAgIGlubGluZSBpbnQgICAgICAgICAgICAgIGdldElEKCkgY29uc3QgeyByZXR1cm4gbUlEOyB9CisKKyAgICB2b2lkICAgICAgICAgICAgICAgICAgICBpbml0aWFsaXplKCk7CisgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgY2xvc2UoKTsKKyAgICBjb25zdCBjaGFyKiAgICAgICAgICAgICBnZXREZXZpY2VOYW1lKCk7CisKKyAgICBib29sICAgICAgICAgICAgICAgICAgICBvcGVuU2Vzc2lvbigpOworICAgIGJvb2wgICAgICAgICAgICAgICAgICAgIGNsb3NlU2Vzc2lvbigpOworCisgICAgTXRwRGV2aWNlSW5mbyogICAgICAgICAgZ2V0RGV2aWNlSW5mbygpOworICAgIE10cFN0b3JhZ2VJRExpc3QqICAgICAgIGdldFN0b3JhZ2VJRHMoKTsKKyAgICBNdHBTdG9yYWdlSW5mbyogICAgICAgICBnZXRTdG9yYWdlSW5mbyhNdHBTdG9yYWdlSUQgc3RvcmFnZUlEKTsKKyAgICBNdHBPYmplY3RIYW5kbGVMaXN0KiAgICBnZXRPYmplY3RIYW5kbGVzKE10cFN0b3JhZ2VJRCBzdG9yYWdlSUQsIE10cE9iamVjdEZvcm1hdCBmb3JtYXQsIE10cE9iamVjdEhhbmRsZSBwYXJlbnQpOworICAgIE10cE9iamVjdEluZm8qICAgICAgICAgIGdldE9iamVjdEluZm8oTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSk7CisgICAgdm9pZCogICAgICAgICAgICAgICAgICAgZ2V0VGh1bWJuYWlsKE10cE9iamVjdEhhbmRsZSBoYW5kbGUsIGludCYgb3V0TGVuZ3RoKTsKKyAgICBib29sICAgICAgICAgICAgICAgICAgICBkZWxldGVPYmplY3QoTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSk7CisgICAgTXRwT2JqZWN0SGFuZGxlICAgICAgICAgZ2V0UGFyZW50KE10cE9iamVjdEhhbmRsZSBoYW5kbGUpOworICAgIE10cE9iamVjdEhhbmRsZSAgICAgICAgIGdldFN0b3JhZ2VJRChNdHBPYmplY3RIYW5kbGUgaGFuZGxlKTsKKworICAgIE10cFByb3BlcnR5KiAgICAgICAgICAgIGdldERldmljZVByb3BEZXNjKE10cERldmljZVByb3BlcnR5IGNvZGUpOworCitwcml2YXRlOgorICAgIGJvb2wgICAgICAgICAgICAgICAgICAgIHNlbmRSZXF1ZXN0KE10cE9wZXJhdGlvbkNvZGUgb3BlcmF0aW9uKTsKKyAgICBib29sICAgICAgICAgICAgICAgICAgICBzZW5kRGF0YShNdHBPcGVyYXRpb25Db2RlIG9wZXJhdGlvbik7CisgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgcmVhZERhdGEoKTsKKyAgICBNdHBSZXNwb25zZUNvZGUgICAgICAgICByZWFkUmVzcG9uc2UoKTsKKworfTsKKworfTsgLy8gbmFtZXNwYWNlIGFuZHJvaWQKKworI2VuZGlmIC8vIF9NVFBfREVWSUNFX0gKZGlmZiAtLWdpdCBhL21lZGlhL210cC9NdHBEZXZpY2VJbmZvLmNwcCBiL21lZGlhL210cC9NdHBEZXZpY2VJbmZvLmNwcApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5lYjI1ZmIzCi0tLSAvZGV2L251bGwKKysrIGIvbWVkaWEvbXRwL010cERldmljZUluZm8uY3BwCkBAIC0wLDAgKzEsOTcgQEAKKy8qCisgKiBDb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AgIDogICBtU3RhbmRhcmRWZXJzaW9uKDApLAorICAgICAgICBtVmVuZG9yRXh0ZW5zaW9uSUQoMCksCisgICAgICAgIG1WZW5kb3JFeHRlbnNpb25WZXJzaW9uKDApLAorICAgICAgICBtVmVuZG9yRXh0ZW5zaW9uRGVzYyhOVUxMKSwKKyAgICAgICAgbUZ1bmN0aW9uYWxDb2RlKDApLAorICAgICAgICBtT3BlcmF0aW9ucyhOVUxMKSwKKyAgICAgICAgbUV2ZW50cyhOVUxMKSwKKyAgICAgICAgbURldmljZVByb3BlcnRpZXMoTlVMTCksCisgICAgICAgIG1DYXB0dXJlRm9ybWF0cyhOVUxMKSwKKyAgICAgICAgbVBsYXliYWNrRm9ybWF0cyhOVUxMKSwKKyAgICAgICAgbU1hbnVmYWN0dXJlcihOVUxMKSwKKyAgICAgICAgbU1vZGVsKE5VTEwpLAorICAgICAgICBtVmVyc2lvbihOVUxMKSwKKyAgICAgICAgbVNlcmlhbChOVUxMKQoreworfQorCitNdHBEZXZpY2VJbmZvOjp+TXRwRGV2aWNlSW5mbygpIHsKKyAgICBpZiAobVZlbmRvckV4dGVuc2lvbkRlc2MpCisgICAgICAgIGZyZWUobVZlbmRvckV4dGVuc2lvbkRlc2MpOworICAgIGRlbGV0ZSBtT3BlcmF0aW9uczsKKyAgICBkZWxldGUgbUV2ZW50czsKKyAgICBkZWxldGUgbURldmljZVByb3BlcnRpZXM7CisgICAgZGVsZXRlIG1DYXB0dXJlRm9ybWF0czsKKyAgICBkZWxldGUgbVBsYXliYWNrRm9ybWF0czsKKyAgICBpZiAobU1hbnVmYWN0dXJlcikKKyAgICAgICAgZnJlZShtTWFudWZhY3R1cmVyKTsKKyAgICBpZiAobU1vZGVsKQorICAgICAgICBmcmVlKG1Nb2RlbCk7CisgICAgaWYgKG1WZXJzaW9uKQorICAgICAgICBmcmVlKG1WZXJzaW9uKTsKKyAgICBpZiAobVNlcmlhbCkKKyAgICAgICAgZnJlZShtU2VyaWFsKTsKK30KKwordm9pZCBNdHBEZXZpY2VJbmZvOjpyZWFkKE10cERhdGFQYWNrZXQmIHBhY2tldCkgeworICAgIE10cFN0cmluZ0J1ZmZlciBzdHJpbmc7CisKKyAgICAvLyByZWFkIHRoZSBkZXZpY2UgaW5mbworICAgIG1TdGFuZGFyZFZlcnNpb24gPSBwYWNrZXQuZ2V0VUludDE2KCk7CisgICAgbVZlbmRvckV4dGVuc2lvbklEID0gcGFja2V0LmdldFVJbnQzMigpOworICAgIG1WZW5kb3JFeHRlbnNpb25WZXJzaW9uID0gcGFja2V0LmdldFVJbnQxNigpOworCisgICAgcGFja2V0LmdldFN0cmluZyhzdHJpbmcpOworICAgIG1WZW5kb3JFeHRlbnNpb25EZXNjID0gc3RyZHVwKChjb25zdCBjaGFyICopc3RyaW5nKTsKKworICAgIG1GdW5jdGlvbmFsQ29kZSA9IHBhY2tldC5nZXRVSW50MTYoKTsKKyAgICBtT3BlcmF0aW9ucyA9IHBhY2tldC5nZXRBVUludDE2KCk7CisgICAgbUV2ZW50cyA9IHBhY2tldC5nZXRBVUludDE2KCk7CisgICAgbURldmljZVByb3BlcnRpZXMgPSBwYWNrZXQuZ2V0QVVJbnQxNigpOworICAgIG1DYXB0dXJlRm9ybWF0cyA9IHBhY2tldC5nZXRBVUludDE2KCk7CisgICAgbVBsYXliYWNrRm9ybWF0cyA9IHBhY2tldC5nZXRBVUludDE2KCk7CisKKyAgICBwYWNrZXQuZ2V0U3RyaW5nKHN0cmluZyk7CisgICAgbU1hbnVmYWN0dXJlciA9IHN0cmR1cCgoY29uc3QgY2hhciAqKXN0cmluZyk7CisgICAgcGFja2V0LmdldFN0cmluZyhzdHJpbmcpOworICAgIG1Nb2RlbCA9IHN0cmR1cCgoY29uc3QgY2hhciAqKXN0cmluZyk7CisgICAgcGFja2V0LmdldFN0cmluZyhzdHJpbmcpOworICAgIG1WZXJzaW9uID0gc3RyZHVwKChjb25zdCBjaGFyICopc3RyaW5nKTsKKyAgICBwYWNrZXQuZ2V0U3Ry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b247CisgICAgY2hhciogICAgICAgICAgICAgICAgICAgbVZlbmRvckV4dGVuc2lvbkRlc2M7CisgICAgdWludDE2X3QgICAgICAgICAgICAgICAgbUZ1bmN0aW9uYWxDb2RlOworICAgIFVJbnQxNkxpc3QqICAgICAgICAgICAgIG1PcGVyYXRpb25zOworICAgIFVJbnQxNkxpc3QqICAgICAgICAgICAgIG1FdmVudHM7CisgICAgTXRwRGV2aWNlUHJvcGVydHlMaXN0KiAgbURldmljZVByb3BlcnRpZXM7CisgICAgTXRwT2JqZWN0Rm9ybWF0TGlzdCogICAgbUNhcHR1cmVGb3JtYXRzOworICAgIE10cE9iamVjdEZvcm1hdExpc3QqICAgIG1QbGF5YmFja0Zvcm1hdHM7CisgICAgY2hhciogICAgICAgICAgICAgICAgICAgbU1hbnVmYWN0dXJlcjsKKyAgICBjaGFyKiAgICAgICAgICAgICAgICAgICBtTW9kZWw7CisgICAgY2hhciogICAgICAgICAgICAgICAgICAgbVZlcnNpb247CisgICAgY2hhciogICAgICAgICAgICAgICAgICAgbVNlcmlhbDsKKworcHVibGljOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cERldmljZUluZm8oKTsKKyAgICB2aXJ0dWFsICAgICAgICAgICAgICAgICB+TXRwRGV2aWNlSW5mbygpOworCisgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgcmVhZChNdHBEYXRhUGFja2V0JiBwYWNrZXQpOworCisgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgcHJpbnQoKTsKK307CisKK307IC8vIG5hbWVzcGFjZSBhbmRyb2lkCisKKyNlbmRpZiAvLyBfTVRQX0RFVklDRV9JTkZPX0gKZGlmZiAtLWdpdCBhL21lZGlhL210cC9NdHBNZWRpYVNjYW5uZXIuY3BwIGIvbWVkaWEvbXRwL010cE1lZGlhU2Nhbm5lci5jcHAKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMWRiMWI5ZAotLS0gL2Rldi9udWxsCisrKyBi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mluZ1RhZyhjb25zdCBjaGFyKiBuYW1lLCBjb25zdCBjaGFyKiB2YWx1ZSkKKyAgICB7CisgICAgICAgIGludCB0ZW1wOworCisgICAgICAgIGlmICghc3RyY21wKG5hbWUsICJ0aXRsZSIpKSB7CisgICAgICAgICAgICBtVGl0bGUgPSB2YWx1ZTsKKyAgICAgICAgICAgIG1IYXNUaXRsZSA9IHRydWU7CisgICAgICAgIH0gZWxzZSBpZiAgKCFzdHJjbXAobmFtZSwgImFydGlzdCIpKSB7CisgICAgICAgICAgICBtQXJ0aXN0ID0gdmFsdWU7CisgICAgICAgICAgICBtSGFzQXJ0aXN0ID0gdHJ1ZTsKKyAgICAgICAgfSBlbHNlIGlmICAoIXN0cmNtcChuYW1lLCAiYWxidW0iKSkgeworICAgICAgICAgICAgbUFsYnVtID0gdmFsdWU7CisgICAgICAgICAgICBtSGFzQWxidW0gPSB0cnVlOworICAgICAgICB9IGVsc2UgaWYgICghc3RyY21wKG5hbWUsICJhbGJ1bWFydGlzdCIpKSB7CisgICAgICAgICAgICBtQWxidW1BcnRpc3QgPSB2YWx1ZTsKKyAgICAgICAgICAgIG1IYXNBbGJ1bUFydGlzdCA9IHRydWU7CisgICAgICAgIH0gZWxzZSBpZiAgKCFzdHJjbXAobmFtZSwgImdlbnJlIikpIHsKKyAgICAgICAgICAgIC8vIEZJWE1FIC0gaGFuZGxlIG51bWVyaWMgdmFsdWVzIGhlcmUKKyAgICAgICAgICAgIG1HZW5yZSA9IHZhbHVlOworICAgICAgICAgICAgbUhhc0dlbnJlID0gdHJ1ZTsKKyAgICAgICAgfSBlbHNlIGlmICAoIXN0cmNtcChuYW1lLCAiY29tcG9zZXIiKSkgeworICAgICAgICAgICAgbUNvbXBvc2VyID0gdmFsdWU7CisgICAgICAgICAgICBtSGFzQ29tcG9zZXIgPSB0cnVlOworICAgICAgICB9IGVsc2UgaWYgICghc3RyY21wKG5hbWUsICJ0cmFja251bWJlciIpKSB7CisgICAgICAgICAgICBpZiAoc3NjYW5mKHZhbHVlLCAiJWQiLCAmdGVtcCkgPT0gMSkKKyAgICAgICAgICAgICAgICBtVHJhY2sgPSB0ZW1wOworICAgICAgICB9IGVsc2UgaWYgICghc3RyY21wKG5hbWUsICJkaXNjbnVtYmVyIikpIHsKKyAgICAgICAgICAgIC8vIGN1cnJlbnRseSB1bnVzZWQKKyAgICAgICAgfSBlbHNlIGlmICAoIXN0cmNtcChuYW1lLCAieWVhciIpIHx8ICFzdHJjbXAobmFtZSwgImRhdGUiKSkgeworICAgICAgICAgICAgaWYgKHNzY2FuZih2YWx1ZSwgIiVkIiwgJnRlbXApID09IDEpCisgICAgICAgICAgICAgICAgbVllYXIgPSB0ZW1wOworICAgICAgICB9IGVsc2UgaWYgICghc3RyY21wKG5hbWUsICJkdXJhdGlvbiIpKSB7CisgICAgICAgICAgICBpZiAoc3NjYW5mKHZhbHVlLCAiJWQiLCAmdGVtcCkgPT0gMSkKKyAgICAgICAgICAgICAgICBtRHVyYXRpb24gPSB0ZW1wOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcHJpbnRmKCJoYW5kbGVTdHJpbmdUYWcgJXMgOiAlc1xuIiwgbmFtZSwgdmFsdWUpOworICAgICAgICB9CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIC8vIHJldHVybnMgdHJ1ZSBpZiBpdCBzdWNjZWVkZWQsIGZhbHNlIGlmIGFuIGV4Y2VwdGlvbiBvY2N1cmVkIGluIHRoZSBKYXZhIGNvZGUKKyAgICB2aXJ0dWFsIGJvb2wgc2V0TWltZVR5cGUoY29uc3QgY2hhciogbWltZVR5cGUpCisgICAgeworICAgICAgICBtTWltZVR5cGUgPSBtaW1lVHlwZTsKKyAgICAgICAgbUhhc01pbWVUeXBlID0gdHJ1ZTsKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisgICAgLy8gcmV0dXJucyB0cnVlIGlmIGl0IHN1Y2NlZWRlZCwgZmFsc2UgaWYgYW4gZXhjZXB0a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sgfQorICAgIGlubGluZSBjb25zdCBjaGFyKiBnZXRHZW5yZSgpIGNvbnN0IHsgcmV0dXJuIG1IYXNHZW5yZSA/IChjb25zdCBjaGFyICopbUdlbnJlIDogTlVMTDsgfQorICAgIGlubGluZSBjb25zdCBjaGFyKiBnZXRDb21wb3NlcigpIGNvbnN0IHsgcmV0dXJuIG1IYXNDb21wb3NlciA/IChjb25zdCBjaGFyICopbUNvbXBvc2VyIDogTlVMTDsgfQorICAgIGlubGluZSBjb25zdCBjaGFyKiBnZXRNaW1lVHlwZSgpIGNvbnN0IHsgcmV0dXJuIG1IYXNNaW1lVHlwZSA/IChjb25zdCBjaGFyICopbU1pbWVUeXBlIDogTlVMTDsgfQorICAgIGlubGluZSBpbnQgZ2V0VHJhY2soKSBjb25zdCB7IHJldHVybiBtVHJhY2s7IH0KKyAgICBpbmxpbmUgaW50IGdldFllYXIoKSBjb25zdCB7IHJldHVybiBtWWVhcjsgfQorICAgIGlubGluZSBpbnQgZ2V0RHVyYXRpb24oKSBjb25zdCB7IHJldHVybiBtRHVyYXRpb247IH0KKworcHJpdmF0ZToKKyAgICBNdHBTdHJpbmcgICBtVGl0bGU7CisgICAgTXRwU3RyaW5nICAgbUFydGlzdDsKKyAgICBNdHBTdHJpbmcgICBtQWxidW07CisgICAgTXRwU3RyaW5nICAgbUFsYnVtQXJ0aXN0OworICAgIE10cFN0cmluZyAgIG1HZW5yZTsKKyAgICBNdHBTdHJpbmcgICBtQ29tcG9zZXI7CisgICAgTXRwU3RyaW5nICAgbU1pbWVUeXBlOworCisgICAgYm9vbCAgICAgICAgbUhhc1RpdGxlOworICAgIGJvb2wgICAgICAgIG1IYXNBcnRpc3Q7CisgICAgYm9vbCAgICAgICAgbUhhc0FsYnVtOworICAgIGJvb2wgICAgICAgIG1IYXNBbGJ1bUFydGlzdDsKKyAgICBib29sICAgICAgICBtSGFzR2VucmU7CisgICAgYm9vbCAgICAgICAgbUhhc0NvbXBvc2VyOworICAgIGJvb2wgICAgIC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RbaV07CisgICAgICAgIGlmICghICh0ZXN0ICYga09iamVjdEhhbmRsZU1hcmtCaXQpKSB7CisgICAgICAgICAgICBwcmludGYoImRlbGV0ZSBtaXNzaW5nIGZpbGUgJTA4WFxuIiwgdGVzdCk7CisgICAgICAgICAgICBtRGF0YWJhc2UtPmRlbGV0ZUZpbGUodGVzdCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBkZWxldGVbXSBtRmlsZUxpc3Q7CisgICAgbUZpbGVDb3VudCA9IDA7CisgICAgbURhdGFiYXNlLT5jb21taXRUcmFuc2FjdGlvbigpOworICAgIHJldHVybiAocmV0ID09IDApOworfQorCisKK3N0YXRpYyBjb25zdCBzdHJ1Y3QgTWVkaWFGaWxlVHlwZUVudHJ5Cit7CisgICAgY29uc3QgY2hhciogICAgIGV4dGVuc2lvbjsKKyAgICBNdHBPYmplY3RGb3JtYXQgZm9ybWF0OworICAgIHVpbnQzMl90ICAgICAgICB0YWJsZTsKK30gc0ZpbGVUeXBlc1tdID0KK3sKKyAgICB7ICJNUDMiLCAgICBNVFBfRk9STUFUX01QMywgICAgICAgICAgICAga09iamVjdEhhbmRsZVRhYmxlQXVkaW8gICAgIH0sCisgICAgeyAiTTRBIiwgICAgTVRQX0ZPUk1BVF9VTkRFRklORURfQVVESU8sIGtPYmplY3RIYW5kbGVUYWJsZUF1ZGlvICAgICB9LAorICAgIHsgIldBViIsICAgIE1UUF9GT1JNQVRfV0FWLCAgICAgICAgICAgICBrT2JqZWN0SGFuZGxlVGFibGVBdWRpbyAgICAgfSwKKyAgICB7ICJBTVIiLCAgICBNVFBfRk9STUFUX1VOREVGSU5FRF9BVURJTywga09iamVjdEhhbmRsZVRhYmxlQXVkaW8gICAgIH0sCisgICAgeyAiQVdCIiwgICAgTVRQX0ZPUk1BVF9VTkRFRklORURfQVVESU8sIGtPYmplY3RIYW5kbGVUYWJsZUF1ZGlvICAgICB9LAorICAgIHsgIldNQSIsICAgIE1UUF9GT1JNQVRfV01BLCAgICAg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R5cGVzKSAvIHNpemVvZihzRmlsZVR5cGVzWzBdKTsgaSsrKSB7CisgICAgICAgIGlmICghc3RyY2FzZWNtcChleHRlbnNpb24sIHNGaWxlVHlwZXNbaV0uZXh0ZW5zaW9uKSkgeworICAgICAgICAgICAgdGFibGUgPSBzRmlsZVR5cGVzW2ldLnRhYmxlOworICAgICAgICAgICAgcmV0dXJuIHNGaWxlVHlwZXNbaV0uZm9ybWF0OworICAgICAgICB9CisgICAgfQorICAgIHRhYmxlID0ga09iamVjdEhhbmRsZVRhYmxlRmlsZTsKKyAgICByZXR1cm4gTVRQX0ZPUk1BVF9VTkRFRklORUQ7Cit9CisKK2ludCBNdHBNZWRpYVNjYW5uZXI6OnNjYW5EaXJlY3RvcnkoY29uc3QgY2hhciogcGF0aCwgTXRwT2JqZWN0SGFuZGxlIHBhcmVudCkKK3sKKyAgICBjaGFyIGJ1ZmZlcltQQVRIX01BWF07CisgICAgc3RydWN0IGRpcmVudCogZW50cnk7CisKKyAgICB1bnNpZ25lZCBsZW5ndGggPSBzdHJsZW4ocGF0aCk7CisgICAgaWYgKGxlbmd0aCA+IHNpemVvZihidWZmZXIpICsgMikgeworICAgICAgICBmcHJpbnRmKHN0ZGVyciwgInBhdGggdG9vIGxvbmc6ICVzXG4iLCBwYXRoKTsKKyAgICB9CisKKyAgICBESVIqIGRpciA9IG9wZW5kaXIocGF0aCk7CisgICAgaWYgKCFkaXIpIHsKKyAgICAgICAgZnByaW50ZihzdGRlcnIsICJvcGVuZGlyICVzIGZhaWxlZCwgZXJybm86ICVkIiwgcGF0aCwgZXJybm8pOworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgICAgc3RybmNweShidWZmZXIsIHBhdGgsIHNpemVvZihidWZmZXIpKTsKKyAgICBjaGFyKiBmaWxlU3RhcnQgPSBidWZmZXIgKyBsZW5ndGg7CisgICAgLy8gbWFrZSBzdXJlIHdlIGhhdmUgYSB0cmFpbGluZyBzbGFzaAorICAgIGlmIChmaWxlU3RhcnRbLTFdICE9ICcvJykgeworICAgICAgICAqKGZpbGVTdGFydCsrKSA9ICcvJzsKKyAgICB9CisgICAgaW50IGZpbGVOYW1lTGVuZ3RoID0gc2l6ZW9mKGJ1ZmZlcikgKyBmaWxlU3RhcnQgLSBidWZmZXI7CisKKyAgICB3aGlsZSAoKGVudHJ5ID0gcmVhZGRpcihkaXIpKSkgeworICAgICAgICBjb25zdCBjaGFyKiBuYW1lID0gZW50cnktPmRfbmFtZTsKKworICAgICAgICAvLyBpZ25vcmUgIi4iIGFuZCAiLi4iLCBhcyB3ZWxsIGFzIGFueSBmaWxlcyBvciBkaXJlY3RvcmllcyBzdGFyaW5nIHdpdGggZG90CisgICAgICAgIGlmIChuYW1lWzBdID09ICcuJykgeworICAgICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHN0cmxlbihuYW1lKSArIDEgPiBmaWxlTmFtZUxlbmd0aCkgeworICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJwYXRoIHRvbyBsb25nIGZvciAlc1xuIiwgbmFtZSk7CisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorICAgICAgICBzdHJjcHkoZmlsZVN0YXJ0LCBuYW1lKTsKKworICAgICAgICBzdHJ1Y3Qgc3RhdCBzdGF0YnVmOworICAgICAgICBtZW1zZXQoJnN0YXRidWYsIDAsIHNpemVvZihzdGF0YnVmKSk7CisgICAgICAgIHN0YXQoYnVmZmVyLCAmc3RhdGJ1Zik7CisKKyAgICAgICAgaWYgKFNfSVNESVIoc3RhdGJ1Zi5zdF9tb2RlKSkgeworICAgICAgICAgICAgTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSA9IG1EYXRhYmFzZS0+Z2V0T2JqZWN0SGFuZGxlKGJ1ZmZlcik7CisgICAgICAgICAgICBpZiAoaGFuZGxlKSB7CisgICAgICAgICAgICAgICAgbWFya0ZpbGUoaGFuZGxlKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgIC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oKTsKKyAgICAgICAgaGFuZGxlID0gbURhdGFiYXNlLT5hZGRGaWxlKHBhdGgsIGZvcm1hdCwgcGFyZW50LCBtU3RvcmFnZUlELAorICAgICAgICAgICAgICAgIHN0YXRidWYuc3Rfc2l6ZSwgc3RhdGJ1Zi5zdF9tdGltZSk7CisgICAgICAgIGlmIChoYW5kbGUgPD0gMCkgeworICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJhZGRGaWxlIGZhaWxlZCBpbiBNdHBNZWRpYVNjYW5uZXI6OnNjYW5GaWxlKClcbiIpOworICAgICAgICAgICAgbURhdGFiYXNlLT5yb2xsYmFja1RyYW5zYWN0aW9uKCk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBpZiAodGFibGUgPT0ga09iamVjdEhhbmRsZVRhYmxlQXVkaW8pIHsKKyAgICAgICAgICAgIG1NZWRpYVNjYW5uZXJDbGllbnQtPnJlc2V0KCk7CisgICAgICAgICAgICBtTWVkaWFTY2FubmVyLT5wcm9jZXNzRmlsZShwYXRoLCBOVUxMLCAqbU1lZGlhU2Nhbm5lckNsaWVudCk7CisgICAgICAgICAgICBoYW5kbGUgPSBtRGF0YWJhc2UtPmFkZEF1ZGlvRmlsZShoYW5kbGUsCisgICAgICAgICAgICAgICAgICAgIG1NZWRpYVNjYW5uZXJDbGllbnQtPmdldFRpdGxlKCksCisgICAgICAgICAgICAgICAgICAgIG1NZWRpYVNjYW5uZXJDbGllbnQtPmdldEFydGlzdCgpLAorICAgICAgICAgICAgICAgICAgICBtTWVkaWFTY2FubmVyQ2xpZW50LT5nZXRBbGJ1bSgpLAorICAgICAgICAgICAgICAgICAgICBtTWVkaWFTY2FubmVyQ2xpZW50LT5nZXRBbGJ1bUFydGlzdCgpLAorICAgICAgICAgICAgICAgICAgICBtTWVkaWFTY2FubmVyQ2xpZW50LT5nZXRHZW5yZSgpLAorICAgICAgICAgICAgICAgICAgICBtTWVkaWFTY2FubmVyQ2xpZW50LT5nZXRDb21wb3NlcigpLAorICAgICAgICAgICAgICAgICAgICBtTWVkaWFTY2FubmVyQ2xpZW50LT5nZXRNaW1lVHlwZSgpLAorICAgICAgICAgICAgICAgICAgICBtTWVkaWFTY2FubmVyQ2xpZW50LT5nZXRUcmFjaygpLAorICAgICAgICAgICAgICAgICAgICBtTWVkaWFTY2FubmVyQ2xpZW50LT5nZXRZZWFyKCksCisgICAgICAgICAgICAgICAgICAgIG1NZWRpYVNjYW5uZXJDbGllbnQtPmdldER1cmF0aW9uKCkpOworICAgICAgICB9CisgICAgICAgIG1EYXRhYmFzZS0+Y29tbWl0VHJhbnNhY3Rpb24oKTsKKyAgICB9Cit9CisKK3ZvaWQgTXRwTWVkaWFTY2FubmVyOjptYXJrRmlsZShNdHBPYmplY3RIYW5kbGUgaGFuZGxlKSB7CisgICAgaWYgKG1GaWxlTGlzdCkgeworICAgICAgICBoYW5kbGUgJj0ga09iamVjdEhhbmRsZUluZGV4TWFzazsKKyAgICAgICAgLy8gYmluYXJ5IHNlYXJjaCBmb3IgdGhlIGZpbGUgaW4gbUZpbGVMaXN0CisgICAgICAgIGludCBsb3cgPSAwOworICAgICAgICBpbnQgaGlnaCA9IG1GaWxlQ291bnQ7CisgICAgICAgIGludCBpbmRleDsKKworICAgICAgICB3aGlsZSAobG93IDwgaGlnaCkgeworICAgICAgICAgICAgaW5kZXggPSAobG93ICsgaGlnaCkgPj4gMTsKKyAgICAgICAgICAgIE10cE9iamVjdEhhbmRsZSB0ZXN0ID0gKG1GaWxlTGlzdFtpbmRleF0gJiBrT2JqZWN0SGFuZGxlSW5kZXhNYXNrKTsKKyAgICAgICAgICAgIGlmIChoYW5kbGUgPCB0ZXN0KQorICAgICAgICAgICAgICAgIGhpZ2ggPSBpbmRleDsgICAgICAgLy8gaXRlbSBpcyBsZXNzIHRoYW4gaW5kZXgKKyAgICAgICAgICAgIGVsc2UgaWYgKGhhbmRsZSA+IHRlc3QpCisgICAgICAgICAgICAgICAgbG93ID0gaW5kZXgg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AgICAgICAgICAgICAgbUZpbGVDb3VudDsKKworcHVibGljOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE1lZGlhU2Nhbm5lcihNdHBTdG9yYWdlSUQgaWQsIGNvbnN0IGNoYXIqIGZpbGVQYXRoLCBNdHBEYXRhYmFzZSogZGIpOworICAgIHZpcnR1YWwgICAgICAgICAgICAgICAgIH5NdHBNZWRpYVNjYW5uZXIoKTsKKworICAgIGJvb2wgICAgICAgICAgICAgICAgICAgIHNjYW5GaWxlcygpOworCitwcml2YXRlOgorICAgIE10cE9iamVjdEZvcm1hdCAgICAgICAgIGdldEZpbGVGb3JtYXQoY29uc3QgY2hhciogcGF0aCwgdWludDMyX3QmIHRhYmxlKTsKKyAgICBpbnQgICAgICAgICAgICAgICAgICAgICBzY2FuRGlyZWN0b3J5KGNvbnN0IGNoYXIqIHBhdGgsIE10cE9iamVjdEhhbmRsZSBwYXJlbnQpOworICAgIHZvaWQgICAgICAgICAgICAgICAgICAgIHNjYW5GaWxlKGNvbnN0IGNoYXIqIHBhdGgsIE10cE9iamVjdEhhbmRsZSBwYXJlbnQsIHN0cnVjdCBzdGF0JiBzdGF0YnVmKTsKKyAgICB2b2lkICAgICAgICAgICAgICAgICAgICBtYXJrRmlsZShNdHBPYmplY3RIYW5kbGUgaGFuZGxlKTsKK307CisKK307IC8vIG5hbWVzcGFjZSBhbmRyb2lkCisKKyNlbmRpZiAvLyBfTVRQX01FRElBX1NDQU5ORVJfSApkaWZmIC0tZ2l0IGEvbWVkaWEvbXRwL010cE9iamVjdEluZm8uY3BwIGIvbWVkaWEvbXRwL010cE9iamVjdEluZm8uY3BwCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmRlMGY1NGEKLS0tIC9kZXYvbnVsbAorKysgYi9tZWRpYS9tdHAvTXRwT2JqZWN0SW5mby5jcHAKQEAgLTAsMCArMSwxMDggQEAKKy8qCisgKiBDb3B5cmlnaHQgKEMpIDIwMTAgVG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JqZWN0SW5mbyhNdHBPYmplY3RIYW5kbGUgaGFuZGxlKQorICAgIDogICBtSGFuZGxlKGhhbmRsZSksCisgICAgICAgIG1TdG9yYWdlSUQoMCksCisgICAgICAgIG1Gb3JtYXQoMCksCisgICAgICAgIG1Qcm90ZWN0aW9uU3RhdHVzKDApLAorICAgICAgICBtQ29tcHJlc3NlZFNpemUoMCksCisgICAgICAgIG1UaHVtYkZvcm1hdCgwKSwKKyAgICAgICAgbVRodW1iQ29tcHJlc3NlZFNpemUoMCksCisgICAgICAgIG1UaHVtYlBpeFdpZHRoKDApLAorICAgICAgICBtVGh1bWJQaXhIZWlnaHQoMCksCisgICAgICAgIG1JbWFnZVBpeFdpZHRoKDApLAorICAgICAgICBtSW1hZ2VQaXhIZWlnaHQoMCksCisgICAgICAgIG1JbWFnZVBpeERlcHRoKDApLAorICAgICAgICBtUGFyZW50KDApLAorICAgICAgICBtQXNzb2NpYXRpb25UeXBlKDApLAorICAgICAgICBtQXNzb2NpYXRpb25EZXNjKDApLAorICAgICAgICBtU2VxdWVuY2VOdW1iZXIoMCksCisgICAgICAgIG1OYW1lKE5VTEwpLAorICAgICAgICBtRGF0ZUNyZWF0ZWQoMCksCisgICAgICAgIG1EYXRlTW9kaWZpZWQoMCksCisgICAgICAgIG1LZXl3b3JkcyhOVUxMKQoreworfQorCitNdHBPYmplY3RJbmZvOjp+TXRwT2JqZWN0SW5mbygpIHsKKyAgICBpZiAobU5hbWUpCisgICAgICAgIGZyZWUobU5hbWUpOworICAgIGlmIChtS2V5d29yZHMpCisgICAgICAgIGZyZWUobUtleXdvcmRzKTsKK30KKwordm9pZCBNdHBPYmplY3RJbmZvOjpyZWFkKE10cERhdGFQYWNrZXQmIHBhY2tldCkgeworICAgIE10cFN0cmluZ0J1ZmZlciBzdHJpbmc7CisgICAgdGltZV90IHRpbWU7CisKKyAgICBtU3RvcmFnZUlEID0gcGFja2V0LmdldFVJbnQzMigpOworICAgIG1Gb3JtYXQgPSBwYWNrZXQu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IG1JbWFnZVBpeERlcHRoOworICAgIE10cE9iamVjdEhhbmRsZSAgICAgbVBhcmVudDsKKyAgICB1aW50MTZfdCAgICAgICAgICAgIG1Bc3NvY2lhdGlvblR5cGU7CisgICAgdWludDMyX3QgICAgICAgICAgICBtQXNzb2NpYXRpb25EZXNjOworICAgIHVpbnQzMl90ICAgICAgICAgICAgbVNlcXVlbmNlTnVtYmVyOworICAgIGNoYXIqICAgICAgICAgICAgICAgbU5hbWU7CisgICAgdGltZV90ICAgICAgICAgICAgICBtRGF0ZUNyZWF0ZWQ7CisgICAgdGltZV90ICAgICAgICAgICAgICBtRGF0ZU1vZGlmaWVkOworICAgIGNoYXIqICAgICAgICAgICAgICAgbUtleXdvcmRzOworCitwdWJsaWM6CisgICAgICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RJbmZvKE10cE9iamVjdEhhbmRsZSBoYW5kbGUpOworICAgIHZpcnR1YWwgICAgICAgICAgICAgfk10cE9iamVjdEluZm8oKTsKKworICAgIHZvaWQgICAgICAgICAgICAgICAgcmVhZChNdHBEYXRhUGFja2V0JiBwYWNrZXQpOworCisgICAgdm9pZCAgICAgICAgICAgICAgICBwcmludCgpOworfTsKKworfTsgLy8gbmFtZXNwYWNlIGFuZHJvaWQKKworI2VuZGlmIC8vIF9NVFBfT0JKRUNUX0lORk9fSApkaWZmIC0tZ2l0IGEvbWVkaWEvbXRwL010cFBhY2tldC5jcHAgYi9tZWRpYS9tdHAvTXRwUGFja2V0LmNwcApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zZGI2YWJiCi0tLSAvZGV2L251bGwKKysrIGIvbWVkaWEvbXRwL010cFBhY2tldC5jcHAKQEAgLTAsMCArMSwxNDAgQEAKKy8qCisgKiBDb3B5cmlnaHQgKEMpIDIwMTAgVGhlIEFuZHJvaWQgT3BlbiBTb3VyY2UgUHJvamVjdAorICoKKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW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ICAgIHByaW50ZigiJTAyWCAiLCBtQnVmZmVyW2ldKTsKKyAgICAgICAgaWYgKGkgJSAxNiA9PSAxNSkKKyAgICAgICAgICAgIHByaW50ZigiXG4iKTsKKyAgICB9CisgICAgcHJpbnRmKCJcblxuIik7Cit9CisKK3VpbnQxNl90IE10cFBhY2tldDo6Z2V0VUludDE2KGludCBvZmZzZXQpIGNvbnN0IHsKKyAgICByZXR1cm4gKCh1aW50MTZfdCltQnVmZmVyW29mZnNldCArIDFdIDw8IDgpIHwgKHVpbnQxNl90KW1CdWZmZXJbb2Zmc2V0XTsKK30KKwordWludDMyX3QgTXRwUGFja2V0OjpnZXRVSW50MzIoaW50IG9mZnNldCkgY29uc3QgeworICAgIHJldHVybiAoKHVpbnQzMl90KW1CdWZmZXJbb2Zmc2V0ICsgM10gPDwgMjQpIHwgKCh1aW50MzJfdCltQnVmZmVyW29mZnNldCArIDJdIDw8IDE2KSB8CisgICAgICAgICAgICgodWludDMyX3QpbUJ1ZmZlcltvZmZzZXQgKyAxXSA8PCA4KSAgfCAodWludDMyX3QpbUJ1ZmZlcltvZmZzZXRdOworfQorCit2b2lkIE10cFBhY2tldDo6cHV0VUludDE2KGludCBvZmZzZXQsIHVpbnQxNl90IHZhbHVlKSB7CisgICAgbUJ1ZmZlcltvZmZzZXQrK10gPSAodWludDhfdCkodmFsdWUgJiAweEZGKTsKKyAgICBtQnVmZmVyW29mZnNldCsrXSA9ICh1aW50OF90KSgodmFsdWUgPj4gOCkgJiAweEZGKTsKK30KKwordm9pZCBNdHBQYWNrZXQ6OnB1dFVJbnQzMihpbnQgb2Zmc2V0LCB1aW50MzJfdCB2YWx1ZSkgeworICAgIG1CdWZmZXJbb2Zmc2V0KytdID0gKHVpbnQ4X3QpKHZhbHVlICYgMHhGRik7CisgICAgbUJ1ZmZlcltvZmZzZXQrK10gPSAodWludDhfdCkoKHZhbHVlID4+IDgpICYgMHhGRik7CisgICAgbUJ1ZmZlcltvZmZzZXQrK10gPSAodWludDhf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LmgiCisKK3N0cnVjdCB1c2JfZW5kcG9pbnQ7CisKK25hbWVzcGFjZSBhbmRyb2lkIHsKKworY2xhc3MgTXRwU3RyaW5nQnVmZmVyOworCitjbGFzcyBNdHBQYWNrZXQgeworCitwcm90ZWN0ZWQ6CisgICAgdWludDhfdCogICAgICAgICAgICBtQnVmZmVyOworICAgIC8vIGN1cnJlbnQgc2l6ZSBvZiB0aGUgYnVmZmVyCisgICAgaW50ICAgICAgICAgICAgICAgICBtQnVmZmVyU2l6ZTsKKyAgICAvLyBudW1iZXIgb2YgYnl0ZXMgdG8gYWRkIHdoZW4gcmVzaXppbmcgdGhlIGJ1ZmZlcgorICAgIGludCAgICAgICAgICAgICAgICAgbUFsbG9jYXRpb25JbmNyZW1lbnQ7CisgICAgLy8gc2l6ZSBvZiB0aGUgZGF0YSBpbiB0aGUgcGFja2V0CisgICAgaW50ICAgICAgICAgICAgICAgICBtUGFja2V0U2l6ZTsKKworcHVibGljOgorICAgICAgICAgICAgICAgICAgICAgICAgTXRwUGFja2V0KGludCBidWZmZXJTaXplKTsKKyAgICB2aXJ0dWFsICAgICAgICAgICAgIH5NdHBQYWNrZXQoKTsKKworICAgIC8vIHNldHMgcGFja2V0IHNpemUgdG8gdGhlIGRlZmF1bHQgY29udGFpbmVyIHNpemUgYW5kIHNldHMgYnVmZmVyIHRvIHplcm8KKyAgICB2aXJ0dWFsIHZvaWQgICAgICAgIHJlc2V0KCk7CisKKyAgICB2b2lkICAgICAgICAgICAgICAgIGFsbG9jYXRlKGludCBsZW5ndGgpOworICAgIHZvaWQgICAgICAgICAgICAgICAgZHVtcCgpOworCisgICAgdWludDE2X3QgICAgICAgICAgICBnZXRDb250YWluZXJDb2RlKCkgY29uc3Q7CisgICAgdm9pZCAgICAgICAgICAgICAgICBzZXRDb250YWluZXJDb2RlKHVpbnQxNl90IGNvZGUpOworCisgICAgTXRwVHJhbnNhY3Rpb25JRCAgICBnZXRUcmFuc2FjdGlvbklEKCkgY29uc3Q7CisgICAgdm9pZCAgICAgICAgICAgICAgICBzZXRUcmFuc2FjdGlvbklEKE10cFRyYW5zYWN0aW9uSUQgaWQpOworCisgICAgdWludDMyX3QgICAgICAgICAgICBnZXRQYXJhbWV0ZXIoaW50IGluZGV4KSBjb25zdDsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHNldFBhcmFtZXRlcihpbnQgaW5kZXgsIHVpbnQzMl90IHZhbHVlKTsKKworI2lmZGVmIE1UUF9IT1NUCisgICAgaW50ICAgICAgICAgICAgICAgICB0cmFuc2ZlcihzdHJ1Y3QgdXNiX2VuZHBvaW50ICplcCwgdm9pZCogYnVmZmVyLCBpbnQgbGVuZ3RoKTsKKyNlbmRpZgorCitwcm90ZWN0ZWQ6CisgICAgdWludDE2X3QgICAgICAgICAgICBnZXRVSW50MTYoaW50IG9mZnNldCkgY29uc3Q7CisgICAgdWludDMyX3QgICAgICAgICAgICBnZXRVSW50MzIoaW50IG9mZnNldCkgY29uc3Q7CisgICAgdm9pZCAgICAgICAgICAgICAgICBwdXRVSW50MTYoaW50IG9mZnNldCwgdWludDE2X3QgdmFsdWUpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0VUludDMyKGludCBvZmZzZXQsIHVpbnQzMl90IHZhbHVlKTsKK307CisKK307IC8vIG5hbWVzcGFjZSBhbmRyb2lkCisKKyNlbmRpZiAvLyBfTVRQX1BBQ0tFVF9ICmRpZmYgLS1naXQgYS9tZWRpYS9tdHAvTXRwUHJvcGVydHkuY3BwIGIvbWVkaWEvbXRwL010cFByb3BlcnR5LmNwcApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi42NWNlNGQ0Ci0tLSAvZGV2L251bGwKKysrIGIvbWVkaWEvbXRwL010cFByb3BlcnR5LmNwcApAQCAtMCwwICsxLDE2MSBAQAorLyoKKyAqIENvcHlyaWdodCAoQykgMjAxMCBUaGUgQW5kcm9pZCBPcGVuIFNvdXJjZSBQcm9qZWN0CisgKgorICogTGljZW5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gICBtVHlwZSgwKSwKKyAgICAgICAgbVdyaXRlYWJsZShmYWxzZSksCisgICAgICAgIG1EZWZhdWx0QXJyYXlMZW5ndGgoMCksCisgICAgICAgIG1EZWZhdWx0QXJyYXlWYWx1ZXMoTlVMTCksCisgICAgICAgIG1DdXJyZW50QXJyYXlMZW5ndGgoMCksCisgICAgICAgIG1DdXJyZW50QXJyYXlWYWx1ZXMoTlVMTCksCisgICAgICAgIG1Gb3JtRmxhZyhrRm9ybU5vbmUpLAorICAgICAgICBtRW51bUxlbmd0aCgwKSwKKyAgICAgICAgbUVudW1WYWx1ZXMoTlVMTCkKK3sKKyAgICBtRGVmYXVsdFZhbHVlLnN0ciA9IE5VTEw7CisgICAgbUN1cnJlbnRWYWx1ZS5zdHIgPSBOVUxMOworICAgIG1NaW5pbXVtVmFsdWUuc3RyID0gTlVMTDsKKyAgICBtTWF4aW11bVZhbHVlLnN0ciA9IE5VTEw7Cit9CisKK010cFByb3BlcnR5Ojp+TXRwUHJvcGVydHkoKSB7CisgICAgaWYgKG1UeXBlID09IE1UUF9UWVBFX1NUUikgeworICAgICAgICAvLyBmcmVlIGFsbCBzdHJpbmdzCisgICAgICAgIGZyZWUobURlZmF1bHRWYWx1ZS5zdHIpOworICAgICAgICBmcmVlKG1DdXJyZW50VmFsdWUuc3RyKTsKKyAgICAgICAgZnJlZShtTWluaW11bVZhbHVlLnN0cik7CisgICAgICAgIGZyZWUobU1heGltdW1WYWx1ZS5zdHIpOworICAgICAgICBpZiAobURlZmF1bHRBcnJheVZhbHVlcykgeworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtRGVmYXVsdEFycmF5TGVuZ3RoOyBpKyspCisgICAgICAgICAgICAgICAgZnJlZShtRGVmYXVsdEFycmF5VmFsdWVzW2ldLnN0cik7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1DdXJyZW50QXJyYXlWYWx1ZXMpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbUN1cnJlbnRBcnJheUxlbmd0aDsgaSsrKQorICAgICAgICAgICAgICAgIGZyZWUobUN1cnJlbnRBcnJheVZhbHVlc1tpXS5zdHIpOworICAgICAgICB9CisgICAgICAgIGlmIChtRW51bVZhbHVlcykgeworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtRW51bUxlbmd0aDsgaSsrKQorICAgICAgICAgICAgICAgIGZyZWUobUVudW1WYWx1ZXNbaV0uc3RyKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBkZWxldGVbXSBtRGVmYXVsdEFycmF5VmFsdWVzOworICAgIGRlbGV0ZVtdIG1DdXJyZW50QXJyYXlWYWx1ZXM7CisgICAgZGVsZXRlW10gbUVudW1WYWx1ZXM7Cit9CisKK3ZvaWQgTXRwUHJvcGVydHk6OnJlYWQoTXRwRGF0YVBhY2tldCYgcGFja2V0KSB7CisgICAgTXRwU3RyaW5nQnVmZmVyIHN0cmluZzsKKworICAgIG1Db2RlID0gcGFja2V0LmdldFVJbnQxNigpOworICAgIG1UeXBlID0gcGFja2V0LmdldFVJbnQxNigpOworICAgIG1Xcml0ZWFibGUgPSAocGFja2V0LmdldFVJbnQ4KCkgPT0gMSk7CisgICAgc3dpdGNoIChtVHlwZSkgeworICAgICAgICBjYXNlIE1UUF9UWVBFX0FJTlQ4OgorICAgICAgICBjYXNlIE1UUF9UWVBFX0FVSU5UODoKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9BSU5UMTY6CisgICAgICAgIGNhc2UgTVRQX1RZUEVfQVVJTlQxNjoKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9BSU5UMzI6CisgICAgICAgIGNhc2UgTVRQX1RZUEVfQVVJTlQzMjoKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9BSU5UNjQ6CisgICAgICAgIGNhc2UgTVRQX1RZUEVfQVVJTlQ2NDoKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9BSU5UMTI4OgorICAgICAgICBjYXNlIE1UUF9UWVB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GUpOworICAgIExPR0QoIiAgICB0eXBlICUwNFhcbiIsIG1UeXBlKTsKKyAgICBMT0dEKCIgICAgd3JpdGVhYmxlICVzXG4iLCAobVdyaXRlYWJsZSA/ICJ0cnVlIiA6ICJmYWxzZSIpKTsKK30KKwordm9pZCBNdHBQcm9wZXJ0eTo6cmVhZFZhbHVlKE10cERhdGFQYWNrZXQmIHBhY2tldCwgTXRwUHJvcGVydHlWYWx1ZSYgdmFsdWUpIHsKKyAgICBzd2l0Y2ggKG1UeXBlKSB7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UODoKKyAgICAgICAgICAgIHZhbHVlLmk4ID0gcGFja2V0LmdldEludDgoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQ4OgorICAgICAgICAgICAgdmFsdWUudTggPSBwYWNrZXQuZ2V0VUludDgoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX0lOVDE2OgorICAgICAgICAgICAgdmFsdWUuaTE2ID0gcGFja2V0LmdldEludDE2KCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9VSU5UMTY6CisgICAgICAgICAgICB2YWx1ZS51MTYgPSBwYWNrZXQuZ2V0VUludDE2KCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQzMjoKKyAgICAgICAgICAgIHZhbHVlLmkzMiA9IHBhY2tldC5nZXRJbnQzMigpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDMyOgorICAgICAgICAgICAgdmFsdWUudTMyID0gcGFja2V0LmdldFVJbnQzMigpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UNjQ6CisgICAgICAgICAgICB2YWx1ZS5pNjQgPSBwYWNrZXQuZ2V0SW50NjQoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQ2NDoKKyAgICAgICAgICAgIHZhbHVlLnU2NCA9IHBhY2tldC5nZXRVSW50NjQoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX0lOVDEyODoKKyAgICAgICAgICAgIHBhY2tldC5nZXRJbnQxMjgodmFsdWUuaTEyOCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9VSU5UMTI4OgorICAgICAgICAgICAgcGFja2V0LmdldFVJbnQxMjgodmFsdWUudTEyOCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCAidW5rbm93biB0eXBlICVkIGluIE10cFByb3BlcnR5OjpyZWFkVmFsdWVcbiIsIG1UeXBlKTsKKyAgICB9Cit9CisKK010cFByb3BlcnR5VmFsdWUqIE10cFByb3BlcnR5OjpyZWFkQXJyYXlWYWx1ZXMoTXRwRGF0YVBhY2tldCYgcGFja2V0LCBpbnQmIGxlbmd0aCkgeworICAgIGxlbmd0aCA9IHBhY2tldC5nZXRVSW50MzIoKTsKKyAgICBpZiAobGVuZ3RoID09IDApCisgICAgICAgIHJldHVybiBOVUxMOworICAgIE10cFByb3BlcnR5VmFsdWUqIHJlc3VsdCA9IG5ldyBNdHBQcm9wZXJ0eVZhbHVlW2xlbmd0aF07CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykKKyAgICAgICAgcmVhZFZhbHVlKHBhY2tldCwgcmVzdWx0W2ldKTsKKyAgICByZXR1cm4gcmVzdWx0OworfQorCit9ICAvLyBuYW1lc3BhY2UgYW5kcm9pZApkaWZmIC0tZ2l0IGEvbWVkaWEvbXRwL010cFByb3BlcnR5LmggYi9tZWRpYS9tdHAvTXRwUHJvcGVydHkuaApuZXcgZmlsZSBtb2RlIDEwMDY0N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lIGFuZHJvaWQgeworCitjbGFzcyBNdHBEYXRhUGFja2V0OworCitjbGFzcyBNdHBQcm9wZXJ0eSB7CitwdWJsaWM6CisgICAgTXRwUHJvcGVydHlDb2RlICAgICBtQ29kZTsKKyAgICBNdHBEYXRhVHlwZSAgICAgICAgIG1UeXBlOworICAgIGJvb2wgICAgICAgICAgICAgICAgbVdyaXRlYWJsZTsKKyAgICBNdHBQcm9wZXJ0eVZhbHVlICAgIG1EZWZhdWx0VmFsdWU7CisgICAgTXRwUHJvcGVydHlWYWx1ZSAgICBtQ3VycmVudFZhbHVlOworCisgICAgLy8gZm9yIGFycmF5IHR5cGVzCisgICAgaW50ICAgICAgICAgICAgICAgICBtRGVmYXVsdEFycmF5TGVuZ3RoOworICAgIE10cFByb3BlcnR5VmFsdWUqICAgbURlZmF1bHRBcnJheVZhbHVlczsKKyAgICBpbnQgICAgICAgICAgICAgICAgIG1DdXJyZW50QXJyYXlMZW5ndGg7CisgICAgTXRwUHJvcGVydHlWYWx1ZSogICBtQ3VycmVudEFycmF5VmFsdWVzOworCisgICAgZW51bSB7CisgICAgICAgIGtGb3JtTm9uZSA9IDAsCisgICAgICAgIGtGb3JtUmFuZ2UgPSAxLAorICAgICAgICBrRm9ybUVudW0gPSAyLAorICAgIH07CisgICAgdWludDhfdCAgICAgICAgICAgICBtRm9ybUZsYWc7CisKKyAgICAvLyBmb3IgcmFuZ2UgZm9ybQorICAgIE10cFByb3BlcnR5VmFsdWUgICAgbU1pbmltdW1WYWx1ZTsKKyAgICBNdHBQcm9wZXJ0eVZhbHVlICAgIG1NYXhpbXVtVmFsdWU7CisgICAgTXRwUHJvcGVydHlWYWx1ZSAgICBtU3RlcFNpemU7CisKKyAgICAvLyBmb3IgZW51bSBmb3JtCisgICAgaW50ICAgICAgICAgICAgICAgICBtRW51bUxlbmd0aDsKKyAgICBNdHBQcm9wZXJ0eVZhbHVlKiAgIG1FbnVtVmFsdWVzOworCitwdWJsaWM6CisgICAgICAgICAgICAgICAg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KKyAgICAgICAgICAgIHJldHVybiBzdG9yYWdlOworICAgIH0KKyAgICByZXR1cm4gTlVMTDsKK30KKwordm9pZCBNdHBTZXJ2ZXI6OnNjYW5TdG9yYWdlKCkgeworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbVN0b3JhZ2VzLnNpemUoKTsgaSsrKSB7CisgICAgICAgIE10cFN0b3JhZ2UqIHN0b3JhZ2UgPSAgbVN0b3JhZ2VzW2ldOworICAgICAgICBzdG9yYWdlLT5zY2FuRmlsZXMoKTsKKyAgICB9Cit9CisKK3ZvaWQgTXRwU2VydmVyOjpydW4oKSB7CisgICAgaW50IGZkID0gbUZEOworCisgICAgcHJpbnRmKCJNdHBTZXJ2ZXI6OnJ1biBmZDogJWRcbiIsIGZkKTsKKworICAgIHdoaWxlICgxKSB7CisgICAgICAgIGludCByZXQgPSBtUmVxdWVzdC5yZWFkKGZkKTsKKyAgICAgICAgaWYgKHJldCA8IDApIHsKKyAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCAicmVxdWVzdCByZWFkIHJldHVybmVkICVkLCBlcnJubzogJWRcbiIsIHJldCwgZXJybm8pOworICAgICAgICAgICAgaWYgKGVycm5vID09IEVDQU5DRUxFRCkgeworICAgICAgICAgICAgICAgIC8vIHJldHVybiB0byB0b3Agb2YgbG9vcCBhbmQgd2FpdCBmb3IgbmV4dCBjb21tYW5kCisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBNdHBPcGVyYXRpb25Db2RlIG9wZXJhdGlvbiA9IG1SZXF1ZXN0LmdldE9wZXJhdGlvbkNvZGUoKTsKKyAgICAgICAgTXRwVHJhbnNhY3Rpb25JRCB0cmFuc2FjdGlvbiA9IG1SZXF1ZXN0LmdldFRyYW5zYWN0aW9uSUQoKTsKKworICAgICAgICBwcmludGYoIm9wZXJhdGlvbjogJXNcbiIsIE10cERlYnVnOjpnZXRPcGVyYXRpb25Db2RlTmFtZShvcGVyYXRpb24pKTsKKyAgICAgICAgbVJlcXVlc3QuZHVtcCgpOworCisgICAgICAgIC8vIEZJWE1FIG5lZWQgdG8gZ2VuZXJhbGl6ZSB0aGlzCisgICAgICAgIGJvb2wgZGF0YUluID0gKG9wZXJhdGlvbiA9PSBNVFBfT1BFUkFUSU9OX1NFTkRfT0JKRUNUX0lORk8pOworICAgICAgICBpZiAoZGF0YUluKSB7CisgICAgICAgICAgICBpbnQgcmV0ID0gbURhdGEucmVhZChmZCk7CisgICAgICAgICAgICBpZiAocmV0IDwgMCkgeworICAgICAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCAiZGF0YSByZWFkIHJldHVybmVkICVkLCBlcnJubzogJWRcbiIsIHJldCwgZXJybm8pOworICAgICAgICAgICAgICAgIGlmIChlcnJubyA9PSBFQ0FOQ0VMRUQpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gcmV0dXJuIHRvIHRvcCBvZiBsb29wIGFuZCB3YWl0IGZvciBuZXh0IGNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcHJpbnRmKCJyZWNlaXZlZCBkYXRhOlxuIik7CisgICAgICAgICAgICBtRGF0YS5kdW1wKCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtRGF0YS5yZXNldCgpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGhhbmRsZVJlcXVlc3QoKSkgeworICAgICAgICAgICAgaWYgKCFkYXRhSW4gJiYgbURhdGEuaGFzRGF0YSgpKSB7CisgICAgICAgICAgICAgICAgbURhdGEuc2V0T3BlcmF0aW9uQ29kZShvcGVyYXRpb24pOworICAgICAgICAgICAgICAgIG1EYXRhLnNldFRyYW5zYWN0aW9uSUQodHJhbnNhY3Rpb24pOworICAgICAgICAgICAgICAgIHByaW50Zigic2VuZGluZyBkYXRhOlxuIik7CisgICAgICAgICAgICAgICAgbURhdGEuZHVtcCgpOworICAgICAgICAgICAgICAgIHJldCA9IG1EYXRhLndyaXRlKGZkKTsKKyAgICAgICAgICAgICAgICBpZiAocmV0IDwgMCkgeworICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgInJlcXVlc3Qgd3JpdGUgcmV0dXJuZWQgJWQsIGVycm5vOiAlZFxuIiwgcmV0LCBlcnJubyk7CisgICAgICAgICAgICAgICAgICAgIGlmIChlcnJubyA9PSBFQ0FOQ0VMRUQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJldHVybiB0byB0b3Agb2YgbG9vcCBhbmQgd2FpdCBmb3IgbmV4dCBjb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1SZXNwb25zZS5zZXRUcmFuc2FjdGlvbklEKHRyYW5zYWN0aW9uKTsKKyAgICAgICAgICAgIHByaW50Zigic2VuZGluZyByZXNwb25zZSAlMDRYXG4iLCBtUmVzcG9uc2UuZ2V0UmVzcG9uc2VDb2RlKCkpOworICAgICAgICAgICAgcmV0ID0gbVJlc3BvbnNlLndyaXRlKGZkKTsKKyAgICAgICAgICAgIGlmIChyZXQgPCAwKSB7CisgICAgICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJyZXF1ZXN0IHdyaXRlIHJldHVybmVkICVkLCBlcnJubzogJWRcbiIsIHJldCwgZXJybm8pOworICAgICAgICAgICAgICAgIGlmIChlcnJubyA9PSBFQ0FOQ0VMRUQpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gcmV0dXJuIHRvIHRvcCBvZiBsb29wIGFuZCB3YWl0IGZvciBuZXh0IGNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcHJpbnRmKCJza2lwcGluZyByZXNwb25zZVxuIik7CisgICAgICAgIH0KKyAgICB9Cit9CisKK2Jvb2wgTXRwU2VydmVyOjpoYW5kbGVSZXF1ZXN0KCkgeworICAgIE10cE9wZXJhdGlvbkNvZGUgb3BlcmF0aW9uID0gbVJlcXVlc3QuZ2V0T3BlcmF0aW9uQ29kZSgpOworICAgIE10cFJlc3BvbnNlQ29kZSByZXNwb25zZTsKKworICAgIG1SZXNwb25zZS5yZXNldCgpOworCisgICAgaWYgKG1TZW5kT2JqZWN0SGFuZGxlICE9IGtJbnZhbGlkT2JqZWN0SGFuZGxlICYmIG9wZXJhdGlvbiAhPSBNVFBfT1BFUkFUSU9OX1NFTkRfT0JKRUNUKSB7CisgICAgICAgIC8vIEZJWE1FIC0gbmVlZCB0byBkZWxldGUgbVNlbmRPYmplY3RIYW5kbGUgZnJvbSB0aGUgZGF0YWJhc2UKKyAgICAgICAgZnByaW50ZihzdGRlcnIsICJleHBlY3RlZCBTZW5kT2JqZWN0IGFmdGVyIFNlbmRPYmplY3RJbmZvXG4iKTsKKyAgICAgICAgbVNlbmRPYmplY3RIYW5kbGUgPSBrSW52YWxpZE9iamVjdEhhbmRsZTsKKyAgICB9CisKKyAgICBzd2l0Y2ggKG9wZXJhdGlvbikgeworICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fR0VUX0RFVklDRV9JTkZPOgorICAgICAgICAgICAgcmVzcG9uc2UgPSBkb0dldERldmljZUluZm8oKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fT1BFTl9TRVNTSU9OOgorICAgICAgICAgICAgcmVzcG9uc2UgPSBkb09wZW5TZXNzaW9uKCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfT1BFUkFUSU9OX0NMT1NFX1NFU1NJT046CisgICAgICAgICAgICByZXNwb25zZSA9IGRvQ2xvc2VTZXNzaW9uKCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfT1BFUkFUSU9OX0dFVF9TVE9SQUdFX0lEUzoKKyAgICAgICAgICAgIHJlc3BvbnNlID0gZG9HZXRTdG9yYWdlSURzKCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIGNhc2UgTVRQX09QRVJBVElPTl9HRVRfU1RPUkFHRV9JTkZPOgorICAgICAgICAgICAgcmVzcG9uc2UgPSBkb0dldFN0b3JhZ2VJbmZvKCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfT1BFUkFUSU9OX0dFVF9PQkpFQ1RfUFJPUFNfU1VQUE9SVEVEOgorICAgICAgICAgICAgcmVzcG9uc2UgPSBkb0dldE9iamVjdFByb3BzU3VwcG9ydGVkKCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfT1BFUkFUSU9OX0dFVF9PQkpFQ1RfSEFORExFUzoKKyAgICAgICAgICAgIHJlc3BvbnNlID0gZG9HZXRPYmplY3RIYW5kbGVzKCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfT1BFUkFUSU9OX0dFVF9PQkpFQ1RfUFJPUF9WQUxVRToKKyAgICAgICAgICAgIHJlc3BvbnNlID0gZG9HZXRPYmplY3RQcm9wVmFsdWUoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fR0VUX09CSkVDVF9JTkZPOgorICAgICAgICAgICAgcmVzcG9uc2UgPSBkb0dldE9iamVjdEluZm8oKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fR0VUX09CSkVDVDoKKyAgICAgICAgICAgIHJlc3BvbnNlID0gZG9HZXRPYmplY3QoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fU0VORF9PQkpFQ1RfSU5GTzoKKyAgICAgICAgICAgIHJlc3BvbnNlID0gZG9TZW5kT2JqZWN0SW5mbygpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX09QRVJBVElPTl9TRU5EX09CSkVDVDoKKyAgICAgICAgICAgIHJlc3BvbnNlID0gZG9TZW5kT2JqZWN0KCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfT1BFUkFUSU9OX0RFTEVURV9PQkpFQ1Q6CisgICAgICAgICAgICByZXNwb25zZSA9IGRvRGVsZXRlT2JqZWN0KCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfT1BFUkFUSU9OX0dFVF9PQkpFQ1RfUFJPUF9ERVNDOgorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgcmVzcG9uc2UgPSBNVFBfUkVTUE9OU0VfT1BFUkFUSU9OX05PVF9TVVBQT1JURUQ7CisgICAgICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICBpZiAocmVzcG9uc2UgPT0gTVRQX1JFU1BPTlNFX1RSQU5TQUNUSU9OX0NBTkNFTExFRCkKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIG1SZXNwb25zZS5zZXRSZXNwb25zZUNvZGUocmVzcG9uc2UpOworICAgIHJldHVybiB0cnVlOworfQorCitNdHBSZXNwb25zZUNvZGUgTXRwU2VydmVyOjpkb0dldERldmljZUluZm8oKSB7CisgICAgTXRwU3RyaW5nQnVmZmVyICAgc3RyaW5nOworICAgIGNoYXIgcHJvcF92YWx1ZVtQUk9QRVJUWV9WQUxVRV9NQVhdOworCisgICAgLy8gZmlsbCBpbiBkZXZpY2UgaW5mbworICAgIG1EYXRhLnB1dFVJbnQxNihNVFBfU1RBTkRBUkRfVkVSU0lPTik7CisgICAgbURhdGEucHV0VUludDMyKDYpOyAv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CitjbGFzcyBNdHBTdG9yYWdlIHsKKworcHJpdmF0ZToKKyAgICBNdHBTdG9yYWdlSUQgICAgICAgICAgICBtU3RvcmFnZUlEOworICAgIGNvbnN0IGNoYXIqICAgICAgICAgICAgIG1GaWxlUGF0aDsKKyAgICBNdHBEYXRhYmFzZSogICAgICAgICAgICBtRGF0YWJhc2U7CisgICAgdWludDY0X3QgICAgICAgICAgICAgICAgbU1heENhcGFjaXR5OworCitwdWJsaWM6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwU3RvcmFnZShNdHBTdG9yYWdlSUQgaWQsIGNvbnN0IGNoYXIqIGZpbGVQYXRoLCBNdHBEYXRhYmFzZSogZGIpOworICAgIHZpcnR1YWwgICAgICAgICAgICAgICAgIH5NdHBTdG9yYWdlKCk7CisKKyAgICBpbmxpbmUgTXRwU3RvcmFnZUlEICAgICBnZXRTdG9yYWdlSUQoKSBjb25zdCB7IHJldHVybiBtU3RvcmFnZUlEOyB9CisgICAgaW50ICAgICAgICAgICAgICAgICAgICAgZ2V0VHlwZSgpIGNvbnN0OworICAgIGludCAgICAgICAgICAgICAgICAgICAgIGdldEZpbGVTeXN0ZW1UeXBlKCkgY29uc3Q7CisgICAgaW50ICAgICAgICAgICAgICAgICAgICAgZ2V0QWNjZXNzQ2FwYWJpbGl0eSgpIGNvbnN0OworICAgIHVpbnQ2NF90ICAgICAgICAgICAgICAgIGdldE1heENhcGFjaXR5KCk7CisgICAgdWludDY0X3QgICAgICAgICAgICAgICAgZ2V0RnJlZVNwYWNlKCk7CisgICAgY29uc3QgY2hhciogICAgICAgICAgICAgZ2V0RGVzY3JpcHRpb24oKSBjb25zdDsKKyAgICBpbmxpbmUgY29uc3QgY2hhciogICAgICBnZXRQYXRoKCkgY29uc3QgeyByZXR1cm4gbUZpbGVQYXRoOyB9CisKKyAgICBib29sICAgICAgICAgICAgICAgICAgICBzY2FuRmlsZXMoKTsKK307CisKK307IC8vIG5hbWVzcGFjZSBhbmRyb2lkCisKK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1wbGllZC4KKyAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgorICovCisKKyNpZm5kZWYgX01UUF9TVE9SQUdFX0lORk9fSAorI2RlZmluZSBfTVRQX1NUT1JBR0VfSU5GT19ICisKKyNpbmNsdWRlICJNdHBUeXBlcy5oIgorCituYW1lc3BhY2UgYW5kcm9pZCB7CisKK2NsYXNzIE10cERhdGFQYWNrZXQ7CisKK2NsYXNzIE10cFN0b3JhZ2VJbmZvIHsKK3B1YmxpYzoKKyAgICBNdHBTdG9yYWdlSUQgICAgICAgIG1TdG9yYWdlSUQ7CisgICAgdWludDE2X3QgICAgICAgICAgICBtU3RvcmFnZVR5cGU7CisgICAgdWludDE2X3QgICAgICAgICAgICBtRmlsZVN5c3RlbVR5cGU7CisgICAgdWludDE2X3QgICAgICAgICAgICBtQWNjZXNzQ2FwYWJpbGl0eTsKKyAgICB1aW50NjRfdCAgICAgICAgICAgIG1NYXhDYXBhY2l0eTsKKyAgICB1aW50NjRfdCAgICAgICAgICAgIG1GcmVlU3BhY2VCeXRlczsKKyAgICB1aW50MzJfdCAgICAgICAgICAgIG1GcmVlU3BhY2VPYmplY3RzOworICAgIGNoYXIqICAgICAgICAgICAgICAgbVN0b3JhZ2VEZXNjcmlwdGlvbjsKKyAgICBjaGFyKiAgICAgICAgICAgICAgIG1Wb2x1bWVJZGVudGlmaWVyOworCitwdWJsaWM6CisgICAgICAgICAgICAgICAgICAgICAgICBNdHBTdG9yYWdlSW5mbyhNdHBTdG9yYWdlSUQgaWQpOworICAgIHZpcnR1YWwgICAgICAgICAgICAgfk10cFN0b3JhZ2VJbmZvKCk7CisKKyAgICB2b2lkICAgICAgICAgICAgICAgIHJlYWQoTXRwRGF0YVBhY2tldCYgcGFja2V0KTsKKworICAgIHZvaWQgICAgICAg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ICAgbWVtY3B5KG1CdWZmZXIsIHNyYywgbGVuZ3RoKTsKKworICAgIC8vIGNvdW50IHRoZSBjaGFyYWN0ZXJzCisgICAgaW50IGNvdW50ID0gMDsKKyAgICBjaGFyIGNoOworICAgIHdoaWxlICgoY2ggPSAqc3JjKyspICE9IDApIHsKKyAgICAgICAgaWYgKChjaCAmIDB4ODApID09IDApIHsKKyAgICAgICAgICAgIC8vIHNpbmdsZSBieXRlIGNoYXJhY3RlcgorICAgICAgICB9IGVsc2UgaWYgKChjaCAmIDB4RTApID09IDB4QzApIHsKKyAgICAgICAgICAgIC8vIHR3byBieXRlIGNoYXJhY3RlcgorICAgICAgICAgICAgaWYgKCEgKnNyYysrKSB7CisgICAgICAgICAgICAgICAgLy8gbGFzdCBjaGFyYWN0ZXIgd2FzIHRydW5jYXRlZCwgc28gaWdub3JlIGxhc3QgYnl0ZQorICAgICAgICAgICAgICAgIGxlbmd0aC0tOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgaWYgKChjaCAmIDB4RjApID09IDB4RTApIHsKKyAgICAgICAgICAgIC8vIDMgYnl0ZSBjaGFyCisgICAgICAgICAgICBpZiAoISAqc3JjKyspIHsKKyAgICAgICAgICAgICAgICAvLyBsYXN0IGNoYXJhY3RlciB3YXMgdHJ1bmNhdGVkLCBzbyBpZ25vcmUgbGFzdCBieXRlCisgICAgICAgICAgICAgICAgbGVuZ3RoLS07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoISAqc3JjKyspIHsKKyAgICAgICAgICAgICAgICAvLyBsYXN0IGNoYXJhY3RlciB3YXMgdHJ1bmNhdGVkLCBzbyBpZ25vcmUgbGFzdCB0d28gYnl0ZXMKKyAgICAgICAgICAgICAgICBsZW5ndGggLT0gMjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBjb3VudCsrOworICAgIH0KKworICAgIG1CeXRlQ291bnQgPSBsZW5ndGggKyAxOworICAgIG1CdWZmZXJbbGVuZ3RoXSA9IDA7CisgICAgbUNoYXJDb3VudCA9IGNvdW50OworfQorCit2b2lkIE10cFN0cmluZ0J1ZmZlcjo6cmVhZEZyb21QYWNrZXQoTXRwRGF0YVBhY2tldCogcGFja2V0KSB7CisgICAgaW50IGNvdW50ID0gcGFja2V0LT5nZXRVSW50OCgpOworICAgIHVpbnQ4X3QqIGRlc3QgPSBtQnVmZmVyOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgeworICAgICAgICB1aW50MTZfdCBjaCA9IHBhY2tldC0+Z2V0VUludDE2KCk7CisgICAgICAgIGlmIChjaCA+PSAweDA4MDApIHsKKyAgICAgICAgICAgICpkZXN0KysgPSAodWludDhfdCkoMHhFMCB8IChjaCA+PiAxMikpOworICAgICAgICAgICAgKmRlc3QrKyA9ICh1aW50OF90KSgweDgwIHwgKChjaCA+PiA2KSAmIDB4M0YpKTsKKyAgICAgICAgICAgICpkZXN0KysgPSAodWludDhfdCkoMHg4MCB8IChjaCAmIDB4M0YpKTsKKyAgICAgICAgfSBlbHNlIGlmIChjaCA+PSAweDgwKSB7CisgICAgICAgICAgICAqZGVzdCsrID0gKHVpbnQ4X3QpKDB4QzAgfCAoY2ggPj4gNikpOworICAgICAgICAgICAgKmRlc3QrKyA9ICh1aW50OF90KSgweDgwIHwgKGNoICYgMHgzRikpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgKmRlc3QrKyA9IGNoOworICAgICAgICB9CisgICAgfQorICAgICpkZXN0KysgPSAwOworICAgIG1DaGFyQ291bnQgPSBjb3VudDsKKyAgICBtQnl0ZUNvdW50ID0gZGVzdCAtIG1CdWZmZXI7Cit9CisKK3ZvaWQgTXRwU3RyaW5nQnVmZmVyOjp3cml0ZVRvUGFja2V0KE10cERhdGFQYWNrZXQqIHBhY2tldCkgY29uc3QgeworICAgIGludCBjb3VudCA9IG1DaGFyQ291bnQ7CisgICAgY29uc3QgdWludDhfdCogc3JjID0gbUJ1ZmZlcjsKKyAgICBwYWNrZXQtPnB1dFVJbnQ4KGNvdW50KTsKKworICAgIC8vIGV4cGFuZCB1dGY4IHRvIDE2IGJpdCBjaGFycworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgeworICAgICAgICB1aW50MTZfdCBjaDsKKyAgICAgICAgdWludDE2X3QgY2gxID0gKnNyYysrOworICAgICAgICBpZiAoKGNoMSAmIDB4ODApID09IDApIHsKKyAgICAgICAgICAgIC8vIHNpbmdsZSBieXRlIGNoYXJhY3RlcgorICAgICAgICAgICAgY2ggPSBjaDE7CisgICAgICAgIH0gZWxzZSBpZiAoKGNoMSAmIDB4RTApID09IDB4QzApIHsKKyAgICAgICAgICAgIC8vIHR3byBieXRlIGNoYXJhY3RlcgorICAgICAgICAgICAgdWludDE2X3QgY2gyID0gKnNyYysrOworICAgICAgICAgICAgY2ggPSAoKGNoMSAmIDB4MUYpIDw8IDYpIHwgKGNoMiAmIDB4M0YpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gdGhyZWUgYnl0ZSBjaGFyYWN0ZXIKKyAgICAgICAgICAgIHVpbnQxNl90IGNoMiA9ICpzcmMrKzsKKyAgICAgICAgICAgIHVpbnQxNl90IGNoMyA9ICpzcmMrKzsKKyAgICAgICAgICAgIGNoID0gKChjaDEgJiAweDBGKSA8PCAxMikgfCAoKGNoMiAmIDB4M0YpIDw8IDYpIHwgKGNoMyAmIDB4M0YpOworICAgICAgICB9CisgICAgICAgIHBhY2tldC0+cHV0VUludDE2KGNoKTsKKyAgICB9Cit9CisKK30gIC8vIG5hbWVzcGFjZSBhbmRyb2lkCmRpZmYgLS1naXQgYS9tZWRpYS9tdHAvTXRwU3RyaW5nQnVmZmVyLmggYi9tZWRpYS9tdHAvTXRwU3RyaW5nQnVmZmVyLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQ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GFjZSBhbmRyb2lkIHsKKworY2xhc3MgTXRwRGF0YVBhY2tldDsKKworLy8gUmVwcmVzZW50cyBhIHV0Zjggc3RyaW5nLCB3aXRoIGEgbWF4aW11bSBvZiAyNTUgY2hhcmFjdGVycworY2xhc3MgTXRwU3RyaW5nQnVmZmVyIHsKKworcHJpdmF0ZToKKyAgICAvLyBtYXhpbXVtIDMgYnl0ZXMvY2hhcmFjdGVyLCB3aXRoIDEgZXh0cmEgZm9yIHplcm8gdGVybWluYXRpb24KKyAgICB1aW50OF90ICAgICAgICAgbUJ1ZmZlclsyNTUgKiAzICsgMV07CisgICAgaW50ICAgICAgICAgICAgIG1DaGFyQ291bnQ7CisgICAgaW50ICAgICAgICAgICAgIG1CeXRlQ291bnQ7CisKK3B1YmxpYzoKKyAgICAgICAgICAgICAgICAgICAgTXRwU3RyaW5nQnVmZmVyKCk7CisgICAgICAgICAgICAgICAgICAgIE10cFN0cmluZ0J1ZmZlcihjb25zdCBjaGFyKiBzcmMpOworICAgICAgICAgICAgICAgICAgICBNdHBTdHJpbmdCdWZmZXIoY29uc3QgTXRwU3RyaW5nQnVmZmVyJiBzcmMpOworICAgIHZpcnR1YWwgICAgICAgICB+TXRwU3RyaW5nQnVmZmVyKCk7CisKKyAgICB2b2lkICAgICAgICAgICAgc2V0KGNvbnN0IGNoYXIqIHNyYyk7CisKKyAgICB2b2lkICAgICAgICAgICAgcmVhZEZyb21QYWNrZXQoTXRwRGF0YVBhY2tldCogcGFja2V0KTsKKyAgICB2b2lkICAgICAgICAgICAgd3JpdGVUb1BhY2tldChNdHBEYXRhUGFja2V0KiBwYWNrZXQpIGNvbnN0OworCisgICAgaW5saW5lIGludCAgICAgIGdldENoYXJDb3VudCgpIGNvbnN0IHsgcmV0dXJuIG1DaGFyQ291bnQ7IH0KKyAgICBpbmxpbmUgaW50ICAgICAgZ2V0Qnl0ZUNvdW50KCkgY29uc3QgeyByZXR1cm4gbUJ5dGVDb3VudDsgfQorCisJaW5saW5lIG9w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yIGFuIG9iamVjdCBpcyBkZWxldGVkLgorLy8gdmFsdWVzIDB4MDAwMDAwMDAgYW5kIDB4RkZGRkZGRkYgYXJlIHJlc2VydmVkIGZvciBzcGVjaWFsIHB1cnBvc2VzLgordHlwZWRlZiB1aW50MzJfdCBNdHBPYmplY3RIYW5kbGU7CisKK3R5cGVkZWYgdW5pb24gTXRwUHJvcGVydHlWYWx1ZSB7CisgICAgaW50OF90ICAgICAgICAgIGk4OworICAgIHVpbnQ4X3QgICAgICAgICB1ODsKKyAgICBpbnQxNl90ICAgICAgICAgaTE2OworICAgIHVpbnQxNl90ICAgICAgICB1MTY7CisgICAgaW50MzJfdCAgICAgICAgIGkzMjsKKyAgICB1aW50MzJfdCAgICAgICAgdTMyOworICAgIGludDY0X3QgICAgICAgICBpNjQ7CisgICAgdWludDY0X3QgICAgICAgIHU2NDsKKyAgICBpbnQxMjhfdCAgICAgICAgaTEyODsKKyAgICB1aW50MTI4X3QgICAgICAgdTEyODsKKyAgICBjaGFyKiAgICAgICAgICAgc3RyOworfTsKKworLy8gU3BlY2lhbCB2YWx1ZXMKKyNkZWZpbmUgTVRQX1BBUkVOVF9ST09UICAgICAgICAgMHhGRkZGRkZGRiAgICAgICAvLyBwYXJlbnQgaXMgcm9vdCBvZiB0aGUgc3RvcmFnZQorI2RlZmluZSBrSW52YWxpZE9iamVjdEhhbmRsZSAgICAweEZGRkZGRkZGCisKKy8vIE10cE9iamVjdEhhbmRsZSBiaXRzIGFuZCBtYXNrcworI2RlZmluZSBrT2JqZWN0SGFuZGxlTWFya0JpdCAgICAgICAgMHg4MDAwMDAwMCAgICAgIC8vIHVzZWQgZm9yIG1hcmsgJiBzd2VlcCBieSBNdHBNZWRpYVNjYW5uZXIKKyNkZWZpbmUga09iamVjdEhhbmRsZVRhYmxlTWFzayAgICAgIDB4NzAwMDAwMDAgICAgICAvLyBtYXNrIGZvciBvYmplY3QgdGFibGUKKyNkZWZpbmUga09iamVjdEhhbmRsZVRhYmxlRmlsZ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ZS4KKyAqLworCisjaWZuZGVmIF9TUUxJVEVfU1RBVEVNRU5UX0gKKyNkZWZpbmUgX1NRTElURV9TVEFURU1FTlRfSAorCisjaW5jbHVkZSA8c3RkaW50Lmg+CisKK3R5cGVkZWYgc3RydWN0IHNxbGl0ZTMgc3FsaXRlMzsKK3R5cGVkZWYgc3RydWN0IHNxbGl0ZTNfc3RtdCBzcWxpdGUzX3N0bXQ7CisKK25hbWVzcGFjZSBhbmRyb2lkIHsKKworY2xhc3MgU3FsaXRlRGF0YWJhc2U7CisKK2NsYXNzIFNxbGl0ZVN0YXRlbWVudCB7Citwcml2YXRlOgorICAgIHNxbGl0ZTMqICAgICAgICBtRGF0YWJhc2VIYW5kbGU7CisgICAgc3FsaXRlM19zdG10KiAgIG1TdGF0ZW1lbnQ7CisgICAgYm9vbCAgICAgICAgICAgIG1Eb25lOworCitwdWJsaWM6CisgICAgICAgICAgICAgICAgICAgIFNxbGl0ZVN0YXRlbWVudChTcWxpdGVEYXRhYmFzZSogZGIpOworICAgIHZpcnR1YWwgICAgICAgICB+U3FsaXRlU3RhdGVtZW50KCk7CisKKyAgICBib29sICAgICAgICAgICAgcHJlcGFyZShjb25zdCBjaGFyKiBzcWwpOworICAgIGJvb2wgICAgICAgICAgICBzdGVwKCk7CisgICAgdm9pZCAgICAgICAgICAgIHJlc2V0KCk7CisgICAgdm9pZCAgICAgICAgICAgIGZpbmFsaXplKCk7CisKKyAgICB2b2lkICAgICAgICAgICAgYmluZChpbnQgY29sdW1uLCBpbnQgdmFsdWUpOworICAgIHZvaWQgICAgICAgICAgICBiaW5kKGludCBjb2x1bW4sIGNvbnN0IGNoYXIqIHZhbHVlKTsKKworICAgIGludCAgICAgICAgICAgICBnZXRDb2x1bW5JbnQoaW50IGNvbHVtbik7CisgICAgaW50NjRfdCAgICAgICAgIGdldENvbHVtbkludDY0KGludCBjb2x1bW4pOworICAgIGNvbnN0IGNoYXIqICAgICBnZXRDb2x1bW5TdHJpbmcoaW50IGNvbHV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lLWxlbmd0aCBVbmljb2RlIHN0cmluZworCisvLyBNVFAgRm9ybWF0IENvZGVzCisjZGVmaW5lIE1UUF9GT1JNQVRfVU5ERUZJTkVEICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwMCAgIC8vIFVuZGVmaW5lZCBvYmplY3QKKyNkZWZpbmUgTVRQX0ZPUk1BVF9BU1NPQ0lBVElPTiAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDAxICAgLy8gQXNzb2NpYXRpb24gKGZvciBleGFtcGxlLCBhIGZvbGRlcikKKyNkZWZpbmUgTVRQX0ZPUk1BVF9TQ1JJUFQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDAyICAgLy8gRGV2aWNlIG1vZGVsLXNwZWNpZmljIHNjcmlwdAorI2RlZmluZSBNVFBfRk9STUFUX0VYRUNVVEFCTEUgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDMgICAvLyBEZXZpY2UgbW9kZWwtc3BlY2lmaWMgYmluYXJ5IGV4ZWN1dGFibGUKKyNkZWZpbmUgTVRQX0ZPUk1BVF9URVhUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDA0ICAgLy8gVGV4dCBmaWxlCisjZGVmaW5lIE1UUF9GT1JNQVRfSFRNTCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwNSAgIC8vIEh5cGVydGV4dCBNYXJrdXAgTGFuZ3VhZ2UgZmlsZSAodGV4dCkKKyNkZWZpbmUgTVRQX0ZPUk1BVF9EUE9GICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDA2ICAgLy8gRGlnaXRhbCBQcmludCBPcmRlciBGb3JtYXQgZmlsZSAodGV4dCkKKyNkZWZpbmUgTVRQX0ZPUk1BVF9BSUZGICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDA3ICAgLy8gQXVkaW8gY2xpcAorI2RlZmluZSBNVFBfRk9STUFUX1dBViAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDggICAvLyBBdWRpbyBjbGlwCisjZGVmaW5lIE1UUF9GT1JNQVRfTVAzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwOSAgIC8vIEF1ZGlvIGNsaXAKKyNkZWZpbmUgTVRQX0ZPUk1BVF9BVkkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDBBICAgLy8gVmlkZW8gY2xpcAorI2RlZmluZSBNVFBfRk9STUFUX01QRUcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMEIgICAvLyBWaWRlbyBjbGlwCisjZGVmaW5lIE1UUF9GT1JNQVRfQVNGICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwQyAgIC8vIE1pY3Jvc29mdCBBZHZhbmNlZCBTdHJlYW1pbmcgRm9ybWF0ICh2aWRlbykKKyNkZWZpbmUgTVRQX0ZPUk1BVF9ERUZJTkVEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODAwICAgLy8gVW5rbm93biBpbWFnZSBvYmplY3QKKyNkZWZpbmUgTVRQX0ZPUk1BVF9FWElGX0pQRUcgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODAxICAgLy8gRXhjaGFuZ2VhYmxlIEZpbGUgRm9ybWF0LCBKRUlEQSBzdGFuZGFyZAorI2RlZmluZSBNVFBfRk9STUFUX1RJRkZfRVAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MDIgICAvLyBUYWcgSW1hZ2UgRmlsZSBGb3JtYXQgZm9yIEVsZWN0cm9uaWMgUGhvdG9ncmFwaHkKKyNkZWZpbmUgTVRQX0ZPUk1BVF9GTEFTSFBJWCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODAzICAgLy8gU3RydWN0dXJlZCBTdG9yYWdlIEltYWdlIEZvcm1hdAorI2RlZmluZSBNVFBfRk9STUFUX0JNUCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MDQgICAvLyBNaWNyb3NvZnQgV2luZG93cyBCaXRtYXAgZmlsZQorI2RlZmluZSBNVFBfRk9STUFUX0NJRkYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MDUgICAvLyBDYW5vbiBDYW1lcmEgSW1hZ2UgRmlsZSBGb3JtYXQKKyNkZWZpbmUgTVRQX0ZPUk1BVF9HSUYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODA3ICAgLy8gR3JhcGhpY3MgSW50ZXJjaGFuZ2UgRm9ybWF0CisjZGVmaW5lIE1UUF9GT1JNQVRfSkZJRiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzgwOCAgIC8vIEpQRUcgRmlsZSBJbnRlcmNoYW5nZSBGb3JtYXQKKyNkZWZpbmUgTVRQX0ZPUk1BVF9DRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODA5ICAgLy8gUGhvdG9DRCBJbWFnZSBQYWMKKyNkZWZpbmUgTVRQX0ZPUk1BVF9QSUNUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODBBICAgLy8gUXVpY2tkcmF3IEltYWdlIEZvcm1hdAorI2RlZmluZSBNVFBfRk9STUFUX1BORyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MEIgICAvLyBQb3J0YWJsZSBOZXR3b3JrIEdyYXBoaWNzCisjZGVmaW5lIE1UUF9GT1JNQVRfVElGRiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzgwRCAgIC8vIFRhZyBJbWFnZSBGaWxlIEZvcm1hdAorI2RlZmluZSBNVFBfRk9STUFUX1RJRkZfSVQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MEUgICAvLyBUYWcgSW1hZ2UgRmlsZSBGb3JtYXQgZm9yIEluZm9ybWF0aW9uIFRlY2hub2xvZ3kgKGdyYXBoaWMgYXJ0cykKKyNkZWZpbmUgTVRQX0ZPUk1BVF9KUDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODBGICAgLy8gSlBFRzIwMDAgQmFzZWxpbmUgRmlsZSBGb3JtYXQKKyNkZWZpbmUgTVRQX0ZPUk1BVF9KUFggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODEwICAgLy8gSlBFRzIwMDAgRXh0ZW5kZWQgRmlsZSBGb3JtYXQKKyNkZWZpbmUgTVRQX0ZPUk1BVF9VTkRFRklORURfRklSTVdBUkUgICAgICAgICAgICAgICAgICAgMHhCODAyCisjZGVmaW5lIE1UUF9GT1JNQVRfV0lORE9XU19JTUFHRV9GT1JNQVQgICAgICAgICAgICAgICAgIDB4Qjg4MQorI2RlZmluZSBNVFBfRk9STUFUX1VOREVGSU5FRF9BVURJTyAgICAgICAgICAgICAgICAgICAgICAweEI5MDAKKyNkZWZpbmUgTVRQX0ZPUk1BVF9XTUEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhCOTAxCisjZGVmaW5lIE1UUF9GT1JNQVRfT0dHICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4QjkwMgorI2RlZmluZSBNVFBfRk9STUFUX0FBQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEI5MDMKKyNkZWZpbmUgTVRQX0ZPUk1BVF9BVURJQkxFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhCOTA0CisjZGVmaW5lIE1UUF9GT1JNQVRfRkxBQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4QjkwNgorI2RlZmluZSBNVFBfRk9STUFUX1VOREVGSU5FRF9WSURFTyAgICAgICAgICAgICAgICAgICAgICAweEI5ODAKKyNkZWZpbmUgTVRQX0ZPUk1BVF9XTVYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhCOTgxCisjZGVmaW5lIE1UUF9GT1JNQVRfTVA0X0NPTlRB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VRfQUJTVFJBQ1RfTUVTU0FHRV9GT0xERVIgICAgICAgICAgICAgIDB4QkEwNworI2RlZmluZSBNVFBfRk9STUFUX0FCU1RSQUNUX0NIQVBURVJFRF9QUk9EVUNUSU9OICAgICAgICAweEJBMDgKKyNkZWZpbmUgTVRQX0ZPUk1BVF9BQlNUUkFDVF9BVURJT19QTEFZTElTVCAgICAgICAgICAgICAgMHhCQTA5CisjZGVmaW5lIE1UUF9GT1JNQVRfQUJTVFJBQ1RfVklERU9fUExBWUxJU1QgICAgICAgICAgICAgIDB4QkEwQQorI2RlZmluZSBNVFBfRk9STUFUX0FCU1RSQUNUX01FRElBQ0FTVCAgICAgICAgICAgICAgICAgICAweEJBMEIgLy8gRm9yIHVzZSB3aXRoIG1lZGlhY2FzdHM7IHJlZmVyZW5jZXMgbXVsdGltZWRpYSBlbmNsb3N1cmVzIG9mIFJTUyBmZWVkcyBvciBlcGlzb2RpYyBjb250ZW50CisjZGVmaW5lIE1UUF9GT1JNQVRfV1BMX1BMQVlMSVNUICAgICAgICAgICAgICAgICAgICAgICAgIDB4QkExMAorI2RlZmluZSBNVFBfRk9STUFUX00zVV9QTEFZTElTVCAgICAgICAgICAgICAgICAgICAgICAgICAweEJBMTEKKyNkZWZpbmUgTVRQX0ZPUk1BVF9NUExfUExBWUxJU1QgICAgICAgICAgICAgICAgICAgICAgICAgMHhCQTEyCisjZGVmaW5lIE1UUF9GT1JNQVRfQVNYX1BMQVlMSVNUICAgICAgICAgICAgICAgICAgICAgICAgIDB4QkExMworI2RlZmluZSBNVFBfRk9STUFUX1BMU19QTEFZTElTVCAgICAgICAgICAgICAgICAgICAgICAgICAweEJBMTQKKyNkZWZpbmUgTVRQX0ZPUk1BVF9VTkRFRklORURfRE9DVU1FTlQgICAgICAgICAgICAgICAgICAgMHhCQTgwCisjZGVmaW5lIE1UUF9GT1JNQVRfQUJTVFJBQ1RfRE9DVU1FTlQgICAgICAgICAgICAgICAgICAgIDB4QkE4MQorI2RlZmluZSBNVFBfRk9STUFUX1hNTF9ET0NVTUVOVCAgICAgICAgICAgICAgICAgICAgICAgICAweEJBODIKKyNkZWZpbmUgTVRQX0ZPUk1BVF9NU19XT1JEX0RPQ1VNRU5UICAgICAgICAgICAgICAgICAgICAgMHhCQTgzCisjZGVmaW5lIE1UUF9GT1JNQVRfTUhUX0NPTVBJTEVEX0hUTUxfRE9DVU1FTlQgICAgICAgICAgIDB4QkE4NAorI2RlZmluZSBNVFBfRk9STUFUX01TX0VYQ0VMX1NQUkVBRFNIRUVUICAgICAgICAgICAgICAgICAweEJBODUKKyNkZWZpbmUgTVRQX0ZPUk1BVF9NU19QT1dFUlBPSU5UX1BSRVNFTlRBVElPTiAgICAgICAgICAgMHhCQTg2CisjZGVmaW5lIE1UUF9GT1JNQVRfVU5ERUZJTkVEX01FU1NBR0UgICAgICAgICAgICAgICAgICAgIDB4QkIwMAorI2RlZmluZSBNVFBfRk9STUFUX0FCU1RSQUNUX01FU1NTQUdFICAgICAgICAgICAgICAgICAgICAweEJCMDEKKyNkZWZpbmUgTVRQX0ZPUk1BVF9VTkRFRklORURfQ09OVEFDVCAgICAgICAgICAgICAgICAgICAgMHhCQjgwCisjZGVmaW5lIE1UUF9GT1JNQVRfQUJTVFJBQ1RfQ09OVEFDVCAgICAgICAgICAgICAgICAgICAgIDB4QkI4MQorI2RlZmluZSBNVFBfRk9STUFUX1ZDQVJEXzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEJCODIKKworLy8gTVRQIE9iamVjdCBQcm9wZXJ0eSBDb2RlcworI2RlZmluZSBNVFBfUFJPUEVSVFlfU1RPUkFHRV9JRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzAxCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9PQkpFQ1RfRk9STUFUICAgICAgICAgICAgICAgICAgICAgICAgICAweERDMDIKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BST1RFQ1RJT05fU1RBVFVTICAgICAgICAgICAgICAgICAgICAgIDB4REMwMworI2RlZmluZSBNVFBfUFJPUEVSVFlfT0JKRUNUX1NJWkUgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzA0CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9BU1NPQ0lBVElPTl9UWVBFICAgICAgICAgICAgICAgICAgICAgICAweERDMDUKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0FTU09DSUFUSU9OX0RFU0MgICAgICAgICAgICAgICAgICAgICAgIDB4REMwNgorI2RlZmluZSBNVFBfUFJPUEVSVFlfT0JKRUNUX0ZJTEVfTkFNRSAgICAgICAgICAgICAgICAgICAgICAgMHhEQzA3CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9EQVRFX0NSRUFURUQgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDMDgKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0RBVEVfTU9ESUZJRUQgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REMwOQorI2RlZmluZSBNVFBfUFJPUEVSVFlfS0VZV09SRFMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzBBCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QQVJFTlRfT0JKRUNUICAgICAgICAgICAgICAgICAgICAgICAgICAweERDMEIKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0FMTE9XRURfRk9MREVSX0NPTlRFTlRTICAgICAgICAgICAgICAgIDB4REMwQworI2RlZmluZSBNVFBfUFJPUEVSVFlfSElEREVOICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzBECisjZGVmaW5lIE1UUF9QUk9QRVJUWV9TWVNURU1fT0JKRUNUICAgICAgICAgICAgICAgICAgICAgICAgICAweERDMEUKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BFUlNJU1RFTlRfVUlEICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0MQorI2RlZmluZSBNVFBfUFJPUEVSVFlfU1lOQ19JRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzQyCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QUk9QRVJUWV9CQUcgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNDMKKyNkZWZpbmUgTVRQX1BST1BFUlRZX05BTUUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0NAorI2RlZmluZSBNVFBfUFJPUEVSVFlfQ1JFQVRFRF9CWSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzQ1CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9BUlRJU1QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNDYKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0RBVEVfQVVUSE9SRUQgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0NworI2RlZmluZSBNVFBfUFJPUEVSVFlfREVTQ1JJUFRJT04gICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzQ4CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9VUkxfUkVGRVJFTkNFICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNDkKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0xBTkdVQUdFX0xPQ0FMRSAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0QQorI2RlZmluZSBNVFBfUFJPUEVSVFlfQ09QWVJJR0hUX0lORk9STUFUSU9OICAgICAgICAgICAgICAgICAgMHhEQzRCCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9TT1VSQ0UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNEMKKyNkZWZpbmUgTVRQX1BST1BFUlRZX09SSUdJTl9MT0NBVElPTiAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0RAorI2RlZmluZSBNVFBfUFJPUEVSVFlfREFURV9BRERFRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzRFCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9OT05fQ09OU1VNQUJMRSAgICAgICAgICAgICAgICAgICAgICAgICAweERDNEYKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0NPUlJVUFRfVU5QTEFZQUJMRSAgICAgICAgICAgICAgICAgICAgIDB4REM1MAorI2RlZmluZSBNVFBfUFJPUEVSVFlfUFJPRFVDRVJfU0VSSUFMX05VTUJFUiAgICAgICAgICAgICAgICAgMHhEQzUxCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9SRVBSRVNFTlRBVElWRV9TQU1QTEVfRk9STUFUICAgICAgICAgICAweERDODEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1JFUFJFU0VOVEFUSVZFX1NBTVBMRV9TSVpFICAgICAgICAgICAgIDB4REM4MgorI2RlZmluZSBNVFBfUFJPUEVSVFlfUkVQUkVTRU5UQVRJVkVfU0FNUExFX0hFSUdIVCAgICAgICAgICAgMHhEQzgzCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9SRVBSRVNFTlRBVElWRV9TQU1QTEVfV0lEVEggICAgICAgICAgICAweERDODQKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1JFUFJFU0VOVEFUSVZFX1NBTVBMRV9EVVJBVElPTiAgICAgICAgIDB4REM4NQorI2RlZmluZSBNVFBfUFJPUEVSVFlfUkVQUkVTRU5UQVRJVkVfU0FNUExFX0RBVEEgICAgICAgICAgICAgMHhEQzg2CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9XSURUSCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDODcKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0hFSUdIVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM4OAorI2RlZmluZSBNVFBfUFJPUEVSVFlfRFVSQVRJT04gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzg5CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9SQVRJTkcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOEEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1RSQUNLICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM4QgorI2RlZmluZSBNVFBfUFJPUEVSVFlfR0VOUkUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzhDCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9DUkVESVRTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOEQKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0xZUklDUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM4RQorI2RlZmluZSBNVFBfUFJPUEVSVFlfU1VCU0NSSVBUSU9OX0NPTlRFTlRfSUQgICAgICAgICAgICAgICAgMHhEQzhGCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QUk9EVUNFRF9CWSAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOTAKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1VTRV9DT1VOVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5MQorI2RlZmluZSBNVFBfUFJPUEVSVFlfU0tJUF9DT1VOVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzkyCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9MQVNUX0FDQ0VTU0VEICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOTMKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BBUkVOVEFMX1JBVElORyAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5NAorI2RlZmluZSBNVFBfUFJPUEVSVFlfTUVUQV9HRU5SRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzk1CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9DT01QT1NFUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOTYKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0VGRkVDVElWRV9SQVRJTkcgICAgICAgICAgICAgICAgICAgICAgIDB4REM5NworI2RlZmluZSBNVFBfUFJPUEVSVFlfU1VCVElUTEUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzk4CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9PUklHSU5BTF9SRUxFQVNFX0RBVEUgICAgICAgICAgICAgICAgICAweERDOTkKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0FMQlVNX05BTUUgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5QQorI2RlZmluZSBNVFBfUFJPUEVSVFlfQUxCVU1fQVJUSVNUICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzlCCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9NT09EICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOUMKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0RSTV9TVEFUVVMgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5RAorI2RlZmluZSBNVFBfUFJPUEVSVFlfU1VCX0RFU0NSSVBUSU9OICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzlFCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9JU19DUk9QUEVEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDRDEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0lTX0NPTE9VUl9DT1JSRUNURUQgICAgICAgICAgICAgICAgICAgIDB4RENEMgorI2RlZmluZSBNVFBfUFJPUEVSVFlfSU1BR0VfQklUX0RFUFRIICAgICAgICAgICAgICAgICAgICAgICAgMHhEQ0QzCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9GX05VTUJFUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDRDQKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0VYUE9TVVJFX1RJTUUgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RENENQorI2RlZmluZSBNVFBfUFJPUEVSVFlfRVhQT1NVUkVfSU5ERVggICAgICAgICAgICAgICAgICAgICAgICAgMHhEQ0Q2CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9UT1RBTF9CSVRSQVRFICAgICAgICAgICAgICAgICAgICAgICAgICAweERFOTEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0JJVFJBVEVfVFlQRSAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REU5MgorI2RlZmluZSBNVFBfUFJPUEVSVFlfU0FNUExFX1JBVEUgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERTkzCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9OVU1CRVJfT0ZfQ0hBTk5FTFMgICAgICAgICAgICAgICAgICAgICAweERFOTQKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0FVRElPX0JJVF9ERVBUSCAgICAgICAgICAgICAgICAgICAgICAgIDB4REU5NQorI2RlZmluZSBNVFBfUFJPUEVSVFlfU0NBTl9UWVBFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERTk3CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9BVURJT19XQVZFX0NPREVDICAgICAgICAgICAgICAgICAgICAgICAweERFOTkKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0FVRElPX0JJVFJBVEUgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REU5QQorI2RlZmluZSBNVFBfUFJPUEVSVFlfVklERU9fRk9VUkNDX0NPREVDICAgICAgICAgICAgICAgICAgICAgMHhERTlCCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9WSURFT19CSVRSQVRFICAgICAgICAgICAgICAgICAgICAgICAgICAweERFOUMKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0ZSQU1FU19QRVJfVEhPVVNBTkRfU0VDT05EUyAgICAgICAgICAgIDB4REU5RAorI2RlZmluZSBNVFBfUFJPUEVSVFlfS0VZRlJBTUVfRElTVEFOQ0UgICAgICAgICAgICAgICAgICAgICAgMHhERTlFCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9CVUZGRVJfU0laRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERFOUYKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0VOQ09ESU5HX1FVQUxJVFkgICAgICAgICAgICAgICAgICAgICAgIDB4REVBMAorI2RlZmluZSBNVFBfUFJPUEVSVFlfRU5DT0RJTkdfUFJPRklMRSAgICAgICAgICAgICAgICAgICAgICAgMHhERUExCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9ESVNQTEFZX05BTUUgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDRTAKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0JPRFlfVEVYVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RENFMQorI2RlZmluZSBNVFBfUFJPUEVSVFlfU1VCSkVDVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQ0UyCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QUklPUklUWSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDRTMKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0dJVkVOX05BTUUgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQwMAorI2RlZmluZSBNVFBfUFJPUEVSVFlfTUlERExFX05BTUVTICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDAxCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9GQU1JTFlfTkFNRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMDIKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BSRUZJWCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQwMworI2RlZmluZSBNVFBfUFJPUEVSVFlfU1VGRklYICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDA0CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QSE9ORVRJQ19HSVZFTl9OQU1FICAgICAgICAgICAgICAgICAgICAweEREMDUKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BIT05FVElDX0ZBTUlMWV9OQU1FICAgICAgICAgICAgICAgICAgIDB4REQwNgorI2RlZmluZSBNVFBfUFJPUEVSVFlfRU1BSUxfUFJJTUFSWSAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDA3CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9FTUFJTF9QRVJTT05BTF8xICAgICAgICAgICAgICAgICAgICAgICAweEREMDgKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0VNQUlMX1BFUlNPTkFMXzIgICAgICAgICAgICAgICAgICAgICAgIDB4REQwOQorI2RlZmluZSBNVFBfUFJPUEVSVFlfRU1BSUxfQlVTSU5FU1NfMSAgICAgICAgICAgICAgICAgICAgICAgMHhERDBBCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9FTUFJTF9CVVNJTkVTU18yICAgICAgICAgICAgICAgICAgICAgICAweEREMEIKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0VNQUlMX09USEVSUyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQwQworI2RlZmluZSBNVFBfUFJPUEVSVFlfUEhPTkVfTlVNQkVSX1BSSU1BUlkgICAgICAgICAgICAgICAgICAgMHhERDBECisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QSE9ORV9OVU1CRVJfUEVSU09OQUwgICAgICAgICAgICAgICAgICAweEREMEUKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BIT05FX05VTUJFUl9QRVJTT05BTF8yICAgICAgICAgICAgICAgIDB4REQwRgorI2RlZmluZSBNVFBfUFJPUEVSVFlfUEhPTkVfTlVNQkVSX0JVU0lORVNTICAgICAgICAgICAgICAgICAgMHhERDEwCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QSE9ORV9OVU1CRVJfQlVTSU5FU1NfMiAgICAgICAgICAgICAgICAweEREMTEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BIT05FX05VTUJFUl9NT0JJTEUgICAgICAgICAgICAgICAgICAgIDB4REQxMgorI2RlZmluZSBNVFBfUFJPUEVSVFlfUEhPTkVfTlVNQkVSX01PQklMRV8yICAgICAgICAgICAgICAgICAgMHhERDEzCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9GQVhfTlVNQkVSX1BSSU1BUlkgICAgICAgICAgICAgICAgICAgICAweEREMTQKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0ZBWF9OVU1CRVJfUEVSU09OQUwgICAgICAgICAgICAgICAgICAgIDB4REQxNQorI2RlZmluZSBNVFBfUFJPUEVSVFlfRkFYX05VTUJFUl9CVVNJTkVTUyAgICAgICAgICAgICAgICAgICAgMHhERDE2CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QQUdFUl9OVU1CRVIgICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMTcKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BIT05FX05VTUJFUl9PVEhFUlMgICAgICAgICAgICAgICAgICAgIDB4REQxOAorI2RlZmluZSBNVFBfUFJPUEVSVFlfUFJJTUFSWV9XRUJfQUREUkVTUyAgICAgICAgICAgICAgICAgICAgMHhERDE5CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QRVJTT05BTF9XRUJfQUREUkVTUyAgICAgICAgICAgICAgICAgICAweEREMUEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0JVU0lORVNTX1dFQl9BRERSRVNTICAgICAgICAgICAgICAgICAgIDB4REQxQgorI2RlZmluZSBNVFBfUFJPUEVSVFlfSU5TVEFOVF9NRVNTQU5HRVJfQUREUkVTUyAgICAgICAgICAgICAgMHhERDFDCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9JTlNUQU5UX01FU1NBTkdFUl9BRERSRVNTXzIgICAgICAgICAgICAweEREMUQKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0lOU1RBTlRfTUVTU0FOR0VSX0FERFJFU1NfMyAgICAgICAgICAgIDB4REQxRQorI2RlZmluZSBNVFBfUFJPUEVSVFlfUE9TVEFMX0FERFJFU1NfUEVSU09OQUxfRlVMTCAgICAgICAgICAgMHhERDFGCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QT1NUQUxfQUREUkVTU19QRV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EREMkMKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BPU1RBTF9BRERSRVNTX09USEVSX0ZVTEwgICAgICAgICAgICAgIDB4REQyRAorI2RlZmluZSBNVFBfUFJPUEVSVFlfUE9TVEFMX0FERFJFU1NfT1RIRVJfTElORV8xICAgICAgICAgICAgMHhERDJFCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QT1NUQUxfQUREUkVTU19PVEhFUl9MSU5FXzIgICAgICAgICAgICAweEREMkYKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BPU1RBTF9BRERSRVNTX09USEVSX0NJVFkgICAgICAgICAgICAgIDB4REQzMAorI2RlZmluZSBNVFBfUFJPUEVSVFlfUE9TVEFMX0FERFJFU1NfT1RIRVJfUkVHSU9OICAgICAgICAgICAgMHhERDMxCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QT1NUQUxfQUREUkVTU19PVEhFUl9QT1NUQUxfQ09ERSAgICAgICAweEREMzIKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BPU1RBTF9BRERSRVNTX09USEVSX0NPVU5UUlkgICAgICAgICAgIDB4REQzMworI2RlZmluZSBNVFBfUFJPUEVSVFlfT1JHQU5JWkFUSU9OX05BTUUgICAgICAgICAgICAgICAgICAgICAgMHhERDM0CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QSE9ORVRJQ19PUkdBTklaQVRJT05fTkFNRSAgICAgICAgICAgICAweEREMzUKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1JPTEUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQzNgorI2RlZmluZSBNVFBfUFJPUEVSVFlfQklSVEhEQVRFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDM3CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9NRVNTQUdFX1RPICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERENDAKKyNkZWZpbmUgTVRQX1BST1BFUlRZX01FU1NBR0VfQ0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ0MQorI2RlZmluZSBNVFBfUFJPUEVSVFlfTUVTU0FHRV9CQ0MgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDQyCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9NRVNTQUdFX1JFQUQgICAgICAgICAgICAgICAgICAgICAgICAgICAweERENDMKKyNkZWZpbmUgTVRQX1BST1BFUlRZX01FU1NBR0VfUkVDRUlWRURfVElNRSAgICAgICAgICAgICAgICAgIDB4REQ0NAorI2RlZmluZSBNVFBfUFJPUEVSVFlfTUVTU0FHRV9TRU5ERVIgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDQ1CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9BQ1RJVklUWV9CRUdJTl9USU1FICAgICAgICAgICAgICAgICAgICAweERENTAKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0FDVElWSVRZX0VORF9USU1FICAgICAgICAgICAgICAgICAgICAgIDB4REQ1MQorI2RlZmluZSBNVFBfUFJPUEVSVFlfQUNUSVZJVFlfTE9DQVRJT04gICAgICAgICAgICAgICAgICAgICAgMHhERDUyCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9BQ1RJVklUWV9SRVFVSVJFRF9BVFRFTkRFRVMgICAgICAgICAgICAweERENTQKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0FDVElWSVRZX09QVElPTkFMX0FUVEVOREVFUyAgICAgICAgICAgIDB4REQ1NQorI2RlZmluZSBNVFBfUFJPUEVSVFlfQUNUSVZJVFlfUkVTT1VSQ0VTICAgICAgICAgICAgICAgICAgICAgMHhERDU2CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9BQ1RJVklUWV9BQ0NFUFRFRCAgICAgICAgICAgICAgICAgICAgICAweERENTcKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0FDVElWSVRZX1RFTlRBVElWRSAgICAgICAgICAgICAgICAgICAgIDB4REQ1OAorI2RlZmluZSBNVFBfUFJPUEVSVFlfQUNUSVZJVFlfREVDTElORUQgICAgICAgICAgICAgICAgICAgICAgMHhERDU5CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9BQ1RJVklUWV9SRU1BSU5ERVJfVElNRSAgICAgICAgICAgICAgICAweERENUEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0FDVElWSVRZX09XTkVSICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ1QgorI2RlZmluZSBNVFBfUFJPUEVSVFlfQUNUSVZJVFlfU1RBVFVTICAgICAgICAgICAgICAgICAgICAgICAgMHhERDVDCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9PV05FUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERENUQKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0VESVRPUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ1RQorI2RlZmluZSBNVFBfUFJPUEVSVFlfV0VCTUFTVEVSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDVGCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9VUkxfU09VUkNFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERENjAKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1VSTF9ERVNUSU5BVElPTiAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ2MQorI2RlZmluZSBNVFBfUFJPUEVSVFlfVElNRV9CT09LTUFSSyAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDYyCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9PQkpFQ1RfQk9PS01BUksgICAgICAgICAgICAgICAgICAgICAgICAweERENjMKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0JZVEVfQk9PS01BUksgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ2NAorI2RlZmluZSBNVFBfUFJPUEVSVFlfTEFTVF9CVUlMRF9EQVRFICAgICAgICAgICAgICAgICAgICAgICAgMHhERDcwCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9USU1FX1RPX0xJVkUgICAgICAgICAgICAgICAgICAgICAgICAgICAweERENzEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX01FRElBX0dVSUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ3MgorCisvLyBNVFAgRGV2aWNlIFByb3BlcnR5IENvZGVzCisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfVU5ERUZJTkVEICAgICAgICAgICAgICAgICAgICAgICAweDUwMDAKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9CQVRURVJZX0xFVkVMICAgICAgICAgICAgICAgICAgIDB4NTAwMQorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX0ZVTkNUSU9OQUxfTU9ERSAgICAgICAgICAgICAgICAgMHg1MDAyCisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfSU1BR0VfU0laRSAgICAgICAgICAgICAgICAgICAgICAweDUwMDMKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9DT01QUkVTU0lPTl9TRVRUSU5HICAgICAgICAgICAgIDB4NTAwNAorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX1dISVRFX0JBTEFOQ0UgICAgICAgICAgICAgICAgICAgMHg1MDA1CisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfUkdCX0dBSU4gICAgICAgICAgICAgICAgICAgICAgICAweDUwMDYKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9GX05VTUJFUiAgICAgICAgICAgICAgICAgICAgICAgIDB4NTAwNworI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX0ZPQ0FMX0xFTkdUSCAgICAgICAgICAgICAgICAgICAgMHg1MDA4CisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfRk9DVVNfRElTVEFOQ0UgICAgICAgICAgICAgICAgICAweDUwMDkKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9GT0NVU19NT0RFICAgICAgICAgICAgICAgICAgICAgIDB4NTAwQQorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX0VYUE9TVVJFX01FVEVSSU5HX01PREUgICAgICAgICAgMHg1MDBCCisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfRkxBU0hfTU9ERSAgICAgICAgICAgICAgICAgICAgICAweDUwMEMKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9FWFBPU1VSRV9USU1FICAgICAgICAgICAgICAgICAgIDB4NTAwRAorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX0VYUE9TVVJFX1BST0dSQU1fTU9ERSAgICAgICAgICAgMHg1MDBFCisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfRVhQT1NVUkVfSU5ERVggICAgICAgICAgICAgICAgICAweDUwMEYKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9FWFBPU1VSRV9CSUFTX0NPTVBFTlNBVElPTiAgICAgIDB4NTAxMAorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX0RBVEVUSU1FICAgICAgICAgICAgICAgICAgICAgICAgMHg1MDExCisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfQ0FQVFVSRV9ERUxBWSAgICAgICAgICAgICAgICAgICAweDUwMTIKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9TVElMTF9DQVBUVVJFX01PREUgICAgICAgICAgICAgIDB4NTAxMworI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX0NPTlRSQVNUICAgICAgICAgICAgICAgICAgICAgICAgMHg1MDE0CisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfU0hBUlBORVNTICAgICAgICAgICAgICAgICAgICAgICAweDUwMTUKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9ESUdJVEFMX1pPT00gICAgICAgICAgICAgICAgICAgIDB4NTAxNgorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX0VGRkVDVF9NT0RFICAgICAgICAgICAgICAgICAgICAgMHg1MDE3CisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfQlVSU1RfTlVNQkVSICAgICAgICAgICAgICAgICAgICAweDUwMTgKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9CVVJTVF9JTlRFUlZBTCAgICAgICAgICAgICAgICAgIDB4NTAxOQorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX1RJTUVMQVBTRV9OVU1CRVIgICAgICAgICAgICAgICAgMHg1MDFBCisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfVElNRUxBUFNFX0lOVEVSVkFMICAgICAgICAgICAgICAweDUwMUIKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9GT0NVU19NRVRFUklOR19NT0RFICAgICAgICAgICAgIDB4NTAxQworI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX1VQTE9BRF9VUkwgICAgICAgICAgICAgICAgICAgICAgMHg1MDFECisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfQVJUSVNUICAgICAgICAgICAgICAgICAgICAgICAgICAweDUwMUUKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9DT1BZUklHSFRfSU5GTyAgICAgICAgICAgICAgICAgIDB4NTAxRgorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX1NZTkNIUk9OSVpBVElPTl9QQVJUTkVSICAgICAgICAgMHhENDAxCisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfREVWSUNFX0ZSSUVORExZX05BTUUgICAgICAgICAgICAweEQ0MDIKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9WT0xVTUUgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RDQwMworI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX1NVUFBPUlRFRF9GT1JNQVRTX09SREVSRUQgICAgICAgMHhENDA0CisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfREVWSUNFX0lDT04gICAgICAgICAgICAgICAgICAgICAweEQ0MDUKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9QTEFZQkFDS19SQVRFICAgICAgICAgICAgICAgICAgIDB4RDQxMAorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX1BMQVlCQUNLX09CSkVDVCAgICAgICAgICAgICAgICAgMHhENDExCisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfUExBWUJBQ0tfQ09OVEFJTkVSX0lOREVYICAgICAgICAweEQ0MTIKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9TRVNTSU9OX0lOSVRJQVRPUl9WRVJTSU9OX0lORk8gIDB4RDQwNgorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX1BFUkNFSVZFRF9ERVZJQ0VfVFlQRSAgICAgICAgICAgMHhENDA3CisKKy8vIE1UUCBPcGVyYXRpb24gQ29kZXMKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9HRVRfREVWSUNFX0lORk8gICAgICAgICAgICAgICAgICAgICAgIDB4MTAwMQorI2RlZmluZSBNVFBfT1BFUkFUSU9OX09QRU5fU0VTU0lPTiAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDAyCisjZGVmaW5lIE1UUF9PUEVSQVRJT05fQ0xPU0VfU0VTU0lPTiAgICAgICAgICAgICAgICAgICAgICAgICAweDEwMDMKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9HRVRfU1RPUkFHRV9JRFMgICAgICAgICAgICAgICAgICAgICAgIDB4MTAwNAorI2RlZmluZSBNVFBfT1BFUkFUSU9OX0dFVF9TVE9SQUdFX0lORk8gICAgICAgICAgICAgICAgICAgICAgMHgxMDA1CisjZGVmaW5lIE1UUF9PUEVSQVRJT05fR0VUX05VTV9PQkpFQ1RTICAgICAgICAgICAgICAgICAgICAgICAweDEwMDYKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9HRVRfT0JKRUNUX0hBTkRMRVMgICAgICAgICAgICAgICAgICAgIDB4MTAwNworI2RlZmluZSBNVFBfT1BFUkFUSU9OX0dFVF9PQkpFQ1RfSU5GTyAgICAgICAgICAgICAgICAgICAgICAgMHgxMDA4CisjZGVmaW5lIE1UUF9PUEVSQVRJT05fR0VUX09CSkVDVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDEwMDkKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9HRVRfVEhVTUIgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAwQQorI2RlZmluZSBNVFBfT1BFUkFUSU9OX0RFTEVURV9PQkpFQ1QgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDBCCisjZGVmaW5lIE1UUF9PUEVSQVRJT05fU0VORF9PQkpFQ1RfSU5GTyAgICAgICAgICAgICAgICAgICAgICAweDEwMEMKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9TRU5EX09CSkVDVCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAwRAorI2RlZmluZSBNVFBfT1BFUkFUSU9OX0lOSVRJQVRFX0NBUFRVUkUgICAgICAgICAgICAgICAgICAgICAgMHgxMDBFCisjZGVmaW5lIE1UUF9PUEVSQVRJT05fRk9STUFUX1NUT1JFICAgICAgICAgICAgICAgICAgICAgICAgICAweDEwMEYKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9SRVNFVF9ERVZJQ0UgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAxMAorI2RlZmluZSBNVFBfT1BFUkFUSU9OX1NFTEZfVEVTVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDExCisjZGVmaW5lIE1UUF9PUEVSQVRJT05fU0VUX09CSkVDVF9QUk9URUNUSU9OICAgICAgICAgICAgICAgICAweDEwMTIKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9QT1dFUl9ET1dOICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAxMworI2RlZmluZSBNVFBfT1BFUkFUSU9OX0dFVF9ERVZJQ0VfUFJPUF9ERVNDICAgICAgICAgICAgICAgICAgMHgxMDE0CisjZGVmaW5lIE1UUF9PUEVSQVRJT05fR0VUX0RFVklDRV9QUk9QX1ZBTFVFICAgICAgICAgICAgICAgICAweDEwMTUKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9TRVRfREVWSUNFX1BST1BfVkFMVUUgICAgICAgICAgICAgICAgIDB4MTAxNgorI2RlZmluZSBNVFBfT1BFUkFUSU9OX1JFU0VUX0RFVklDRV9QUk9QX1ZBTFVFICAgICAgICAgICAgICAgMHgxMDE3CisjZGVmaW5lIE1UUF9PUEVSQVRJT05fVEVSTUlOQVRFX09QRU5fQ0FQVFVSRSAgICAgICAgICAgICAgICAweDEwMTgKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9NT1ZFX09CSkVDVCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAxOQorI2RlZmluZSBNVFBfT1BFUkFUSU9OX0NPUFlfT0JKRUNUICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDFBCisjZGVmaW5lIE1UUF9PUEVSQVRJT05fR0VUX1BBUlRJQUxfT0JKRUNUICAgICAgICAgICAgICAgICAgICAweDEwMUIKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9JTklUSUFURV9PUEVOX0NBUFRVUkUgICAgICAgICAgICAgICAgIDB4MTAxQworI2RlZmluZSBNVFBfT1BFUkFUSU9OX0dFVF9PQkpFQ1RfUFJPUFNfU1VQUE9SVEVEICAgICAgICAgICAgMHg5ODAxCisjZGVmaW5lIE1UUF9PUEVSQVRJT05fR0VUX09CSkVDVF9QUk9QX0RFU0MgICAgICAgICAgICAgICAgICAweDk4MDIKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9HRVRfT0JKRUNUX1BST1BfVkFMVUUgICAgICAgICAgICAgICAgIDB4OTgwMworI2RlZmluZSBNVFBfT1BFUkFUSU9OX1NFVF9PQkpFQ1RfUFJPUF9WQUxVRSAgICAgICAgICAgICAgICAgMHg5ODA0CisjZGVmaW5lIE1UUF9PUEVSQVRJT05fR0VUX09CSkVDVF9SRUZFUkVOQ0VTICAgICAgICAgICAgICAgICAweDk4MTAKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9TRVRfT0JKRUNUX1JFRkVSRU5DRVMgICAgICAgICAgICAgICAgIDB4OTgxMQorI2RlZmluZSBNVFBfT1BFUkFUSU9OX1NLSVAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg5ODIwCisKKy8vIE1UUCBSZXNwb25zZSBDb2RlcworI2RlZmluZSBNVFBfUkVTUE9OU0VfVU5ERUZJTkVEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwMAorI2RlZmluZSBNVFBfUkVTUE9OU0VfT0sgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwMQorI2RlZmluZSBNVFBfUkVTUE9OU0VfR0VORVJBTF9FUlJPUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwMgorI2RlZmluZSBNVFBfUkVTUE9OU0VfU0VTU0lPTl9OT1RfT1BFTiAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwMworI2RlZmluZSBNVFBfUkVTUE9OU0VfSU5WQUxJRF9UUkFOU0FDVElPTl9JRCAgICAgICAgICAgICAgICAgICAgIDB4MjAwNAorI2RlZmluZSBNVFBfUkVTUE9OU0VfT1BFUkFUSU9OX05PVF9TVVBQT1JURUQgICAgICAgICAgICAgICAgICAgIDB4MjAwNQorI2RlZmluZSBNVFBfUkVTUE9OU0VfUEFSQU1FVEVSX05PVF9TVVBQT1JURUQgICAgICAgICAgICAgICAgICAgIDB4MjAwNgorI2RlZmluZSBNVFBfUkVTUE9OU0VfSU5DT01QTEVURV9UUkFOU0ZFUiAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwNworI2RlZmluZSBNVFBfUkVTUE9OU0VfSU5WQUxJRF9TVE9SQUdFX0lEICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwOAorI2RlZmluZSBNVFBfUkVTUE9OU0VfSU5WQUxJRF9PQkpFQ1RfSEFORExFICAgICAgICAgICAgICAgICAgICAgIDB4MjAwOQorI2RlZmluZSBNVFBfUkVTUE9OU0VfREVWSUNFX1BST1BfTk9UX1NVUFBPUlRFRCAgICAgICAgICAgICAgICAgIDB4MjAwQQorI2RlZmluZSBNVFBfUkVTUE9OU0VfSU5WQUxJRF9PQkpFQ1RfRk9STUFUX0NPREUgICAgICAgICAgICAgICAgIDB4MjAwQgorI2RlZmluZSBNVFBfUkVTUE9OU0VfU1RPUkFHRV9GVUxMICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwQworI2RlZmluZSBNVFBfUkVTUE9OU0VfT0JKRUNUX1dSSVRFX1BST1RFQ1RFRCAgICAgICAgICAgICAgICAgICAgIDB4MjAwRAorI2RlZmluZSBNVFBfUkVTUE9OU0VfU1RPUkVfUkVBRF9PTkxZICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwRQorI2RlZmluZSBNVFBfUkVTUE9OU0VfQUNDRVNTX0RFTklFRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwRgorI2RlZmluZSBNVFBfUkVTUE9OU0VfTk9fVEhVTUJOQUlMX1BSRVNFTlQgICAgICAgICAgICAgICAgICAgICAgIDB4MjAxMAorI2RlZmluZSBNVFBfUkVTUE9OU0VfU0VMRl9URVNUX0ZBSUxFRCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAxMQorI2RlZmluZSBNVFBfUkVTUE9OU0VfUEFSVElBTF9ERUxFVElPTiAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAxMgorI2RlZmluZSBNVFBfUkVTUE9OU0VfU1RPUkVfTk9UX0FWQUlMQUJMRSAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAxMworI2RlZmluZSBNVFBfUkVTUE9OU0VfU1BFQ0lGSUNBVElPTl9CWV9GT1JNQVRfVU5TVVBQT1JURUQgICAgICAgIDB4MjAxNAorI2RlZmluZSBNVFBfUkVTUE9OU0VfTk9fVkFMSURfT0JKRUNUX0lORk8gICAgICAgICAgICAgICAgICAgICAgIDB4MjAxNQorI2RlZmluZSBNVFBfUkVTUE9OU0VfSU5WQUxJRF9DT0RFX0ZPUk1BVCAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAxNgorI2RlZmluZSBNVFBfUkVTUE9OU0VfVU5LTk9XTl9WRU5ET1JfQ09ERSAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAxNworI2RlZmluZSBNVFBfUkVTUE9OU0VfQ0FQVFVSRV9BTFJFQURZX1RFUk1JTkFURUQgICAgICAgICAgICAgICAgIDB4MjAxOAorI2RlZmluZSBNVFBfUkVTUE9OU0VfREVWSUNFX0JVU1kgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAxOQorI2RlZmluZSBNVFBfUkVTUE9OU0VfSU5WQUxJRF9QQVJFTlRfT0JKRUNUICAgICAgICAgICAgICAgICAgICAgIDB4MjAxQQorI2RlZmluZSBNVFBfUkVTUE9OU0VfSU5WQUxJRF9ERVZJQ0VfUFJPUF9GT1JNQVQgICAgICAgICAgICAgICAgIDB4MjAxQgorI2RlZmluZSBNVFBfUkVTUE9OU0VfSU5WQUxJRF9ERVZJQ0VfUFJPUF9WQUxVRSAgICAgICAgICAgICAgICAgIDB4MjAxQworI2RlZmluZSBNVFBfUkVTUE9OU0VfSU5WQUxJRF9QQVJBTUVURVIgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAxRAorI2RlZmluZSBNVFBfUkVTUE9OU0VfU0VTU0lPTl9BTFJFQURZX09QRU4gICAgICAgICAgICAgICAgICAgICAgIDB4MjAxRQorI2RlZmluZSBNVFBfUkVTUE9OU0VfVFJBTlNBQ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QTgwQQorCisvLyBNVFAgRXZlbnQgQ29kZXMKKyNkZWZpbmUgTVRQX0VWRU5UX1VOREVGSU5FRCAgICAgICAgICAgICAgICAgICAgICAgICAweDQwMDAKKyNkZWZpbmUgTVRQX0VWRU5UX0NBTkNFTF9UUkFOU0FDVElPTiAgICAgICAgICAgICAgICAweDQwMDEKKyNkZWZpbmUgTVRQX0VWRU5UX09CSkVDVF9BRERFRCAgICAgICAgICAgICAgICAgICAgICAweDQwMDIKKyNkZWZpbmUgTVRQX0VWRU5UX09CSkVDVF9SRU1PVkVEICAgICAgICAgICAgICAgICAgICAweDQwMDMKKyNkZWZpbmUgTVRQX0VWRU5UX1NUT1JFX0FEREVEICAgICAgICAgICAgICAgICAgICAgICAweDQwMDQKKyNkZWZpbmUgTVRQX0VWRU5UX1NUT1JFX1JFTU9WRUQgICAgICAgICAgICAgICAgICAgICAweDQwMDUKKyNkZWZpbmUgTVRQX0VWRU5UX0RFVklDRV9QUk9QX0NIQU5HRUQgICAgICAgICAgICAgICAweDQwMDYKKyNkZWZpbmUgTVRQX0VWRU5UX09CSkVDVF9JTkZPX0NIQU5HRUQgICAgICAgICAgICAgICAweDQwMDcKKyNkZWZpbmUgTVRQX0VWRU5UX0RFVklDRV9JTkZPX0NIQU5HRUQgICAgICAgICAgICAgICAweDQwMDgKKyNkZWZpbmUgTVRQX0VWRU5UX1JFUVVFU1RfT0JKRUNUX1RSQU5TRkVSICAgICAgICAgICAweDQwMDkKKyNkZWZpbmUgTVRQX0VWRU5UX1NUT1JFX0ZVTEwgICAgICAgICAgICAgICAgICAgICAgICAweDQwMEEKKyNkZWZpbmUgTVRQX0VWRU5UX0RFVklDRV9SRVNFVCAgICAgICAgICAgICAgICAgICAgICAweDQwMEIKKyNkZWZpbmUgTVRQX0VWRU5UX1NUT1JBR0VfSU5GT19DSEFOR0VEICAgICAgICAgICAgICAweDQwMEMKKyNkZWZpbmUgTVRQX0VWRU5UX0NBUFRVUkVfQ09NUExFVEUgICAgICAgIC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ByZXR1cm4gZmFsc2U7CisgICAgfQorICAgIHdyaXRlKGZkLCBlbmFibGUgPyAiMSIgOiAiMCIsIDIpOworICAgIGNsb3NlKGZkKTsKKyAgICByZXR1cm4gdHJ1ZTsKK30KKworaW50IG1haW4oaW50IGFyZ2MsIGNoYXIqIGFyZ3ZbXSkgeworICAgIGJvb2wgdXNlUFRQID0gZmFsc2U7CisgICAgY29uc3QgY2hhciogc3RvcmFnZVBhdGggPSAiL3NkY2FyZCI7CisKKyAgICBmb3IgKGludCBpID0gMTsgaSA8IGFyZ2M7IGkrKykgeworICAgICAgICBjb25zdCBjaGFyKiBhcmcgPSBhcmd2W2ldOworICAgICAgICBpZiAoIXN0cmNtcChhcmcsICItcCIpKQorICAgICAgICAgICAgdXNlUFRQID0gdHJ1ZTsKKyAgICAgICAgZWxzZSBpZiAoYXJnWzBdID09ICcvJykKKyAgICAgICAgICAgIHN0b3JhZ2VQYXRoID0gYXJnOworICAgIH0KKworICAgIGludCBmZCA9IG9wZW4oIi9kZXYvbXRwX3VzYiIsIE9fUkRXUik7CisgICAgcHJpbnRmKCJvcGVuIHJldHVybmVkICVkXG4iLCBmZCk7CisgICAgaWYgKGZkIDwgMCkgeworICAgICAgICBmcHJpbnRmKHN0ZGVyciwgImNvdWxkIG5vdCBvcGVuIE1UUCBkcml2ZXJcbiIpOworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgICAgaWYgKHVzZVBUUCkgeworICAgICAgICAvLyBzZXQgZHJpdmVyIG1vZGUgdG8gUFRQCisgICAgICAgIGludCByZXQgPSBpb2N0bChmZCwgTVRQX1NFVF9JTlRFUkZBQ0VfTU9ERSwgTVRQX0lOVEVSRkFDRV9NT0RFX1BUUCk7CisgICAgICAgIGlmIChyZXQpIHsKKyAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCAiTVRQX1NFVF9JTlRFUkZBQ0VfTU9ERSBmYWlsZWRcbiIpOworICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICB9Cis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1lcmFCcm93c2VyIjsKKworICAgIHByaXZhdGUgTGlzdEFkYXB0ZXIgbUFkYXB0ZXI7CisgICAgcHJpdmF0ZSBDb250ZW50UmVzb2x2ZXIgbVJlc29sdmVyOworICAgIHByaXZhdGUgRGV2aWNlT2JzZXJ2ZXIgbURldmljZU9ic2VydmVyOworICAgIHByaXZhdGUgQ3Vyc29yIG1DdXJzb3I7CisKKyAgICBwcml2YXRlIGNsYXNzIERldmljZU9ic2VydmVyIGV4dGVuZHMgQ29udGVudE9ic2VydmVyIHsKKyAgICAgICAgRGV2aWNlT2JzZXJ2ZXIoSGFuZGxlciBoYW5kbGVyKSB7CisgICAgICAgICAgICBzdXBlcihoYW5kbGVyKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBvbkNoYW5nZShib29sZWFuIHNlbGZDaGFuZ2UpIHsKKyAgICAgICAgICAgIExvZy5kKFRBRywgIkRldmljZU9ic2VydmVyLm9uQ2hhbmdlIik7CisgICAgICAgICAgICBpZiAobUN1cnNvciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbUN1cnNvci5yZXF1ZXJ5KCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBTdHJpbmdbXSBERVZJQ0VfQ09MVU1OUyA9CisgICAgICAgICBuZXcgU3RyaW5nW10geyBNdHAuRGV2aWNlLl9JRCwgTXRwLkRldmljZS5NQU5VRkFDVFVSRVIsIE10cC5EZXZpY2UuTU9ERUwgfTsKKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uQ3JlYXRlKEJ1bmRsZSBzYXZlZEluc3RhbmNlU3RhdGUpIHsKKyAgICAgICAgc3VwZXIub25DcmVhdGUoc2F2ZWRJbnN0YW5jZVN0YXRlKTsKKyAgICAgICAgbVJlc29sdmVyID0gZ2V0Q29udGVudFJlc29sdmVyKCk7CisgIC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KyAgICAgICAgICAgIFVyaSB1cmk7CisgICAgICAgICAgICBpZiAobU9iamVjdElEID09IDApIHsKKyAgICAgICAgICAgICAgICB1cmkgPSBNdHAuT2JqZWN0LmdldENvbnRlbnRVcmlGb3JTdG9yYWdlQ2hpbGRyZW4obURldmljZUlELCBtU3RvcmFnZUlEKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgdXJpID0gTXRwLk9iamVjdC5nZXRDb250ZW50VXJpRm9yT2JqZWN0Q2hpbGRyZW4obURldmljZUlELCBtT2JqZWN0SUQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgTG9nLmQoVEFHLCAicXVlcnkgIiArIHVyaSk7CisgICAgICAgICAgICBjID0gZ2V0Q29udGVudFJlc29sdmVyKCkucXVlcnkodXJpLCBPQkpFQ1RfQ09MVU1OUywgbnVsbCwgbnVsbCwgbnVsbCk7CisgICAgICAgICAgICBzdGFydE1hbmFnaW5nQ3Vyc29yKGMpOworICAgICAgICAgICAgbUN1cnNvciA9IGM7CisKKyAgICAgICAgICAgIC8vIE1hcCBDdXJzb3IgY29sdW1ucyB0byB2aWV3cyBkZWZpbmVkIGluIHNpbXBsZV9saXN0X2l0ZW1fMS54bWwKKyAgICAgICAgICAgIG1BZGFwdGVyID0gbmV3IE9iamVjdEN1cnNvckFkYXB0ZXIodGhpcywgYyk7CisgICAgICAgICAgICBzZXRMaXN0QWRhcHRlcihtQWRhcHRlcik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBvbkxpc3RJdGVtQ2xpY2soTGlzdFZpZXcgbCwgVmlldyB2LCBpbnQgcG9zaXRpb24sIGxvbmcgaWQpIHsKKyAgICAgICAgaW50IHJvd0lEID0gKGludCltQWRhcHRlci5nZXRJdGVtSWQocG9zaXRpb24pOworICAgICAgICBDdXJzb3IgYyA9IGdldENvbnRlbnRSZXNvbHZlcigpLnF1ZXJ5KAorICAgICAgICAgICAgICAgICAgICAgICAgTXRwLk9iamVjdC5nZXRDb250ZW50VXJpKG1EZXZpY2VJRCwgcm93SUQpLAorICAgICAgICAgICAgICAgICAgICAgICAgT0JKRUNUX0NPTFVNTlMsIG51bGwsIG51bGwsIG51bGwpOworICAgICAgICBMb2cuZChUQUcsICJxdWVyeSByZXR1cm5lZCAiICsgYyArICIgY291bnQ6ICIgKyBjLmdldENvdW50KCkpOworICAgICAgICBsb25nIGZvcm1hdCA9IDA7CisgICAgICAgIGlmIChjICE9IG51bGwgJiYgYy5nZXRDb3VudCgpID09IDEpIHsKKyAgICAgICAgICAgIGMubW92ZVRvRmlyc3QoKTsKKyAgICAgICAgICAgIGxvbmcgcm93SWQgPSBjLmdldExvbmcoSURfQ09MVU1OKTsKKyAgICAgICAgICAgIFN0cmluZyBuYW1lID0gYy5nZXRTdHJpbmcoTkFNRV9DT0xVTU4pOworICAgICAgICAgICAgZm9ybWF0ID0gYy5nZXRMb25nKEZPUk1BVF9DT0xVTU4pOworICAgICAgICAgICAgTG9nLmQoVEFHLCAicm93SWQ6ICIgKyByb3dJZCArICIgbmFtZTogIiArIG5hbWUgKyAiIGZvcm1hdDogIiArIGZvcm1hdCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGZvcm1hdCA9PSBNdHAuT2JqZWN0LkZPUk1BVF9KRklGKSB7CisgICAgICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudCh0aGlzLCBPYmplY3RWaWV3ZXIuY2xhc3MpOworICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKCJkZXZpY2UiLCBtRGV2aWNlSUQpOworICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKCJzdG9yYWdlIiwgbVN0b3JhZ2VJRCk7CisgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoIm9iamVjdCIscm93SUQpOworICAgICAgICAgICAgc3RhcnRBY3Rpdml0eShpbnRlbnQpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQodGhpcywgT2JqZWN0QnJvd3Nlci5jbGFzcyk7CisgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoImRldmljZSIsIG1EZXZpY2VJRCk7CisgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoInN0b3JhZ2UiLCBtU3RvcmFnZUlEKTsKKyAgICAgICAgICAgIGludGVudC5wdXRFeHRyYSgib2JqZWN0Iiwgcm93SUQpOworICAgICAgICAgICAgc3RhcnRBY3Rpdml0eShpbnRlbnQpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGJvb2xlYW4gb25DcmVhdGVPcHRpb25zTWVudShNZW51IG1lbnUpIHsKKyAgICAgICAgTWVudUluZmxhdGVyIGluZmxhdGVyID0gZ2V0TWVudUluZmxhdGVyKCk7CisgICAgICAgIGluZmxhdGVyLmluZmxhdGUoUi5tZW51Lm9iamVjdF9tZW51LCBtZW51KTsKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGJvb2xlYW4gb25QcmVwYXJlT3B0aW9uc01lbnUoTWVudSBtZW51KSB7CisgICAgICAgIGludCBwb3NpdGlvbiA9IG1MaXN0LmdldFNlbGVjdGVkSXRlbVBvc2l0aW9uKCk7CisgICAgICAgIE1lbnVJdGVtIGl0ZW0gPSBtZW51LmZpbmRJdGVtKFIuaWQuZGVsZXRlKTsKKyAgICAgICAgaXRlbS5zZXRFbmFibGVkKHBvc2l0aW9uICE9IEFkYXB0ZXJWaWV3LklOVkFMSURfUE9TSVRJT04pOworICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgYm9vbGVhbiBvbk9wdGlvbnNJdGVtU2VsZWN0ZWQoTWVudUl0ZW0gaXRlbSkgeworICAgICAgICBzd2l0Y2ggKGl0ZW0uZ2V0SXRlb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1YmxpYyBPYmplY3RDdXJzb3JBZGFwdGVyKENvbnRleHQgY29udGV4dCwgQ3Vyc29yIGMpIHsKKyAgICAgICAgICAgIHN1cGVyKGNvbnRleHQsIFIubGF5b3V0Lm9iamVjdF9saXN0LCBjKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBiaW5kVmlldyhWaWV3IHZpZXcsIENvbnRleHQgY29udGV4dCwgQ3Vyc29yIGN1cnNvcikgeworICAgICAgICAgICAgSW1hZ2VWaWV3IHRodW1iVmlldyA9IChJbWFnZVZpZXcpdmlldy5maW5kVmlld0J5SWQoUi5pZC50aHVtYm5haWwpOworICAgICAgICAgICAgVGV4dFZpZXcgbmFtZVZpZXcgPSAoVGV4dFZpZXcpdmlldy5maW5kVmlld0J5SWQoUi5pZC5uYW1lKTsKKworICAgICAgICAgICAgLy8gZ2V0IHRoZSB0aHVtYm5haWwKKyAgICAgICAgICAgIGJ5dGVbXSB0aHVtYm5haWwgPSBjdXJzb3IuZ2V0QmxvYihUSFVNQl9DT0xVTU4pOworICAgICAgICAgICAgaWYgKHRodW1ibmFpbCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgQml0bWFwIGJpdG1hcCA9IEJpdG1hcEZhY3RvcnkuZGVjb2RlQnl0ZUFycmF5KHRodW1ibmFpbCwgMCwgdGh1bWJuYWlsLmxlbmd0aCk7CisgICAgICAgICAgICAgICAgaWYgKGJpdG1hcCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHRodW1iVmlldy5zZXRJbWFnZUJpdG1hcChiaXRtYXApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gZ2V0IHRoZSBuYW1lCisgICAgICAgICAgICBTdHJpbmcgbmFtZSA9IGN1cnNvci5nZXRTdHJpbmcoTkFNRV9DT0xVTU4pOworICAgICAgICAgICAgaWYgKG5hbWUgPT0gbnVsbCkgeworICAgICAgIC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HJpbmcgVEFHID0gIk9iamVjdFZpZXdlciI7CisKKyAgICBwcml2YXRlIGludCBtRGV2aWNlSUQ7CisgICAgcHJpdmF0ZSBpbnQgbVN0b3JhZ2VJRDsKKyAgICBwcml2YXRlIGludCBtT2JqZWN0SUQ7CisKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBTdHJpbmdbXSBPQkpFQ1RfQ09MVU1OUyA9CisgICAgICAgIG5ldyBTdHJpbmdbXSB7ICBNdHAuT2JqZWN0Ll9JRCwKKyAgICAgICAgICAgICAgICAgICAgICAgIE10cC5PYmplY3QuTkFNRSwKKyAgICAgICAgICAgICAgICAgICAgICAgIE10cC5PYmplY3QuU0laRSwKKyAgICAgICAgICAgICAgICAgICAgICAgIE10cC5PYmplY3QuVEhVTUJfV0lEVEgsCisgICAgICAgICAgICAgICAgICAgICAgICBNdHAuT2JqZWN0LlRIVU1CX0hFSUdIVCwKKyAgICAgICAgICAgICAgICAgICAgICAgIE10cC5PYmplY3QuVEhVTUJfU0laRSwKKyAgICAgICAgICAgICAgICAgICAgICAgIE10cC5PYmplY3QuSU1BR0VfV0lEVEgsCisgICAgICAgICAgICAgICAgICAgICAgICBNdHAuT2JqZWN0LklNQUdFX0hFSUdIVCwKKyAgICAgICAgICAgICAgICAgICAgICAgIE10cC5PYmplY3QuSU1BR0VfREVQVEgsCisgICAgICAgICAgICAgICAgICAgICAgICBNdHAuT2JqZWN0LlNFUVVFTkNFX05VTUJFUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIE10cC5PYmplY3QuREFURV9DUkVBVEVELAorICAgICAgICAgICAgICAgICAgICAgICAgTXRwLk9iamVjdC5EQVRFX01PRElGSUVELAorICAgICAgICAgICAgICAgICAgICAgICAgTXRwLk9iamVjdC5LRVlXT1JEUywKKyAgICAgICAgICAgICAgICAgICAgICAgIE10cC5PYmplY3QuVEhVTUIsCisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgb25DcmVhdGUoQnVuZGxlIHNhdmVkSW5zdGFuY2VTdGF0ZSkgeworICAgICAgICBzdXBlci5vbkNyZWF0ZShzYXZlZEluc3RhbmNlU3RhdGUpOworCisgICAgICAgIHNldENvbnRlbnRWaWV3KFIubGF5b3V0Lm9iamVjdF9pbmZvKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBvblJlc3VtZSgpIHsKKyAgICAgICAgc3VwZXIub25SZXN1bWUoKTsKKworICAgICAgICBtRGV2aWNlSUQgPSBnZXRJbnRlbnQoKS5nZXRJbnRFeHRyYSgiZGV2aWNlIiwgMCk7CisgICAgICAgIG1TdG9yYWdlSUQgPSBnZXRJbnRlbnQoKS5nZXRJbnRFeHRyYSgic3RvcmFnZSIsIDApOworICAgICAgICBtT2JqZWN0SUQgPSBnZXRJbnRlbnQoKS5nZXRJbnRFeHRyYSgib2JqZWN0IiwgMCk7CisKKyAgICAgICAgaWYgKG1EZXZpY2VJRCAhPSAwICYmIG1PYmplY3RJRCAhPSAwKSB7CisgICAgICAgIEN1cnNvciBjID0gZ2V0Q29udGVudFJlc29sdmVyKCkucXVlcnkoCisgICAgICAgICAgICAgICAgICAgICAgICBNdHAuT2JqZWN0LmdldENvbnRlbnRVcmkobURldmljZUlELCBtT2JqZWN0SUQpLAorICAgICAgICAgICAgICAgICAgICAgICAgT0JKRUNUX0NPTFVNTlMsIG51bGwsIG51bGwsIG51bGwpOworICAgICAgICAgICAgYy5tb3ZlVG9GaXJzdCgpOworICAgICAgICAgICAgVGV4dFZpZXcgdmlldyA9IChUZXh0VmlldylmaW5kVmlld0J5SWQoUi5pZC5uYW1lKTsKKyAgICAgICAgICAgIHZpZXcuc2V0VGV4dChjLmdldFN0cmluZygxKSk7CisgICAgICAgICAgICB2aWV3ID0gKFRleHRWaWV3KWZpbmRWaWV3QnlJZChSLmlkLnNpemUpOworICAgICAgICAgICAgdmlldy5zZXRUZXh0KExvbmcudG9TdHJpbmcoYy5nZXRMb25nKDIpKSk7CisgICAgICAgICAgICB2aWV3ID0gKFRleHRWaWV3KWZpbmRWaWV3QnlJZChSLmlkLnRodW1iX3dpZHRoKTsKKyAgICAgICAgICAgIHZpZXcuc2V0VGV4dChMb25nLnRvU3RyaW5nKGMuZ2V0TG9uZygzKSkpOworICAgICAgICAgICAgdmlldyA9IChUZXh0VmlldylmaW5kVmlld0J5SWQoUi5pZC50aHVtYl9oZWlnaHQpOworICAgICAgICAgICAgdmlldy5zZXRUZXh0KExvbmcudG9TdHJpbmcoYy5nZXRMb25nKDQpKSk7CisgICAgICAgICAgICB2aWV3ID0gKFRleHRWaWV3KWZpbmRWaWV3QnlJZChSLmlkLnRodW1iX3NpemUpOworICAgICAgICAgICAgdmlldy5zZXRUZXh0KExvbmcudG9TdHJpbmcoYy5nZXRMb25nKDUpKSk7CisgICAgICAgICAgICB2aWV3ID0gKFRleHRWaWV3KWZpbmRWaWV3QnlJZChSLmlkLndpZHRoKTsKKyAgICAgICAgICAgIHZpZXcuc2V0VGV4dChMb25nLnRvU3RyaW5nKGMuZ2V0TG9uZyg2KSkpOworICAgICAgICAgICAgdmlldyA9IChUZXh0VmlldylmaW5kVmlld0J5SWQoUi5pZC5oZWlnaHQpOworICAgICAgICAgICAgdmlldy5zZXRUZXh0KExvbmcudG9TdHJpbmcoYy5nZXRMb25nKDcpKSk7CisgICAgICAgICAgICB2aWV3ID0gKFRleHRWaWV3KWZpbmRWaWV3QnlJZChSLmlkLmRlcHRoKTsKKyAgICAgICAgICAgIHZpZXcuc2V0VGV4dChMb25nLnRvU3RyaW5nKGMuZ2V0TG9uZyg4KSkpOworICAgICAgICAgICAgdmlldyA9IChUZXh0VmlldylmaW5kVmlld0J5SWQoUi5pZC5zZXF1ZW5jZSk7CisgICAgICAgICAgICB2aWV3LnNldFRleHQoTG9uZy50b1N0cmluZyhjLmdldExvbmcoOSkpKTsKKyAgICAgICAgICAgIHZpZXcgPSAoVGV4dFZpZXcpZmluZFZpZXdCeUlkKFIuaWQuY3JlYXRlZCk7CisgICAgICAgICAgICBEYXRlIGRhdGUgPSBuZXcgRGF0ZShjLmdldExvbmcoMTApICogMTAwMCk7CisgICAgICAgICAgICB2aWV3LnNldFRleHQoZGF0ZS50b1N0cmluZygpKTsKKyAgICAgICAgICAgIHZpZXcgPSAoVGV4dFZpZXcpZmluZFZpZXdCeUlkKFIuaWQubW9kaWZpZWQpOworICAgICAgICAgICAgZGF0ZSA9IG5ldyBEYXRlKGMuZ2V0TG9uZygxMSkgKiAxMDAwKTsKKyAgICAgICAgICAgIHZpZXcuc2V0VGV4dChkYXRlLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgdmlldyA9IChUZXh0VmlldylmaW5kVmlld0J5SWQoUi5pZC5rZXl3b3Jkcyk7CisgICAgICAgICAgICB2aWV3LnNldFRleHQoYy5nZXRTdHJpbmcoMTIpKTsKKyAgICAgICAgICAgIGJ5dGVbXSB0aHVtYm5haWwgPSBjLmdldEJsb2IoMTMpOworICAgICAgICAgICAgaWYgKHRodW1ibmFpbCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiZ290IHRodW1ibmFpbCwgbGVuZ3RoOiAiICsgdGh1bWJuYWlsLmxlbmd0aCk7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCA1MDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIiAgICAiICsgSW50ZWdlci50b0hleFN0cmluZyh0aHVtYm5haWxbaV0pKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBJbWFnZVZpZXcgdGh1bWJWaWV3ID0gKEltYWdlVmlldylmaW5kVmlld0J5SWQoUi5pZC50aHVtYm5haWwpOworICAgICAgICAgICAgICAgIEJpdG1hcCBiaXRtYXAgPSBCaXRtYXBGYWN0b3J5LmRlY29kZUJ5dGVBcnJheSh0aHVtYm5haWwsIDAsIHRodW1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nCisgICAgLy8gICAgKiBzYXktYXM6CisgICAgLy8gICAgICAgICAgbyBpbnRlcnByZXQtYXMKKyAgICAvLyAgICAqIHBob25lbWUKKyAgICAvLyAgICAqIHZvaWNlOgorICAgIC8vICAgICAgICAgIG8gZ2VuZGVyLAorICAgIC8vICAgICAgICAgIG8gYWdlLAorICAgIC8vICAgICAgICAgIG8gdmFyaWFudCwKKyAgICAvLyAgICAgICAgICBvIG5hbWUKKyAgICAvLyAgICAqIGVtcGhhc2lzCisgICAgLy8gICAgKiBicmVhazoKKyAgICAvLyAgICAgICAgICBvIHN0cmVuZ3RoLAorICAgIC8vICAgICAgICAgIG8gdGltZQorICAgIC8vICAgICogcHJvc29keToKKyAgICAvLyAgICAgICAgICBvIHBpdGNoLAorICAgIC8vICAgICAgICAgIG8gY29udG91ciwKKyAgICAvLyAgICAgICAgICBvIHJhbmdlLAorICAgIC8vICAgICAgICAgIG8gcmF0ZSwKKyAgICAvLyAgICAgICAgICBvIGR1cmF0aW9uLAorICAgIC8vICAgICAgICAgIG8gdm9sdW1lCisgICAgLy8gICAgKiBtYXJrCisgICAgLy8gRGlmZmVyZW5jZXMgYmV0d2VlbiB0aGlzIHRleHQgZm9ybWF0IGFuZCBTU01MIGFyZToKKyAgICAvLyAgICAqIGZ1bGwgU1NNTCBkb2N1bWVudHMgYXJlIG5vdCBzdXBwb3J0ZWQKKyAgICAvLyAgICAqIG5hbWVzcGFjZXMgYXJlIG5vdCBzdXBwb3J0ZWQKKyAgICAvLyBUZXh0IGlzIGNvZGVkIGluIFVURi04LgorICAgIC8vIEBwYXJhbSB0ZXh0ICAgICAgdGhlIFVURi04IHRleHQgdG8gc3ludGhlc2l6ZQorICAgIC8vIEBwYXJhbSB1c2VyZGF0YSAgcG9pbnRlciB0byBiZSByZXR1cm5lZCB3aGVuIHRoZSBjYWxsIGlzIGludm9rZWQKKyAgICAvLyBAcGFyYW0gYnVmZmVyICAgIHRoZSBsb2NhdGlvbiB3aGVyZSB0aGUgc3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mZmVycyBhcmUgbnVsbGVkIG91dCB0byBzYXZlIG1lbW9yeS4KKworICAgICAgIHByaXZhdGUgQnl0ZUJ1ZmZlciBtVmVydGV4Qnl0ZUJ1ZmZlcjsKKyAgICAgICBwcml2YXRlIEZsb2F0QnVmZmVyIG1WZXJ0ZXhCdWZmZXI7CisgICAgICAgcHJpdmF0ZSBDaGFyQnVmZmVyIG1JbmRleEJ1ZmZlcjsKKworICAgICAgIHByaXZhdGUgaW50IG1XOworICAgICAgIHByaXZhdGUgaW50IG1IOworICAgICAgIHByaXZhdGUgaW50IG1JbmRleENvdW50OworCisgICAgICAgcHVibGljIEdyaWQoaW50IHcsIGludCBoKSB7CisgICAgICAgICAgIGlmICh3IDwgMCB8fCB3ID49IDY1NTM2KSB7CisgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJ3Iik7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgaWYgKGggPCAwIHx8IGggPj0gNjU1MzYpIHsKKyAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oImgiKTsKKyAgICAgICAgICAgfQorICAgICAgICAgICBpZiAodyAqIGggPj0gNjU1MzYpIHsKKyAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIncgKiBoID49IDY1NTM2Iik7CisgICAgICAgICAgIH0KKworICAgICAgICAgICBtVyA9IHc7CisgICAgICAgICAgIG1IID0gaDsKKyAgICAgICAgICAgaW50IHNpemUgPSB3ICogaDsKKworICAgICAgICAgICBtVmVydGV4Qnl0ZUJ1ZmZlciA9IEJ5dGVCdWZmZXIuYWxsb2NhdGVEaXJlY3QoVkVSVEVYX1NJWkUgKiBzaXplKQorICAgICAgICAgICAgICAgLm9yZGVyKEJ5dGVPcmRlci5uYXRpdmVPcmRlcigpKTsKKyAgICAgICAgICAgbVZlcnRleEJ1ZmZlciA9IG1WZXJ0ZXhCeXRlQnVmZmVyLmFzRmxvYXRCdWZmZXIoKTsKKworICAgICAgICAgICBpbnQgcXVhZFcgPSBtVyAtIDE7CisgICAgICAgICAgIGludCBxdWFkSCA9IG1IIC0gMTsKKyAgICAgICAgICAgaW50IHF1YWRDb3VudCA9IHF1YWRXICogcXVhZEg7CisgICAgICAgICAgIGludCBpbmRleENvdW50ID0gcXVhZENvdW50ICogNjsKKyAgICAgICAgICAgbUluZGV4Q291bnQgPSBpbmRleENvdW50OworICAgICAgICAgICBtSW5kZXhCdWZmZXIgPSBCeXRlQnVmZmVyLmFsbG9jYXRlRGlyZWN0KENIQVJfU0laRSAqIGluZGV4Q291bnQpCisgICAgICAgICAgICAgICAub3JkZXIoQnl0ZU9yZGVyLm5hdGl2ZU9yZGVyKCkpLmFzQ2hhckJ1ZmZlcigpOworCisgICAgICAgICAgIC8qCisgICAgICAgICAgICAqIEluaXRpYWxpemUgdHJpYW5nbGUgbGlzdCBtZXNoLgorICAgICAgICAgICAgKgorICAgICAgICAgICAgKiAgICAgWzBdLS0tLS1bICAxXSAuLi4KKyAgICAgICAgICAgICogICAgICB8ICAgIC8gICB8CisgICAgICAgICAgICAqICAgICAgfCAgIC8gICAgfAorICAgICAgICAgICAgKiAgICAgIHwgIC8gICAgIHwKKyAgICAgICAgICAgICogICAgIFt3XS0tLS0tW3crMV0gLi4uCisgICAgICAgICAgICAqICAgICAgfCAgICAgICB8CisgICAgICAgICAgICAqCisgICAgICAgICAgICAqLworCisgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIGludCBpID0gMDsKKyAgICAgICAgICAgICAgIGZvciAoaW50IHkgPSAwOyB5IDwgcXVhZEg7IHkrKykgeworICAgICAgICAgICAgICAgICAgIGZvciAoaW50IHggPSAwOyB4IDwgcXVhZFc7IHgrKykgeworICAgICAgICAgICAgICAgICAgICAgICBjaGFyIGEgPSAoY2hhcikgKHkgKiBtVyArIHgpOworICAgICAgICAgICAgICAgICAgICAgICBjaGFyIGIgPSAoY2hhcikgKHkgKiBtVyArIHggKyAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgY2hhciBjID0gKGNoYXIpICgoeSArIDEpICogbVcgKyB4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgY2hhciBkID0gKGNoYXIpICgoeSArIDEpICogbVcgKyB4ICsgMSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgbUluZGV4QnVmZmVyLnB1dChpKyssIGEpOworICAgICAgICAgICAgICAgICAgICAgICBtSW5kZXhCdWZmZXIucHV0KGkrKywgYyk7CisgICAgICAgICAgICAgICAgICAgICAgIG1JbmRleEJ1ZmZlci5wdXQoaSsrLCBiKTsKKworICAgICAgICAgICAgICAgICAgICAgICBtSW5kZXhCdWZmZXIucHV0KGkrKywgYik7CisgICAgICAgICAgICAgICAgICAgICAgIG1JbmRleEJ1ZmZlci5wdXQoaSsrLCBjKTsKKyAgICAgICAgICAgICAgICAgICAgICAgbUluZGV4QnVmZmVyLnB1dChpKyssIGQpOworICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgfQorCisgICAgICAgfQorCisgICAgICAgcHVibGljIHZvaWQgc2V0KGludCBpLCBpbnQgaiwgZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgeikgeworICAgICAgICAgICBpZiAoaSA8IDAgfHwgaSA+PSBtVykgeworICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiaSIpOworICAgICAgICAgICB9CisgICAgICAgICAgIGlmIChqIDwgMCB8fCBqID49IG1IKSB7CisgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJqIik7CisgICAgICAgICAgIH0KKworICAgICAgICAgICBpbnQgaW5kZXggPSBtVyAqIGogKyBpOworCisgICAgICAgICAgIG1WZXJ0ZXhCdWZmZXIucG9zaXRpb24oaW5kZXggKiBWRVJURVhfU0laR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W10gbUFic1BvcyA9IG5ldyBpbnRbMl07Ci0gICAgCisKICAgICAvLyBmb3IgZGlzYWJsaW5nIHRoZSBzdGF0dXMgYmFyCiAgICAgaW50IG1EaXNhYmxlZCA9IDA7CiAKQEAgLTI0MCw3ICsyNDAsNyBAQAogCiAgICAgICAgIG1PbmdvaW5nVGl0bGUuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOwogICAgICAgICBtTGF0ZXN0VGl0bGUuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOwotICAgICAgICAKKwogICAgICAgICBtVGlja2VyID0gbmV3IE15VGlja2VyKGNvbnRleHQsIHNiKTsKIAogICAgICAgICBUaWNrZXJWaWV3IHRpY2tlclZpZXcgPSAoVGlja2VyVmlldylzYi5maW5kVmlld0J5SWQoUi5pZC50aWNrZXJUZXh0KTsKQEAgLTI4OSw4ICsyODksOCBAQAogICAgIH0KIAogICAgIHB1YmxpYyB2b2lkIGFkZEljb24oU3RyaW5nIHNsb3QsIGludCBpbmRleCwgaW50IHZpZXdJbmRleCwgU3RhdHVzQmFySWNvbiBpY29uKSB7Ci0gICAgICAgIFNsb2cuZChUQUcsICJhZGRJY29uIHNsb3Q9IiArIHNsb3QgKyAiIGluZGV4PSIgKyBpbmRleCArICIgdmlld0luZGV4PSIgKyB2aWV3SW5kZXgKLSAgICAgICAgICAgICAgICArICIgaWNvbj0iICsgaWNvbik7CisgICAgICAgIGlmIChTUEVXKSBTbG9nLmQoVEFHLCAiYWRkSWNvbiBzbG90PSIgKyBzbG90ICsgIiBpbmRleD0iICsgaW5kZXgKKyAgICAgICAgICAgICAgICArICIgdmlld0luZGV4PSIgKyB2aWV3SW5kZXggKyAiIGljb249IiArIGljb24pOwogICAgICAgICBTdGF0dXNCYXJJY29uVmlldyB2aWV3ID0gbmV3IFN0YXR1c0Jhckljb25WaWV3KHRoaXMsIHNsb3QpOwogICAgICAgICB2aWV3LnNldChpY29uKTsKICAgICAgICAgbVN0YXR1c0ljb25zLmFkZFZpZXcodmlldywgdmlld0luZGV4LCBuZXcgTGluZWFyTGF5b3V0LkxheW91dFBhcmFtcyhtSWNvbldpZHRoLCBtSGVpZ2h0KSk7CkBAIC0yOTgsMTQgKzI5OCwxNSBAQAogCiAgICAgcHVibGljIHZvaWQgdXBkYXRlSWNvbihTdHJpbmcgc2xvdCwgaW50IGluZGV4LCBpbnQgdmlld0luZGV4LAogICAgICAgICAgICAgU3RhdHVzQmFySWNvbiBvbGQsIFN0YXR1c0Jhckljb24gaWNvbikgewotICAgICAgICBTbG9nLmQoVEFHLCAidXBkYXRlSWNvbiBzbG90PSIgKyBzbG90ICsgIiBpbmRleD0iICsgaW5kZXggKyAiIHZpZXdJbmRleD0iICsgdmlld0luZGV4Ci0gICAgICAgICAgICAgICAgKyAiIG9sZD0iICsgb2xkICsgIiBpY29uPSIgKyBpY29uKTsKKyAgICAgICAgaWYgKFNQRVcpIFNsb2cuZChUQUcsICJ1cGRhdGVJY29uIHNsb3Q9IiArIHNsb3QgKyAiIGluZGV4PSIgKyBpbmRleAorICAgICAgICAgICAgICAgICsgIiB2aWV3SW5kZXg9IiArIHZpZXdJbmRleCArICIgb2xkPSIgKyBvbGQgKyAiIGljb249IiArIGljb24pOwogICAgICAgICBTdGF0dXNCYXJJY29uVmlldyB2aWV3ID0gKFN0YXR1c0Jhckljb25WaWV3KW1TdGF0dXNJY29ucy5nZXRDaGlsZEF0KHZpZXdJbmRleCk7CiAgICAgICAgIHZpZXcuc2V0KGljb24pOwogICAgIH0KIAogICAgIHB1YmxpYyB2b2lkIHJlbW92ZUljb24oU3RyaW5nIHNsb3QsIGludCBpbmRleCwgaW50IHZpZXdJbmRleCkgewotICAgICAgICBTbG9nLmQoVEFHLCAicmVtb3ZlSWNvbiBzbG90PSIgKyBzbG90ICsgIiBpbmRleD0iICsgaW5kZXggKyAiIHZpZXdJbmRleD0iICsgdmlld0luZGV4KTsKKyAgICAgICAgaWYgKFNQRVcpIFNsb2cuZChUQUcsICJyZW1vdmVJ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bUFuaW1WZWw9IiArIG1BbmltVmVsKTsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBpZiAoIW1FeHBhbmRlZFZpc2libGUpIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQpAQCAtNjk5LDcgKzcwMCw3IEBACiAgICAgICAgIHByZXBhcmVUcmFja2luZyh5LCBmYWxzZSk7CiAgICAgICAgIHBlcmZvcm1GbGluZyh5LCAtMjAwMC4wZiwgdHJ1ZSk7CiAgICAgfQotICAgIAorCiAgICAgdm9pZCBwZXJmb3JtRXhwYW5kKCkgewogICAgICAgICBpZiAoU1BFVykgU2xvZy5kKFRBRywgInBlcmZvcm1FeHBhbmQ6IG1FeHBhbmRlZD0iICsgbUV4cGFuZGVkKTsKICAgICAgICAgaWYgKChtRGlzYWJsZWQgJiBTdGF0dXNCYXJNYW5hZ2VyLkRJU0FCTEVfRVhQQU5EKSAhPSAwKSB7CkBAIC03MTksNyArNzIwLDcgQEAKICAgICB2b2lkIHBlcmZvcm1Db2xsYXBzZSgpIHsKICAgICAgICAgaWYgKFNQRVcpIFNsb2cuZChUQUcsICJwZXJmb3JtQ29sbGFwc2U6IG1FeHBhbmRlZD0iICsgbUV4cGFuZGVkCiAgICAgICAgICAgICAgICAgKyAiIG1FeHBhbmRlZFZpc2libGU9IiArIG1FeHBhbmRlZFZpc2libGUpOwotICAgICAgICAKKwogICAgICAgICBpZiAoIW1FeHBhbmRlZFZpc2libGUpIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQpAQCAtNzM0LDcgKzczNSw3IEBACiAgICAgICAgICAgICBzZXROb3RpZmljYXRpb25JY29uVmlzaWJpbGl0eSh0cnVlLCBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmFuaW0uZmFkZV9pbik7CiAgICAgICAgIH0KICAgICAgICAgc2V0RGF0ZVZpZXdWaXNpYmlsaXR5KGZhbHNlLCBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmFuaW0uZmFkZV9vdXQpOwotICAgICAgICAKKwogICAgICAgICBpZiAoIW1FeHBhbmRlZCkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CkBAIC04MDEsNyArODAyLDcgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHZvaWQgcHJlcGFyZVRyYWNraW5nKGludCB5LCBib29sZWFuIG9wZW5pbmcpIHsKICAgICAgICAgbVRyYWNraW5nID0gdHJ1ZTsKICAgICAgICAgbVZlbG9jaXR5VHJhY2tlciA9IFZlbG9jaXR5VHJhY2tlci5vYnRhaW4oKTsKQEAgLTgzMCw3ICs4MzEsNyBAQAogICAgICAgICAgICAgdXBkYXRlRXhwYW5kZWRWaWV3UG9zKHkgKyBtVmlld0RlbHRhKTsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHZvaWQgcGVyZm9ybUZsaW5nKGludCB5LCBmbG9hdCB2ZWwsIGJvb2xlYW4gYWx3YXlzKSB7CiAgICAgICAgIG1BbmltYXRpbmdSZXZlYWwgPSBmYWxzZTsKICAgICAgICAgbURpc3BsYXlIZWlnaHQgPSBtRGlzcGxheS5nZXRIZWlnaHQoKTsKQEAgLTg5MCw3ICs4OTEsNyBAQAogICAgICAgICBtSGFuZGxlci5zZW5kTWVzc2FnZUF0VGltZShtSGFuZGxlci5vYnRhaW5NZXNzYWdlKE1TR19BTklNQVRFKSwgbUN1ckFuaW1hdGlvblRpbWUpOwogICAgICAgICBzdG9wVHJhY2tpbmcoKTsKICAgICB9Ci0gICAgCisKICAgICBib29sZWFuIGludGVyY2VwdFRvdWNoRXZlbnQoTW90aW9uRXZlbnQgZXZlbnQpIHsKICAgICAgICAgaWYgKFNQRVcpIHsKICAgICAgICAgICAgIFNsb2cuZChUQUcsICJUb3VjaDogcmF3WT0iICsgZXZlbnQuZ2V0UmF3WSgpICsgIiBldmVudD0iICsgZXZlbnQgKyAiIG1EaXNhYmxlZD0iCkBAIC05MDAsNyArOTAxLDcgQEAKICAgICAgICAgaWYgKChtRGlzYWJsZWQgJiBTdGF0dXNCYXJNYW5hZ2VyLkRJU0FCTEVfRVhQQU5EKSAhPSAwKSB7CiAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgZmluYWwgaW50IHN0YXR1c0JhclNpemUgPSBtU3RhdHVzQmFyVmlldy5nZXRIZWlnaHQoKTsKICAgICAgICAgZmluYWwgaW50IGhpdFNpemUgPSBzdGF0dXNCYXJTaXplKjI7CiAgICAgICAgIGlmIChldmVudC5nZXRBY3Rpb24oKSA9PSBNb3Rpb25FdmVudC5BQ1RJT05fRE9XTikgewpAQCAtOTU0LDEwICs5NTUsMTAgQEAKICAgICAgICAgICAgICAgICBpZiAobmVnYXRpdmUpIHsKICAgICAgICAgICAgICAgICAgICAgdmVsID0gLXZlbDsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgICAgICBwZXJmb3JtRmxpbmcoKGludClldmVudC5nZXRSYXdZKCksIHZlbCwgZmFsc2UpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgfQogICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgfQpAQCAtMTAzNiw3ICsxMDM3LDcgQEAKICAgICAgICAgTXlUaWNrZXIoQ29udGV4dCBjb250ZXh0LCBTdGF0dXNCYXJWaWV3IHNiKSB7CiAgICAgICAgICAgICBzdXBlcihjb250ZXh0LCBzYik7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgIHZvaWQgdGlja2VyU3RhcnRpbmcoKSB7CiAgICAgICAgICAgICBtVGlja2luZyA9IHRydWU7CkBAIC0xMTA0LDcgKzExMDUsNyBAQAogICAgICAgICAgICAgICAgICAgICArICIsIHVpZD0iICsgQmluZGVyLmdldENhbGxpbmdVaWQoKSk7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH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WxwLmg+CiAjaW5jbHVkZSA8YW5kcm9pZF9ydW50aW1lL0FuZHJvaWRSdW50aW1lLmg+Ci0jaW5jbHVkZSA8dHRzL1R0c0VuZ2luZS5oPgorI2luY2x1ZGUgPGFuZHJvaWQvdHRzLmg+CiAjaW5jbHVkZSA8bWVkaWEvQXVkaW9UcmFjay5oPgogI2luY2x1ZGUgPG1hdGguaD4KIApAQCAtMTU0LDcgKzE1NCw3IEBACiBjbGFzcyBTeW50aFByb3h5Sm5pU3RvcmFnZSB7CiAgICAgcHVibGljIDoKICAgICAgICAgam9iamVjdCAgICAgICAgICAgICAgICAgICB0dHNfcmVmOwotICAgICAgICBUdHNFbmdpbmUqICAgICAgICAgICAgICAgIG1OYXRpdmVTeW50aEludGVyZmFjZTsKKyAgICAgICAgYW5kcm9pZF90dHNfZW5naW5lX3QqICAgICAgIG1FbmdpbmU7CiAgICAgICAgIHZvaWQqICAgICAgICAgICAgICAgICAgICAgbUVuZ2luZUxpYkhhbmRsZTsKICAgICAgICAgQXVkaW9UcmFjayogICAgICAgICAgICAgICBtQXVkaW9PdXQ7CiAgICAgICAgIGludDhfdCAgICAgICAgICAgICAgICAgICAgbVBsYXlTdGF0ZTsKQEAgLTE2OCw3ICsxNjgsNyBAQAogCiAgICAgICAgIFN5bnRoUHJveHlKbmlTdG9yYWdlKCkgewogICAgICAgICAgICAgdHRzX3JlZiA9IE5VTEw7Ci0gICAgICAgICAgICBtTmF0aXZlU3ludGhJbnRlcmZhY2UgPSBOVUxMOworICAgICAgICAgICAgbUVuZ2luZSA9IE5VTEw7CiAgICAgICAgICAgICBtRW5naW5lTGliSGFuZGxlID0gTlVMTDsKICAgICAgICAgICAgIG1BdWRpb091dCA9IE5VTEw7CiAgICAgICAgICAgICBtUGxheVN0YXRlID0gIFNZTlRIUExBWVNUQVRFX0lTX1NUT1BQRUQ7CkBAIC0xODQsOSArMTg0LDkgQEAKICAgICAgICAgflN5bnRoUHJveHlKbmlTdG9yYWdlKCkgewogICAgICAgICAgICAgLy9MT0dWKCJlbnRlcmluZyB+U3ludGhQcm94eUpuaVN0b3JhZ2UoKSIpOwogICAgICAgICAgICAga2lsbEF1ZGlvKCk7Ci0gICAgICAgICAgICBpZiAobU5hdGl2ZVN5bnRoSW50ZXJmYWNlKSB7Ci0gICAgICAgICAgICAgICAgbU5hdGl2ZVN5bnRoSW50ZXJmYWNlLT5zaHV0ZG93bigpOwotICAgICAgICAgICAgICAgIG1OYXRpdmVTeW50aEludGVyZmFjZSA9IE5VTEw7CisgICAgICAgICAgICBpZiAobUVuZ2luZSkgeworICAgICAgICAgICAgICAgIG1FbmdpbmUtPmZ1bmNzLT5zaHV0ZG93bihtRW5naW5lKTsKKyAgICAgICAgICAgICAgICBtRW5naW5lID0gTlVMTDsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmIChtRW5naW5lTGliSGFuZGxlKSB7CiAgICAgICAgICAgICAgICAgLy9MT0dFKCJ+U3ludGhQcm94eUpuaVN0b3JhZ2UoKTogYmVmb3JlIGNsb3NlIGxpYnJhcnkiKTsKQEAgLTI3MywyOCArMjczLDQ1IEBACiAgKiBDYWxsYmFjayBmcm9tIFRUUyBlbmdpbmUuCiAgKiBEaXJlY3RseSBzcGVha3MgdXNpbmcgQXVkaW9UcmFjayBvciB3cml0ZSB0byBmaWxlCiAgKi8KLXN0YXRpYyB0dHNfY2FsbGJhY2tfc3RhdHVzIHR0c1N5bnRoRG9uZUNCKHZvaWQgKiYgdXNlcmRhdGEsIHVpbnQzMl90IHJhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBmb3JtYXQsIGludCBjaGFubmVsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50OF90IComd2F2LCBzaXplX3QgJmJ1ZmZlclNpemUsIHR0c19zeW50aF9zdGF0dXMgc3RhdHVzKSB7CitleHRlcm4gIkMiIGFuZHJvaWRfdHRzX2NhbGxiYWNrX3N0YXR1c190CitfX3R0c1N5bnRoRG9uZU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vT3V0KSB7CiAgICAgICAgICAgICAgICAgcEpuaURhdGEtPm1QbGF5TG9jay5sb2NrKCk7CiAgICAgICAgICAgICAgICAgaWYocEpuaURhdGEtPm1BdWRpb091dC0+c3RvcHBlZCgpCkBAIC0zMDMsMjggKzMyMCwzMSBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBwSm5pRGF0YS0+bVBsYXlMb2NrLnVubG9jaygpOwogICAgICAgICAgICAgICAgIGlmIChiVXNlRmlsdGVyKSB7Ci0gICAgICAgICAgICAgICAgICAgIGFwcGx5RmlsdGVyKChpbnQxNl90Kil3YXYsIGJ1ZmZlclNpemUvMik7CisgICAgICAgICAgICAgICAgICAgIGFwcGx5RmlsdGVyKChpbnQxNl90KikqcFdhdiwgKnBCdWZmZXJTaXplLzIpOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBwSm5pRGF0YS0+bUF1ZGlvT3V0LT53cml0ZSh3YXYsIGJ1ZmZlclNpemUpOwotICAgICAgICAgICAgICAgIG1lbXNldCh3YXYsIDAsIGJ1ZmZlclNpemUpOworICAgICAgICAgICAgICAgIHBKbmlEYXRhLT5tQXVkaW9PdXQtPndyaXRlKCpwV2F2LCAqcEJ1ZmZlclNpemUpOworICAgICAgICAgICAgICAgIG1lbXNldCgqcFdhdiwgMCwgKnBCdWZmZXJTaXplKTsKICAgICAgICAgICAgICAgICAvL0xPR1YoIkF1ZGlvVHJhY2sgd3JvdGU6ICVkIGJ5dGVzIiwgYnVmZmVyU2l6ZSk7CiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIExPR0UoIkNhbid0IHBsYXksIG51bGwgYXVkaW90cmFjayIpOworICAgICAgICAgICAgICAgIGRlbGV0ZSBwRm9yQWZ0ZXI7CisgICAgICAgICAgICAgICAgcEZvckFmdGVyID0gTlVMTDsKKyAgICAgICAgICAgICAgICByZXR1cm4gQU5EUk9JRF9UVFNfQ0FMTEJBQ0tfSEFMVDsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0gZWxzZSAgaWYgKHBGb3JBZnRlci0+dXNhZ2VNb2RlID09IFVTQUdFTU9ERV9XUklURV9UT19GSUxFKSB7CiAgICAgICAgIC8vTE9HVigiU2F2ZSB0byBmaWxlIik7Ci0gICAgICAgIGlmICh3YXYgPT0gTlVMTCkgeworICAgICAgICBpZiAoKnBXYXYgPT0gTlVMTCkgewogICAgICAgICAgICAgZGVsZXRlIHBGb3JBZnRlcjsKICAgICAgICAgICAgIExPR1YoIk51bGw6IHNwZWVjaCBoYXMgY29tcGxldGVkIik7Ci0gICAgICAgICAgICByZXR1cm4gVFRTX0NBTExCQUNLX0hBTFQ7CisgICAgICAgICAgICByZXR1cm4gQU5EUk9JRF9UVFNfQ0FMTEJBQ0tfSEFMVDsKICAgICAgICAgfQotICAgICAgICBpZiAoYnVmZmVyU2l6ZSA+IDApeworICAgICAgICBpZiAoKnBCdWZmZXJTaXplID4gMCl7CiAgICAgICAgICAgICBpZiAoYlVzZUZpbHRlcikgewotICAgICAgICAgICAgICAgIGFwcGx5RmlsdGVyKChpbnQxNl90Kil3YXYsIGJ1ZmZlclNpemUvMik7CisgICAgICAgICAgICAgICAgYXBwbHlGaWx0ZXIoKGludDE2X3QqKSpwV2F2LCAqcEJ1ZmZlclNpemUvMik7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBmd3JpdGUod2F2LCAxLCBidWZmZXJTaXplLCBwRm9yQWZ0ZXItPm91dHB1dEZpbGUpOwotICAgICAgICAgICAgbWVtc2V0KHdhdiwgMCwgYnVmZmVyU2l6ZSk7CisgICAgICAgICAgICBmd3JpdGUoKnBXYXYsIDEsICpwQnVmZmVyU2l6ZSwgcEZvckFmdGVyLT5vdXRwdXRGaWxlKTsKKyAgICAgICAgICAgIG1lbXNldCgqcFdhdiwgMCwgKnBCdWZmZXJTaXplKTsKICAgICAgICAgfQogICAgIH0KICAgICAvLyBGdXR1cmUgdXBkYXRlOgpAQCAtMzMy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mFnZS0+bU5hdGl2ZVN5bnRoSW50ZXJmYWNlKSB7Ci0gICAgICAgICAgICBNdXRleDo6QXV0b2xvY2sgbChlbmdpbmVNdXRleCk7Ci0gICAgICAgICAgICBwSm5pU3RvcmFnZS0+bU5hdGl2ZVN5bnRoSW50ZXJmYWNlLT5pbml0KHR0c1N5bnRoRG9uZUNCLCBlbmdDb25maWdTdHJpbmcpOworICAgICAgICAvLyBTdXBwb3J0IG9ic29sZXRlL2xlZ2FjeSBiaW5hcnkgbW9kdWxlcworICAgICAgICBpZiAoZ2V0X1R0c0VuZ2luZSA9PSBOVUxMKSB7CisgICAgICAgICAgICBnZXRfVHRzRW5naW5lID0KKyAgICAgICAgICAgICAgICByZWludGVycHJldF9jYXN0PGFuZHJvaWRfdHRzX2VuZ2luZV90KiAoKikoKT4oZGxzeW0oZW5naW5lX2xpYl9oYW5kbGUsICJnZXRUdHNFbmdpbmUiKSk7CiAgICAgICAgIH0KIAotICAgICAgICByZXN1bHQgPSBUVFNfU1VDQ0VTUzsKKyAgICAgICAgcEpuaVN0b3JhZ2UtPm1FbmdpbmUgPSAoKmdldF9UdHNFbmdpbmUpKCk7CisgICAgICAgIHBKbmlTdG9yYWdlLT5tRW5naW5lTGliSGFuZGxlID0gZW5naW5lX2xpYl9oYW5kbGU7CisKKyAgICAgICAgYW5kcm9pZF90dHNfZW5naW5lX3QgKmVuZ2luZSA9IHBKbmlTdG9yYWdlLT5tRW5naW5lOworICAgICAgICBpZiAoZW5naW5lKSB7CisgICAgICAgICAgICBNdXRleDo6QXV0b2xvY2sgbChlbmdpbmVNdXRleCk7CisgICAgICAgICAgICBlbmdpbmUtPmZ1bmNzLT5pbml0KAorICAgICAgICAgICAgICAgIGVuZ2luZSwKKyAgICAgICAgICAgICAgICBfX3R0c1N5bnRoRG9uZUNCLAorICAgICAgICAgICAgICAgIGVuZ0NvbmZpZ1N0cmluZyk7CisgICAgICAgIH0KKworICAgICAgICByZXN1bHQgPSBBTkRST0lEX1RUU19T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ja1BhdHRlcm5VdGlscy51cGRhdGVFbWVyZ2VuY3lDYWxsQnV0dG9uU3RhdGUobUVtZXJnZW5jeUNhbGxCdXR0b24pOwogCkBAIC0xNzQsNiArMTc5LDkgQEAKICAgICAgICAgICAgICAgICBsb25nIGRlYWRsaW5lID0gbUxvY2tQYXR0ZXJuVXRpbHMuc2V0TG9ja291dEF0dGVtcHREZWFkbGluZSgpOwogICAgICAgICAgICAgICAgIGhhbmRsZUF0dGVtcHRMb2Nrb3V0KGRlYWRsaW5lKTsKICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1UaXRsZS5zZXRUZXh0KFIuc3RyaW5nLmxvY2tzY3JlZW5fcGFzc3dvcmRfd3JvbmcpOworICAgICAgICB9IGVsc2UgaWYgKGVudHJ5Lmxlbmd0aCgpID4gMCkgeworICAgICAgICAgICAgbVRpdGxlLnNldFRleHQoUi5zdHJpbmcubG9ja3NjcmVlbl9wYXNzd29yZF93cm9uZyk7CiAgICAgICAgIH0KICAgICAgICAgbVBhc3N3b3JkRW50cnkuc2V0VGV4dCgiIik7CiAgICAgfQpAQCAtMTk3LDggKzIwNSw4IEBACiAgICAgICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uRmluaXNoKCkgewogICAgICAgICAgICAgICAgIG1QYXNzd29yZEVudHJ5LnNldEVuYWJsZWQodHJ1ZSk7Ci0gICAgICAgICAgICAgICAgbVRpdGxlLnNldFRleHQoUi5zdHJpbmcua2V5Z3VhcmRfcGFzc3dvcmRfZW50ZXJfcGFzc3dvcmRfY29kZSk7CiAgICAgICAgICAgICAgICAgbUtleWJvYXJkVmlldy5zZXRFbmFibGVkKHRydWUpOworICAgICAgICAgICAgICAgIHJlc2V0U3RhdHVzSW5mbygpOwogICAgICAgICAgICAgfQogICAgICAgICB9LnN0YXJ0KCk7CiAgICAgfQpAQCAtMjY0LDQgKzI3MiwxMiBAQAogCiAgICAgfQogCisgICAgcHJpdmF0ZSB2b2l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sVmlldyA9PSBudWxsKSB7CiAgICAgICAgICAgICAvLyBJbml0IHRoZSBwYW5lbCBzdGF0ZSdzIG1lbnUtLXJldHVybiBmYWxzZSBpZiBpbml0IGZhaWxlZAotICAgICAgICAgICAgaWYgKHN0Lm1lbnUgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGlmICghaW5pdGlhbGl6ZVBhbmVsTWVudShzdCkgfHwgKHN0Lm1lbnUgPT0gbnVsbCkpIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgaWYgKHN0Lm1lbnUgPT0gbnVsbCB8fCBzdC5yZWZyZXNoTWVudUNvbnRlbnQpIHsKKyAgICAgICAgICAgICAgICBpZiAoc3QubWVudSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghaW5pdGlhbGl6ZVBhbmVsTWVudShzdCkgfHwgKHN0Lm1lbnUgPT0gbnVsbCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAvLyBDYWxsIGNhbGxiYWNrLCBhbmQgcmV0dXJuIGlmIGl0IGRvZXNuJ3Qgd2FudCB0byBkaXNwbGF5IG1lbnUKICAgICAgICAgICAgICAgICBpZiAoKGNiID09IG51bGwpIHx8ICFjYi5vbkNyZWF0ZVBhbmVsTWVudShzdC5mZWF0dXJlSWQsIHN0Lm1lbnUpKSB7CkBAIC0zMjYsNiArMzMzLDEyIEBACiAKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBzdC5yZWZyZXNoTWVudUNvbnRlbnQgPSBmYWxzZTsKKworICAgICAgICAgICAgICAgIGlmIChtQWN0aW9uQmFyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbUFj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HRoZXJlIGlzIG5vIHRpdGxlLgorICAgICAgICAgICAgcmVxdWVzdEZlYXR1cmUoRkVBVFVSRV9BQ1RJT05fQkFSKTsKICAgICAgICAgfQogCiAgICAgICAgIGlmIChhLmdldEJvb2xlYW4oY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2luZG93X3dpbmRvd0Z1bGxzY3JlZW4sIGZhbHNlKSkgewpAQCAtMjE4OSw2ICsyMjIzLDggQEAKICAgICAgICAgICAgIC8vIElmIHRoZSB3aW5kb3cgaXMgZmxvYXRpbmcsIHdlIG5lZWQgYSBkaWFsb2cgbGF5b3V0CiAgICAgICAgICAgICBpZiAobUlzRmxvYXRpbmcpIHsKICAgICAgICAgICAgICAgICBsYXlvdXRSZXNvdXJjZSA9IGNvbS5hbmRyb2lkLmludGVybmFsLlIubGF5b3V0LmRpYWxvZ190aXRsZTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoKGZlYXR1cmVzICYgKDEgPDwgRkVBVFVSRV9BQ1RJT05fQkFSKSkgIT0gMCkgeworICAgICAgICAgICAgICAgIGxheW91dFJlc291cmNlID0gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5sYXlvdXQuc2NyZWVuX2FjdGlvbl9iYXI7CiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIGxheW91dFJlc291cmNlID0gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5sYXlvdXQuc2NyZWVuX3RpdGxlOwogICAgICAgICAgICAgfQpAQCAtMjI3Myw2ICsyMzA5LDExIEBACiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgbVRpdGxlVmlldy5zZXRUZXh0KG1UaXRsZSk7CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtQWN0aW9uQmFyID0gKEFjdGlvbkJhclZpZXcpIGZpbmRWaWV3QnlJZChjb20uYW5kcm9pZ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gICBtSGFuZGxlciA9IG5ldyBNeUhhbmRsZXIoKTsKQEAgLTU5NywxNSArNjExLDcgQEAKICAgICAgICAgICAgICAgICBuZXR3b3JrLnJlY29ubmVjdCgpOwogICAgICAgICAgICAgICAgIHJldHVybiBQaG9uZS5BUE5fUkVRVUVTVF9TVEFSVEVEOwogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQodGhpcykgewotICAgICAgICAgICAgICAgICAgICBtRmVhdHVyZVVzZXJzLmFkZChmKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbUhhbmRsZXIuc2VuZE1lc3NhZ2VEZWxheWVkKG1IYW5kbGVyLm9idGFpbk1lc3NhZ2UoCi0gICAgICAgICAgICAgICAgICAgICAgICBOZXR3b3JrU3RhdGVUcmFja2VyLkVWRU5UX1JFU1RPUkVfREVGQVVMVF9ORVRXT1JLLAotICAgICAgICAgICAgICAgICAgICAgICAgZiksIGdldFJlc3RvcmVEZWZhdWx0TmV0d29ya0RlbGF5KCkpOwotCi0gICAgICAgICAgICAgICAgcmV0dXJuIG5ldHdvcmsuc3RhcnRVc2luZ05ldHdvcmtGZWF0dXJlKGZlYXR1cmUsCi0gICAgICAgICAgICAgICAgICAgICAgICBnZXRDYWxsaW5nUGlkKCksIGdldENhbGxpbmdVaWQoKSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIC0xOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIHJldHVybiBQaG9uZS5BUE5fVFlQRV9OT1RfQVZBSUxBQkxFOwpAQCAtNzI0LDggKzczMCw3IEBACiAgICAgICAgICAgICB0cmFja2VyLnRlYXJkb3duKCk7CiAgICAgICAgICAgICByZXR1cm4gMTsKICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIC8vIGRvIGl0IHRoZSBvbGQgZmFzaGlvbmVkIHdheQotICAgICAgICAgICAgcmV0dXJuIHRyYWNrZXIuc3RvcFV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mFjZU5hbWUoKTsKKworICAgICAgICBpZiAoREJHKSB7CisgICAgICAgICAgICBTbG9nLmQoVEFHLCAiUmVxdWVzdGVkIGhvc3Qgcm91dGUgdG8gIiArIEludGVnZXIudG9IZXhTdHJpbmcoaG9zdEFkZHJlc3MpICsKKyAgICAgICAgICAgICAgICAgICAgICIoIiArIGludGVyZmFjZU5hbWUgKyAiKSIpOworICAgICAgICB9CisgICAgICAgIGlmIChpbnRlcmZhY2VOYW1lICE9IG51bGwgJiYgaG9zdEFkZHJlc3MgIT0gLTEpIHsKKyAgICAgICAgICAgIHJldHVybiBOZXR3b3JrVXRpbHMuYWRkSG9zdFJvdXRlKGludGVyZmFjZU5hbWUsIGhvc3RBZGRyZXNzKSA9PSAwOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CiAgICAgfQogCiAgICAgLyoqCkBAIC04NTksNiArODg5LDEyIEBACiAgICAgICAgICAgICAgICAgIkNvbm5lY3Rpdml0eVNlcnZpY2UiKTsKICAgICB9CiAKKyAgICBwcml2YXRlIHZvaWQgZW5mb3JjZUNvbm5lY3Rpdml0eUludGVybmFsUGVybWlzc2lvbigpIHsKKyAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKAorICAgICAgICAgICAgICAgIGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5DT05ORUNUSVZJVFlfSU5URVJOQUwsCisgICAgICAgICAgICAgICAgIkNvbm5lY3Rpdml0eVNlcnZpY2UiKTsKKyAgICB9CisKICAgICAvKioKICAgICAgKiBIYW5kbGUgYSB7QGNvZGUgRElTQ09OTkVDVEVEfSBldmVudC4gSWYgdGhpcyBwZXJ0YWlucyB0byB0aGUgbm9uLWFjdGl2ZQogICAgICAqIG5ldHdvcmssIHdlIGlnbm9yZSBpdC4gSWYgaXQgaXMgZm9yIHRoZSBhY3RpdmUgbmV0d29yaywgd2Ugc2VuZCBvdXQgYQpAQCAtMTEzNCwxNSArMTE3MCwyMyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgU2xvZy5lKFRBRywgIk5ldHdvcmsgZGVjbGluZWQgdGVhcmRvd24gcmVxdWVzdCIpOwogICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGlmIChpc0ZhaWxvdmVyKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBvdGhlck5ldC5yZWxlYXNlV2FrZUxvY2soKTsKLSAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAoQ29ubmVjdGl2aXR5U2VydmljZS50aGlzKSB7CisgICAgICAgICAgICAgICAgLy8gaGF2ZSBhIG5ldyBkZWZhdWx0IG5ldHdvcmssIHJlbGVhc2UgdGhlIHRyYW5zaXRpb24gd2FrZWxvY2sgaW4gYSBzZWNvbmQKKyAgICAgICAgICAgICAgICAvLyBpZiBpdCdzIGhlbGQuICBUaGUgc2Vjb25kIHBhdXNlIGlzIHRvIGFsbG93IGFwcHMgdG8gcmVjb25uZWN0IG92ZXIgdGhlCisgICAgICAgICAgICAgICAgLy8gbmV3IG5ldHdvcmsKKyAgICAgICAgICAgICAgICBpZiAobU5ldFRyYW5zaXRpb25XYWtlTG9jay5pc0hlbGQoKSkgeworICAgICAgICAgICAgICAgICAgICBtSGFuZGxlci5zZW5kTWVzc2FnZURlbGF5ZWQobUhhbmRsZXIub2J0YWluTWVzc2FnZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBOZXR3b3JrU3RhdGVUcmFja2VyLkVWRU5UX0NMRUFSX05FVF9UUkFOU0lUSU9OX1dBS0VMT0NLLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1OZXRUcmFuc2l0aW9uV2FrZUxvY2tTZXJpYWxOdW1iZXIsIDApLAorICA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NQcm9wTmFtZXMoKSk7CisgICAgICAgIGlmIChpbnRlcmZhY2VOYW1lICE9IG51bGwgJiYgIXByaXZhdGVEbnNSb3V0ZVNldCkgeworICAgICAgICAgICAgZm9yIChTdHJpbmcgYWRkclN0cmluZyA6IGRuc0xpc3QpIHsKKyAgICAgICAgICAgICAgICBpbnQgYWRkciA9IE5ldHdvcmtVdGlscy5sb29rdXBIb3N0KGFkZHJTdHJpbmcpOworICAgICAgICAgICAgICAgIGlmIChhZGRyICE9IC0xICYmIGFkZHIgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSBTbG9nLmQoVEFHLCAiICBhZGRpbmcgIithZGRyU3RyaW5nKyIgKCIrYWRkcisiKSIpOworICAgICAgICAgICAgICAgICAgICBOZXR3b3JrVXRpbHMuYWRkSG9zdFJvdXRlKGludGVyZmFjZU5hbWUsIGFkZHIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG50LnByaXZhdGVEbnNSb3V0ZVNldCh0cnVlKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCByZW1vdmVQcml2YXRlRG5zUm91dGVzKE5ldHdvcmtTdGF0ZVRyYWNrZXIgbnQpIHsKKyAgICAgICAgLy8gVE9ETyAtIHdlIHNob3VsZCBkbyB0aGlzIGV4cGxpY2l0bHkgYnV0IHRoZSBOZXRVdGlscyBhcGkgZG9lc250CisgICAgICAgIC8vIHN1cHBvcnQgdGhpcyB5ZXQgLSBtdXN0IHJlbW92ZSBhbGwuICBObyB3b3JzZSB0aGFuIGJlZm9yZQorICAgICAgICBTdHJpbmcgaW50ZXJmYWNlTmFtZSA9IG50LmdldEludGVyZmFjZU5hbWUoKTsKKyAgICAgICAgYm9vbGVhbiBwcml2YXRlRG5zUm91dGVTZXQgPSBudC5pc1ByaXZhdGVEbnNSb3V0ZVNldCgpOworICAgICAgICBpZiAoaW50ZXJmYWNlTmFtZSAhPSBudWxsICYm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luZm8gbmV0d29ya0luZm8gPSBudC5nZXROZXR3b3JrSW5mbygpOworCisgICAgICAgIGlmICgoaW50ZXJmYWNlTmFtZSAhPSBudWxsKSAmJiAoZGVmYXVsdEdhdGV3YXlBZGRyICE9IDApICYmCisgICAgICAgICAgICAgICAgZGVmYXVsdFJvdXRlU2V0ID09IGZhbHNlKSB7CisgICAgICAgICAgICBpZiAoREJHKSB7CisgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgImFkZERlZmF1bHRSb3V0ZSBmb3IgIiArIG5ldHdvcmtJbmZvLmdldFR5cGVOYW1lKCkgKworICAgICAgICAgICAgICAgICAgICAgICAgIiAoIiArIGludGVyZmFjZU5hbWUgKyAiKSwgR2F0ZXdheUFkZHI9IiArIGRlZmF1bHRHYXRld2F5QWRkcik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBOZXR3b3JrVXRpbHMuc2V0RGVmYXVsdFJvdXRlKGludGVyZmFjZU5hbWUsIGRlZmF1bHRHYXRld2F5QWRkcik7CisgICAgICAgICAgICBudC5kZWZhdWx0Um91dGVTZXQodHJ1ZSk7CisgICAgICAgIH0KKyAgICB9CisKKworICAgIHB1YmxpYyB2b2lkIHJlbW92ZURlZmF1bHRSb3V0ZShOZXR3b3JrU3RhdGVUcmFja2VyIG50KSB7CisgICAgICAgIFN0cmluZyBpbnRlcmZhY2VOYW1lID0gbnQuZ2V0SW50ZXJmYWNlTmFtZSgpOworICAgICAgICBib29sZWFuIGRlZmF1bHRSb3V0ZVNldCA9IG50LmlzRGVmYXVsdFJvdXRlU2V0KCk7CisgICAgICAgIE5ldHdvcmtJbmZvIG5ldHdvcmtJbmZvID0gbnQuZ2V0TmV0d29ya0luZm8oKTsKKworICAgICAgICBpZiAoaW50ZXJmYWNlTmFtZSAhPSBudWxsICYmIGRlZmF1bHRSb3V0ZVNldCA9PSB0cnVlKSB7CisgICAgICAgICAgICBpZiAoREJHKSB7CisgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgInJlbW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50Y3AuYnVmZmVyc2l6ZS5kZWZhdWx0IjsKKyAgICAgICAgICAgIGJ1ZmZlclNpemVzID0gU3lzdGVtUHJvcGVydGllcy5nZXQoa2V5KTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIFNldCB2YWx1ZXMgaW4ga2VybmVsCisgICAgICAgIGlmIChidWZmZXJTaXplcy5sZW5ndGgoKSAhPSAwKSB7CisgICAgICAgICAgICBpZiAoREJHKSB7CisgICAgICAgICAgICAgICAgU2xvZy52KFRBRywgIlNldHRpbmcgVENQIHZhbHVlczogWyIgKyBidWZmZXJTaXplcworICAgICAgICAgICAgICAgICAgICAgICAgKyAiXSB3aGljaCBjb21lcyBmcm9tIFsiICsga2V5ICsgIl0iKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNldEJ1ZmZlclNpemUoYnVmZmVyU2l6ZXMpOworICAgICAgICB9CisgICAgfQorCisgICAvKioKKyAgICAgKiBXcml0ZXMgVENQIGJ1ZmZlciBzaXplcyB0byAvc3lzL2tlcm5lbC9pcHY0L3RjcF9bci93XW1lbV9bbWluL2RlZi9tYXhdCisgICAgICogd2hpY2ggbWFwcyB0byAvcHJvYy9zeXMvbmV0L2lwdjQvdGNwX3JtZW0gYW5kIHRjcHdtZW0KKyAgICAgKgorICAgICAqIEBwYXJhbSBidWZmZXJTaXplcyBpbiB0aGUgZm9ybWF0IG9mICJyZWFkTWluLCByZWFkSW5pdGlhbCwgcmVhZE1heCwKKyAgICAgKiAgICAgICAgd3JpdGVNaW4sIHdyaXRlSW5pdGlhbCwgd3JpdGVNYXgiCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIHNldEJ1ZmZlclNpemUoU3RyaW5nIGJ1ZmZlclNpemVzKSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBTdHJpbmdbXSB2YWx1ZXMgPSBidWZmZXJTaXplcy5zcGxpdCgiLCIpOworCisgICAgICAgICAgICBpZiAodmFsdWVzLmxlbmd0aCA9PSA2KSB7Cis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CisgICAgcHJpdmF0ZSB2b2lkIHN0cmluZ1RvRmlsZShTdHJpbmcgZmlsZW5hbWUsIFN0cmluZyBzdHJpbmcpIHRocm93cyBJT0V4Y2VwdGlvbiB7CisgICAgICAgIEZpbGVXcml0ZXIgb3V0ID0gbmV3IEZpbGVXcml0ZXIoZmlsZW5hbWUpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgb3V0LndyaXRlKHN0cmluZyk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBvdXQuY2xvc2UoKTsKKyAgICAgICAgfQorICAgIH0KKworCiAgICAgLyoqCiAgICAgICogQWRqdXN0IHRoZSBwZXItcHJvY2VzcyBkbnMgZW50cmllcyAobmV0LmRuczx4Pi48cGlkPikgYmFzZWQKICAgICAgKiBvbiB0aGUgaGlnaGVzdCBwcmlvcml0eSBhY3RpdmUgbmV0IHdoaWNoIHRoaXMgcHJvY2VzcyByZXF1ZXN0ZWQuCkBAIC0xMjI1LDcgKzE0MzQsNyBAQAogICAgICAgICAgICAgICAgIGZvciAoaW50IGo9MDsgajxwaWRzLnNpemUoKTsgaisrKSB7CiAgICAgICAgICAgICAgICAgICAgIEludGVnZXIgcGlkID0gKEludGVnZXIpcGlkcy5nZXQoaik7CiAgICAgICAgICAgICAgICAgICAgIGlmIChwaWQuaW50VmFsdWUoKSA9PSBteVBpZCkgewotICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nW10gZG5zTGlzdCA9IG50LmdldE5hbWVTZXJ2ZXJzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmdbXSBkbnNMaXN0ID0gZ2V0TmFtZVNlcnZlckxpc3QobnQuZ2V0RG5zUHJvcE5hbWVzKCkpOwogICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVQaWREbnMoZG5zTGlzdCwgbXlQaWQpOwogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRvQnVtcCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1bXBEbnMoKTsKQEAgLTEyNzksNyArMTQ4OCw3IEBACiAgICAgICAgICAgICBOZXR3b3JrU3RhdGVUcmFja2VyIG50ID0gbU5ldFRyYWNrZXJzW25ldFR5cGVdOwogICAgICAgICAgICAgaWYgKG50ICE9IG51bGwgJiYgbnQuZ2V0TmV0d29ya0luZm8oKS5pc0Nvbm5lY3RlZCgpICYmCiAgICAgICAgICAgICAgICAgICAgICFudC5pc1RlYXJkb3duUmVxdWVzdGVkKCkpIHsKLSAgICAgICAgICAgICAgICBTdHJpbmdbXSBkbnNMaXN0ID0gbnQuZ2V0TmFtZVNlcnZlcnMoKTsKKyAgICAgICAgICAgICAgICBTdHJpbmdbXSBkbnNMaXN0ID0gZ2V0TmFtZVNlcnZlckxpc3QobnQuZ2V0RG5zUHJvcE5hbWVzKCkpOwogICAgICAgICAgICAgICAgIGlmIChtTmV0QXR0cmlidXRlc1tuZXRUeXBlXS5pc0RlZmF1bHQoKSkgewogICAgICAgICAgICAgICAgICAgICBpbnQgaiA9IDE7CiAgICAgICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIGRucyA6IGRuc0xpc3QpIHsKQEAgLTEzNjIsNiArMTU3MSwxMyBAQAogICAgICAgICB9CiAgICAgICAgIHB3LnByaW50bG4oKTsKIAorICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIHB3LnByaW50bG4oIk5ldHdvcmtUcmFuc3Rpb25XYWtlTG9jayBpcyBjdXJyZW50bHkgIiArCisgICAgICAgICAgICAgICAgICAgIChtTmV0VHJhbnNpdGlvbldha2VMb2NrLmlzSGVsZCgpID8gIiIgOiAibm90ICIpICsgImhlbGQuIik7CisgICAgICAgICAgICBwdy5wcmludGxuKCJJdCB3YXMgbGFzdCByZXF1ZXN0ZWQgZm9yICIrbU5ldFRyYW5zaXRpb25XYWtlTG9ja0NhdXNlZEJ5KTsKKyAgICAgICAgfQorICAgICAgICBwdy5wcmludGxuKCk7CisKICAgICAgICAgbVRldGhlcmluZy5kdW1wKGZkLCBwdywgYXJncyk7CiAgICAgfQogCkBAIC0xNDUzLDYgKzE2NjksMjAgQEAKICAgICAgICAgICAgICAgICAgICAgRmVhdHVyZVVzZXIgdSA9IChGZWF0dXJlVXNlciltc2cub2JqOwogICAgICAgICAgICAgICAgICAgICB1LmV4cGlyZSgpOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIE5ldHdvcmtTdGF0ZVRyYWNrZXIuRVZFTlRfQ0xFQVJfTkVUX1RSQU5TSVRJT05fV0FLRUxPQ0s6CisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBjYXVzZWRCeSA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAoQ29ubmVjdGl2aXR5U2VydmljZS50aGlzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobXNnLmFyZzEgPT0gbU5ldFRyYW5zaXRpb25XYWtlTG9ja1NlcmlhbE51bWJlciAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTmV0VHJhbnNpdGlvbldha2VMb2NrLmlzSGVsZCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU5ldFRyYW5zaXRpb25XYWtlTG9jay5yZWxlYXNlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F1c2VkQnkgPSBtTmV0VHJhbnNpdGlvbldha2VMb2NrQ2F1c2VkQnk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKGNhdXNlZEJ5ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJOZXRUcmFuc2l0aW9uIFdha2Vsb2NrIGZvciAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F1c2VkQnkgKyAiIHJlbGVhc2VkIGJ5IHRpbWVvdXQiKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KQEAgLTE1MzYsNCArMTc2NiwyMyBAQAogICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5URVRIRVJfU1VQUE9SVEVELCBkZWZhdWx0VmFsKSAhPSAwKTsKICAgICAgICAgcmV0dXJuIHRldGhlckVuYWJsZWRJblNldHRpbmdzICYmIG1UZXRoZXJpbmdDb25maWdWYWxpZDsKICAgICB9CisKKyAgICAvLyBBbiBBUEkgTmV0d29ya1N0YXRlVHJhY2tlcnMgY2FuIGNhbGwgd2hlbiB0aGV5IGxvc2UgdGhlaXIgbmV0d29yay4KKyAgICAvLyBUaGlzIHdpbGwgYXV0b21hdGljYWxseSBiZSBjbGVhcmVkIGFmdGVyIFggc2Vjb25kcyBvciBhIG5ldHdvcmsgYmVjb21lcyBDT05ORUNURUQsCisgICAgLy8gd2hpY2hldmVyIGhhcHBlbnMgZmlyc3QuICBUaGUgdGltZXIgaXMgc3RhcnRlZCBieSB0aGUgZmlyc3QgY2FsbGVyIGFuZCBub3QKKyAgICAvLyByZXN0YXJ0ZWQgYnkgc3Vic2VxdWVudCBjYWxsZXJzLgorICAgIHB1YmxpYyB2b2lkIHJlcXVlc3ROZXR3b3JrVHJhbnNpdGlvbldha2Vsb2NrKFN0cmluZyBmb3JXaG9tKSB7CisgICAgICAgIGVuZm9yY2VDb25uZWN0aXZpdHlJbnRlcm5hbFBlcm1pc3Npb24oKTsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBpZiAobU5ldFRyYW5zaXRpb25XYWtlTG9jay5pc0hlbGQoKSkgcmV0dXJuOworICAgICAgICAgICAgbU5ldFRyYW5zaXRpb25XYWtlTG9ja1NlcmlhbE51bWJlcisrOworICAgICAgICAgICAgbU5ldFRyYW5zaXRpb25XYWtlTG9jay5hY3F1aXJlKCk7CisgICAg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9vdERpcmVjdG9yeSwgImltYWdlcyIpLmxpc3QoKTsKLSAgICAgICAgaW50IGNvdW50ID0gZmlsZXMubGVuZ3RoOwotCi0gICAgICAgIGlmIChjb3VudCA9PSAwKSB7Ci0gICAgICAgICAgICBTbG9nLmkoTE9HX1RBRywgImFkZERlZmF1bHRJbWFnZXM6IG5vIGltYWdlcyBmb3VuZCEiKTsKLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotCi0gICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgU3RyaW5nIG5hbWUgPSBmaWxlc1tpXTsKLSAgICAgICAgICAgIFN0cmluZyBwYXRoID0gcm9vdERpcmVjdG9yeSArICIvIiArIG5hbWU7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgSW1hZ2VzLk1lZGlhLmluc2VydEltYWdlKG1Db250ZW50UmVzb2x2ZXIsIHBhdGgsIG5hbWUsIG51bGwpOwotICAgICAgICAgICAgfSBjYXRjaCAoRmlsZU5vdEZvdW5kRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICBTbG9nLmUoTE9HX1RBRywgIkZhaWxlZCB0byBpbXBvcnQgaW1hZ2UgIiArIHBhdGgsIGUpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotICAgIAotICAgIHByaXZhdGUgZmluYWwgdm9pZCBhZGREZWZhdWx0RGF0YSgpCi0gICAgewotICAgICAgICBTbG9nLmkoTE9HX1RBRywgIkFkZGluZyBkZWZhdWx0IGRhdGEuLi4iKTsKLQotLy8gICAgICAgYWRkSW1hZ2UoIlZpb2xldCIsICJpbWFnZXMvdmlvbGV0LnBuZyIpOwotLy8gICAgICAgYWRkSW1hZ2UoIkNvcmt5IiwgImltYWdlcy9jb3JreS5wbmciKTsKLQotICAgICAgICAvLyBQRU5ESU5HOiBzaG91bGQgdGhpcyBiZSBkb25lIGhlcmU/IT8hCi0gICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KAotICAgICAgICAgICAgICAgIEludGVudC5BQ1RJT05fQ0FMTCwgVXJpLmZyb21QYXJ0cygidm9pY2VtYWlsIiwgIiIsIG51bGwpKTsKLSAgICAgICAgYWRkU2hvcnRjdXQoIjEiLCBpbnRlbnQpOwotICAgIH0KLQotICAgIHByaXZhdGUgZmluYWwgVXJpIGFkZEltYWdlKFN0cmluZyBuYW1lLCBVcmkgZmlsZSkKLSAgICB7Ci0gICAgICAgIENvbnRlbnRWYWx1ZXMgaW1hZ2V2ID0gbmV3IENvbnRlbnRWYWx1ZXMoKTsKLSAgICAgICAgaW1hZ2V2LnB1dCgibmFtZSIsIG5hbWUpOwotCi0gICAgICAgIFVyaSB1cmwgPSBudWxsOwotCi0gICAgICAgIEFzc2V0TWFuYWdlciBhc3MgPSBBc3NldE1hbmFnZXIuZ2V0U3lzdGVtKCk7Ci0gICAgICAgIElucHV0U3RyZWFtIGluID0gbnVsbDsKLSAgICAgICAgT3V0cHV0U3RyZWFtIG91dCA9IG51bGw7Ci0gICAgICAgIAotICAgICAgICB0cnkKLSAgICAgICAgewotICAgICAgICAgICAgaW4gPSBhc3Mub3BlbihmaWxlLnRvU3RyaW5nKCkpOwotCi0gICAgICAgICAgICB1cmwgPSBtQ29udGVudFJlc29sdmVyLmluc2VydChJbWFnZXMuTWVkaWEuSU5URVJOQUxfQ09OVEVOVF9VUkksIGltYWdldik7Ci0gICAgICAgICAgICBvdXQgPSBtQ29udGVudFJlc29sdmVyLm9wZW5PdXRwdXRTdHJlYW0odXJsKTsKLQotICAgICAgICAgICAgZmluYWwgaW50IHNpemUgPSA4ICogMTAyNDsKLSAgICAgICAgICAgIGJ5dGVbXSBidWYgPSBuZXcgYnl0ZVtzaXplXTsKLQotICAgICAgICAgICAgaW50IGNvdW50ID0gMDsKLSAgICAgICAgICAgIGRvCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICA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dGVyID0gMDsKICAgICBpbnQgbUZhaWxlZFBhc3N3b3JkQXR0ZW1wdHMgPSAwOwotICAgIAorCiAgICAgaW50IG1QYXNzd29yZE93bmVyID0gLTE7Ci0gICAgCisKICAgICBmaW5hbCBIYXNoTWFwPENvbXBvbmVudE5hbWUsIEFjdGl2ZUFkbWluPiBtQWRtaW5NYXAKICAgICAgICAgICAgID0gbmV3IEhhc2hNYXA8Q29tcG9uZW50TmFtZSwgQWN0aXZlQWRtaW4+KCk7CiAgICAgZmluYWwgQXJyYXlMaXN0PEFjdGl2ZUFkbWluPiBtQWRtaW5MaXN0CiAgICAgICAgICAgICA9IG5ldyBBcnJheUxpc3Q8QWN0aXZlQWRtaW4+KCk7Ci0gICAgCisKICAgICBzdGF0aWMgY2xhc3MgQWN0aXZlQWRtaW4gewogICAgICAgICBmaW5hbCBEZXZpY2VBZG1pbkluZm8gaW5mbzsKLSAgICAgICAgCisKICAgICAgICAgaW50IHBhc3N3b3JkUXVhbGl0eSA9IERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9VTlNQRUNJRklFRDsKICAgICAgICAgaW50IG1pbmltdW1QYXNzd29yZExlbmd0aCA9IDA7CisgICAgICAgIGludCBwYXNzd29yZEhpc3RvcnlMZW5ndGggPSAwOworICAgICAgICBpbnQgbWluaW11bVBhc3N3b3JkVXBwZXJDYXNlID0gMDsKKyAgICAgICAgaW50IG1pbmltdW1QYXNzd29yZExvd2VyQ2FzZSA9IDA7CisgICAgICAgIGludCBtaW5pbXVtUGFzc3dvcmRMZXR0ZXJzID0gMTsKKyAgICAgICAgaW50IG1pbmltdW1QYXNzd29yZE51bWVyaWMgPSAxOworICAgICAgICBpbnQgbWluaW11bVBhc3N3b3JkU3ltYm9scyA9IDE7CisgICAgICAgIGludCBtaW5pbXVtUGFzc3dvcmROb25MZXR0ZXIgPSAwOwogICAgICAgICBsb25nIG1heGltdW1UaW1lVG9VbmxvY2sgPSAwOwogICAgICAgICBpbnQgbWF4aW11bUZhaWxlZFBhc3N3b3Jkc0ZvcldpcGUgPSAwOwotICAgICAgICAKKwogICAgICAgICBBY3RpdmVBZG1pbihEZXZpY2VBZG1pbkluZm8gX2luZm8pIHsKICAgICAgICAgICAgIGluZm8gPSBfaW5mbzsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBpbnQgZ2V0VWlkKCkgeyByZXR1cm4gaW5mby5nZXRBY3Rpdml0eUluZm8oKS5hcHBsaWNhdGlvbkluZm8udWlkOyB9Ci0gICAgICAgIAorCiAgICAgICAgIHZvaWQgd3JpdGVUb1htbChYbWxTZXJpYWxpemVyIG91dCkKICAgICAgICAgICAgICAgICB0aHJvd3MgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uLCBJbGxlZ2FsU3RhdGVFeGNlcHRpb24sIElPRXhjZXB0aW9uIHsKICAgICAgICAgICAgIG91dC5zdGFydFRhZyhudWxsLCAicG9saWNpZXMiKTsKQEAgLTExMCw3ICsxMjMsNDIgQEAKICAgICAgICAgICAgICAgICBpZiAobWluaW11bVBhc3N3b3JkTGVuZ3RoID4gMCkgewogICAgICAgICAgICAgICAgICAgICBvdXQuc3RhcnRUYWcobnVsbCwgIm1pbi1wYXNzd29yZC1sZW5ndGgiKTsKICAgICAgICAgICAgICAgICAgICAgb3V0LmF0dHJpYnV0ZShudWxsLCAidmFsdWUiLCBJbnRlZ2VyLnRvU3RyaW5nKG1pbmltdW1QYXNzd29yZExlbmd0aCkpOwotICAgICAgICAgICAgICAgICAgICBvdXQuZW5kVGFnKG51bGwsICJtbi1wYXNzd29yZC1sZW5ndGgiKTsKKyAgICAgICAgICAgICAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAibWluLXBhc3N3b3JkLWxlbmd0aCIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZihwYXNzd29yZEhpc3RvcnlMZW5ndGggPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIG91dC5zdGFydFRhZyhudWxsLCAicGFzc3dvcmQtaGlzdG9yeS1sZW5ndGgiKTsKKyAgICAgICAgICAgICAgICAgICAgb3V0LmF0dHJpYnV0ZShudWxsLCAidmFsdWUiLCBJbnRlZ2VyLnRvU3RyaW5nKHBhc3N3b3JkSGlzdG9yeUxlbmd0aCkpOworICAgICAgICAgICAgICAgICAgICBvdXQuZW5kVGFnKG51bGwsICJwYXNzd29yZC1oaXN0b3J5LWxlbmd0aCIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAobWluaW11bVBhc3N3b3JkVXBwZXJDYXNlID4gMCkgeworICAgICAgICAgICAgICAgICAgICBvdXQuc3RhcnRUYWcobnVsbCwgIm1pbi1wYXNzd29yZC11cHBlcmNhc2UiKTsKKyAgICAgICAgICAgICAgICAgICAgb3V0LmF0dHJpYnV0ZShudWxsLCAidmFsdWUiLCBJbnRlZ2VyLnRvU3RyaW5nKG1pbmltdW1QYXNzd29yZFVwcGVyQ2FzZSkpOworICAgICAgICAgICAgICAgICAgICBvdXQuZW5kVGFnKG51bGwsICJtaW4tcGFzc3dvcmQtdXBwZXJjYXNlIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChtaW5pbXVtUGFzc3dvcmRMb3dlckNhc2UgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIG91dC5zdGFydFRhZyhudWxsLCAibWluLXBhc3N3b3JkLWxvd2VyY2FzZSIpOworICAgICAgICAgICAgICAgICAgICBvdXQuYXR0cmlidXRlKG51bGwsICJ2YWx1ZSIsIEludGVnZXIudG9TdHJpbmcobWluaW11bVBhc3N3b3JkTG93ZXJDYXNlKSk7CisgICAgICAgICAgICAgICAgICAgIG91dC5lbmRUYWcobnVsbCwgIm1pbi1wYXNzd29yZC1sb3dlcmNhc2UiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKG1pbmltdW1QYXNzd29yZExldHRlcnMgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIG91dC5zdGFydFRhZyhudWxsLCAibWluLXBhc3N3b3JkLWxldHRlcnMiKTsKKyAgICAgICAgICAgICAgICAgICAgb3V0LmF0dHJpYnV0ZShudWxsLCAidmFsdWUiLCBJbnRlZ2VyLnRvU3RyaW5nKG1pbmltdW1QYXNzd29yZExldHRlcnMpKTsKKyAgICAgICAgICAgICAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAibWluLXBhc3N3b3JkLWxldHRlcnMiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKG1pbmltdW1QYXNzd29yZE51bWVyaWMgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIG91dC5zdGFydFRhZyhudWxsLCAibWluLXBhc3N3b3JkLW51bWVyaWMiKTsKKyAgICAgICAgICAgICAgICAgICAgb3V0LmF0dHJpYnV0ZShudWxsLCAidmFsdWUiLCBJbnRlZ2VyLnRvU3RyaW5nKG1pbmltdW1QYXNzd29yZE51bWVyaWMpKTsKKyAgICAgICAgICAgICAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAibWluLXBhc3N3b3JkLW51bWVyaWMiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKG1pbmltdW1QYXNzd29yZFN5bWJvbHMgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIG91dC5zdGFydFRhZyhudWxsLCAibWluLXBhc3N3b3JkLXN5bWJvbHMiKTsKKyAgICAgICAgICAgICAgICAgICAgb3V0LmF0dHJpYnV0ZShudWxsLCAidmFsdWUiLCBJbnRlZ2VyLnRvU3RyaW5nKG1pbmltdW1QYXNzd29yZFN5bWJvbHMpKTsKKyAgICAgICAgICAgICAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAibWluLXBhc3N3b3JkLXN5bWJvbHMiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKG1pbmltdW1QYXNzd29yZE5vbkxldHRlciA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgb3V0LnN0YXJ0VGFnKG51bGwsICJtaW4tcGFzc3dvcmQtbm9ubGV0dGVyIik7CisgICAgICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgInZhbHVlIiwgSW50ZWdlci50b1N0cmluZyhtaW5pbXVtUGFzc3dvcmROb25MZXR0ZXIpKTsKKyAgICAgICAgICAgICAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAibWluLXBhc3N3b3JkLW5vbmxldHRlciIpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmIChtYXhpbXVtVGltZVRvVW5sb2NrICE9IERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9VTlNQRUNJRklFRCkgewpAQCAtMTI0LDcgKzE3Miw3IEBACiAgICAgICAgICAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAibWF4LWZhaWxlZC1wYXNzd29yZC13aXBlIik7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgdm9pZCByZWFkRnJvbVhtbChYbWxQdWxsUGFyc2VyIHBhcnNlcikKICAgICAgICAgICAgICAgICB0aHJvd3MgWG1sUHVsbFBhcnNlckV4Y2VwdGlvbiwgSU9FeGNlcHRpb24gewogICAgICAgICAgICAgaW50IG91dGVyRGVwdGggPSBwYXJzZXIuZ2V0RGVwdGgoKTsKQEAgLTE0Myw2ICsxOTEsMjcgQEAKICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCJtaW4tcGFzc3dvcmQtbGVuZ3RoIi5lcXVhbHModGFnKSkgewogICAgICAgICAgICAgICAgICAgICBtaW5pbXVtUGFzc3dvcmRMZW5ndGggPSBJbnRlZ2VyLnBhcnNlSW50KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZShudWxsLCAidmFsdWUiKSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgicGFzc3dvcmQtaGlzdG9yeS1sZW5ndGgiLmVxdWFscyh0YWcpKSB7CisgICAgICAgICAgICAgICAgICAgIHBhc3N3b3JkSGlzdG9yeUxlbmd0aCA9IEludGVnZXIucGFyc2VJbnQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsICJ2YWx1ZSIpKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCJtaW4tcGFzc3dvcmQtdXBwZXJjYXNlIi5lcXVhbHModGFnKSkgeworICAgICAgICAgICAgICAgICAgICBtaW5pbXVtUGFzc3dvcmRVcHBlckNhc2UgPSBJbnRlZ2VyLnBhcnNlSW50KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZShudWxsLCAidmFsdWUiKSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgibWluLXBhc3N3b3JkLWxvd2VyY2FzZSIuZXF1YWxzKHRhZykpIHsKKyAgICAgICAgICAgICAgICAgICAgbWluaW11bVBhc3N3b3JkTG93ZXJDYXNlID0gSW50ZWdlci5wYXJzZUludCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgInZhbHVlIikpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIm1pbi1wYXNzd29yZC1sZXR0ZXJzIi5lcXVhbHModGFnKSkgeworICAgICAgICAgICAgICAgICAgICBtaW5pbXVtUGFzc3dvcmRMZXR0ZXJzID0gSW50ZWdlci5wYXJzZUludCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgInZhbHVlIikpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIm1pbi1wYXNzd29yZC1udW1lcmljIi5lcXVhbHModGFnKSkgeworICAgICAgICAgICAgICAgICAgICBtaW5pbXVtUGFzc3dvcmROdW1lcmljID0gSW50ZWdlci5wYXJzZUludCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgInZhbHVlIikpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIm1pbi1wYXNzd29yZC1zeW1ib2xzIi5lcXVhbHModGFnKSkgeworICAgICAgICAgICAgICAgICAgICBtaW5pbXVtUGFzc3dvcmRTeW1ib2xzID0gSW50ZWdlci5wYXJzZUludCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgInZhbHVlIikpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIm1pbi1wYXNzd29yZC1ub25sZXR0ZXIiLmVxdWFscyh0YWcpKSB7CisgICAgICAgICAgICAgICAgICAgIG1pbmltdW1QYXNzd29yZE5vbkxldHRlciA9IEludGVnZXIucGFyc2VJbnQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsICJ2YWx1ZSIpKTsKICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCJtYXgtdGltZS10by11bmxvY2siLmVxdWFscyh0YWcpKSB7CiAgICAgICAgICAgICAgICAgICAgIG1heGltdW1UaW1lVG9VbmxvY2sgPSBMb25nLnBhcnNlTG9uZygKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgInZhbHVlIikpOwpAQCAtMTU1LDcgKzIyNCw3IEBACiAgICAgICAgICAgICAgICAgWG1sVXRpbHMuc2tpcEN1cnJlbnRUYWcocGFyc2VyKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICB2b2lkIGR1bXAoU3RyaW5nIHByZWZpeCwgUHJpbnRXcml0ZXIgcHcpIHsKICAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJ1aWQ9Iik7IHB3LnByaW50bG4oZ2V0VWlkKCkpOwogICAgICAgICAgICAgcHcucHJpbnQocHJlZml4KTsgcHcucHJpbnRsbigicG9saWNpZXM6Iik7CkBAIC0xNjYsMjMgKzIzNSwzNyBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJwYXNzd29yZFF1YWxpdHk9MHgiKTsKLSAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoSW50ZWdlci50b0hleFN0cmluZyhwYXNzd29yZFF1YWxpdHkpKTsKLSAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiBtaW5pbXVtUGFzc3dvcmRMZW5ndGg9Iik7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4oSW50ZWdlci50b0hleFN0cmluZyhwYXNzd29yZFF1YWxpdHkpKTsKKyAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJtaW5pbXVtUGFzc3dvcmRMZW5ndGg9Iik7CiAgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4obWluaW11bVBhc3N3b3JkTGVuZ3RoKTsKKyAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJwYXNzd29yZEhpc3RvcnlMZW5ndGg9Iik7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4ocGFzc3dvcmRIaXN0b3J5TGVuZ3RoKTsKKyAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJtaW5pbXVtUGFzc3dvcmRVcHBlckNhc2U9Iik7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4obWluaW11bVBhc3N3b3JkVXBwZXJDYXNlKTsKKyAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJtaW5pbXVtUGFzc3dvcmRMb3dlckNhc2U9Iik7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4obWluaW11bVBhc3N3b3JkTG93ZXJDYXNlKTsKKyAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJtaW5pbXVtUGFzc3dvcmRMZXR0ZXJzPSIpOworICAgICAgICAgICAgICAgICAgICBwdy5wcmludGxuKG1pbmltdW1QYXNzd29yZExldHRlcnMpOworICAgICAgICAgICAgcHcucHJpbnQocHJlZml4KTsgcHcucHJpbnQoIm1pbmltdW1QYXNzd29yZE51bWVyaWM9Iik7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4obWluaW11bVBhc3N3b3JkTnVtZXJpYyk7CisgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgibWluaW11bVBhc3N3b3JkU3ltYm9scz0iKTsKKyAgICAgICAgICAgICAgICAgICAgcHcucHJpbnRsbihtaW5pbXVtUGFzc3dvcmRTeW1ib2xzKTsKKyAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJtaW5pbXVtUGFzc3dvcmROb25MZXR0ZXI9Iik7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4obWluaW11bVBhc3N3b3JkTm9uTGV0dGVyKTsKICAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJtYXhpbXVtVGltZVRvVW5sb2NrPSIpOwogICAgICAgICAgICAgICAgICAgICBwdy5wcmludGxuKG1heGltdW1UaW1lVG9VbmxvY2spOwogICAgICAgICAgICAgcHcucHJpbnQocHJlZml4KTsgcHcucHJpbnQoIm1heGltdW1GYWlsZWRQYXNzd29yZHNGb3JXaXBlPSIpOwogICAgICAgICAgICAgICAgICAgICBwdy5wcmludGxuKG1heGltdW1GYWlsZWRQYXNzd29yZHNGb3JXaXBlKTsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIGNsYXNzIE15UGFja2FnZU1vbml0b3IgZXh0ZW5kcyBQYWNrYWdlTW9uaXRvciB7CiAgICAgICAgIHB1YmxpYyB2b2lkIG9uU29tZVBhY2thZ2VzQ2hhbmdlZCgpIHsKICAgICAgICAgICAgIHN5bmNocm9uaXplZCAoRGV2aWNlUG9saWN5TWFuYWdlclNlcnZpY2UudGhpcykgewogICAgICAgICAgICAgICAgIGJvb2xlYW4gcmVtb3ZlZCA9IGZhbHNlOwogICAgICAgICAgICAgICAgIGZvciAoaW50IGk9bUFkbWluTGlzdC5zaXplKCktMTsgaT49MDsgaS0tKSB7CiAgICAgICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFhID0gbUFkbWluTGlzdC5nZXQoaSk7Ci0gICAgICAgICAgICAgICAgICAgIGludCBjaGFuZ2UgPSBpc1BhY2thZ2VEaXNhcHBlYXJpbmcoYWEuaW5mby5nZXRQYWNrYWdlTmFtZSgpKTsgCisgICAgICAgICAgICAgICAgICAgIGludCBjaGFuZ2UgPSBpc1BhY2thZ2VEaXNhcHBlYXJpbmcoYWEuaW5mby5nZXRQYWNrYWdlTmFtZSgpKTsKICAgICAgICAgICAgICAgICAgICAgaWYgKGNoYW5nZSA9PSBQQUNLQUdFX1BFUk1BTkVOVF9DSEFOR0UKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBjaGFuZ2UgPT0gUEFDS0FHRV9URU1QT1JBUllfQ0hBTkdFKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBTbG9nLncoVEFHLCAiQWRtaW4gdW5leHBlY3RlZGx5IHVuaW5zdGFsbGVkOiAiCkBAIC0yMDcsNyArMjkwLDcgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIC8qKgogICAgICAqIEluc3RhbnRpYXRlcyB0aGUgc2VydmljZS4KICAgICAgKi8KQEAgLTIyNCw3ICszMDcsNyBAQAogICAgICAgICB9CiAgICAgICAgIHJldHVybiBtSVBvd2VyTWFuYWdlcjsKICAgICB9Ci0gICAgCisKICAgICBBY3RpdmVBZG1pbiBnZXRBY3RpdmVBZG1pblVuY2hlY2tlZExvY2tlZChDb21wb25lbnROYW1lIHdobykgewogICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IG1BZG1pbk1hcC5nZXQod2hvKTsKICAgICAgICAgaWYgKGFkbWluICE9IG51bGwKQEAgLTIzNCw3ICszMTcsNyBAQAogICAgICAgICB9CiAgICAgICAgIHJldHVybiBudWxsOwogICAgIH0KLSAgICAKKwogICAgIEFjdGl2ZUFkbWluIGdldEFjdGl2ZUFkbWluRm9yQ2FsbGVyTG9ja2VkKENvbXBvbmVudE5hbWUgd2hvLCBpbnQgcmVxUG9saWN5KQogICAgICAgICAgICAgdGhyb3dzIFNlY3VyaXR5RXhjZXB0aW9uIHsKICAgICAgICAgZmluYWwgaW50IGNhbGxpbmdVaWQgPSBCaW5kZXIuZ2V0Q2FsbGluZ1VpZCgpOwpAQCAtMjY1LDEzICszNDgsMTMgQEAKICAgICAgICAgICAgICAgICAgICAgKyBCaW5kZXIuZ2V0Q2FsbGluZ1VpZCgpICsgIiBmb3IgcG9saWN5ICMiICsgcmVxUG9saWN5KTsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHZvaWQgc2VuZEFkbWluQ29tbWFuZExvY2tlZChBY3RpdmVBZG1pbiBhZG1pbiwgU3RyaW5nIGFjdGlvbikgewogICAgICAgICBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChhY3Rpb24pOwogICAgICAgICBpbnRlbnQuc2V0Q29tcG9uZW50KGFkbWluLmluZm8uZ2V0Q29tcG9uZW50KCkpOwogICAgICAgICBtQ29udGV4dC5zZW5kQnJvYWRjYXN0KGludGVudCk7CiAgICAgfQotICAgIAorCiAgICAgdm9pZCBzZW5kQWRtaW5Db21tYW5kTG9ja2VkKFN0cmluZyBhY3Rpb24sIGludCByZXFQb2xpY3kpIHsKICAgICAgICAgZmluYWwgaW50IE4gPSBtQWRtaW5MaXN0LnNpemUoKTsKICAgICAgICAgaWYgKE4gPiAwKSB7CkBAIC0yODMsNyArMzY2LDcgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHZvaWQgcmVtb3ZlQWN0aXZlQWRtaW5Mb2NrZWQoQ29tcG9uZW50TmFtZSBhZG1pblJlY2VpdmVyKSB7CiAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gZ2V0QWN0aXZlQWRtaW5VbmNoZWNrZWRMb2NrZWQoYWRtaW5SZWNlaXZlcik7CiAgICAgICAgIGlmIChhZG1pbiAhPSBudWxsKSB7CkBAIC0yOTUsNyArMzc4LDcgQEAKICAgICAgICAgICAgIHZhbGlkYXRlUGFzc3dvcmRPd25lckxvY2tlZCgpOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIERldmljZUFkbWluSW5mbyBmaW5kQWRtaW4oQ29tcG9uZW50TmFtZSBhZG1pbk5hbWUpIHsKICAgICAgICAgSW50ZW50IHJlc29sdmVJbnRlbnQgPSBuZXcgSW50ZW50KCk7CiAgICAgICAgIHJlc29sdmVJbnRlbnQuc2V0Q29tcG9uZW50KGFkbWluTmFtZSk7CkBAIC0zMDQsNyArMzg3LDcgQEAKICAgICAgICAgaWYgKGluZm9zID09IG51bGwgfHwgaW5mb3Muc2l6ZSgpIDw9IDApIHsKICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlVua25vd24gYWRtaW46ICIgKyBhZG1pbk5hbWUpOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICByZXR1cm4gbmV3IERldmljZUFkbWluSW5mbyhtQ29udGV4dCwgaW5mb3MuZ2V0KDApKTsKICAgICAgICAgfSBjYXRjaCAoWG1sUHVsbFBhcnNlckV4Y2VwdGlvbiBlKSB7CkBAIC0zMTUsNyArMzk4LDcgQEAKICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHJpdmF0ZSBzdGF0aWMgSm91cm5hbGVkRmlsZSBtYWtlSm91cm5hbGVkRmlsZSgpIHsKICAgICAgICAgZmluYWwgU3RyaW5nIGJhc2UgPSAiL2RhdGEvc3lzdGVtL2RldmljZV9wb2xpY2llcy54bWwiOwogICAgICAgICByZXR1cm4gbmV3IEpvdXJuYWxlZEZpbGUobmV3IEZpbGUoYmFzZSksIG5ldyBGaWxlKGJhc2UgKyAiLnRtcCIpKTsKQEAgLTMzMSw3ICs0MTQsNyBAQAogICAgICAgICAgICAgb3V0LnN0YXJ0RG9jdW1lbnQobnVsbCwgdHJ1ZSk7CiAKICAgICAgICAgICAgIG91dC5zdGFydFRhZyhudWxsLCAicG9saWNpZXMiKTsKLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1BZG1pbkxpc3Quc2l6ZSgpOwogICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgewogICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFwID0gbUFkbWluTGlzdC5nZXQoaSk7CkBAIC0zNDIsMjYgKzQyNSwzNiBAQAogICAgICAgICAgICAgICAgICAgICBvdXQuZW5kVGFnKG51bGwsICJhZG1pbiIpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBpZiAobVBhc3N3b3JkT3duZXIgPj0gMCkgewogICAgICAgICAgICAgICAgIG91dC5zdGFydFRhZyhudWxsLCAicGFzc3dvcmQtb3duZXIiKTsKICAgICAgICAgICAgICAgICBvdXQuYXR0cmlidXRlKG51bGwsICJ2YWx1ZSIsIEludGVnZXIudG9TdHJpbmcobVBhc3N3b3JkT3duZXIpKTsKICAgICAgICAgICAgICAgICBvdXQuZW5kVGFnKG51bGwsICJwYXNzd29yZC1vd25lciIpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgIC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RRdWFsaXR5KSk7CiAgICAgICAgICAgICAgICAgb3V0LmF0dHJpYnV0ZShudWxsLCAibGVuZ3RoIiwgSW50ZWdlci50b1N0cmluZyhtQWN0aXZlUGFzc3dvcmRMZW5ndGgpKTsKKyAgICAgICAgICAgICAgICBvdXQuYXR0cmlidXRlKG51bGwsICJ1cHBlcmNhc2UiLCBJbnRlZ2VyLnRvU3RyaW5nKG1BY3RpdmVQYXNzd29yZFVwcGVyQ2FzZSkpOworICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgImxvd2VyY2FzZSIsIEludGVnZXIudG9TdHJpbmcobUFjdGl2ZVBhc3N3b3JkTG93ZXJDYXNlKSk7CisgICAgICAgICAgICAgICAgb3V0LmF0dHJpYnV0ZShudWxsLCAibGV0dGVycyIsIEludGVnZXIudG9TdHJpbmcobUFjdGl2ZVBhc3N3b3JkTGV0dGVycykpOworICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgIm51bWVyaWMiLCBJbnRlZ2VyCisgICAgICAgICAgICAgICAgICAgICAgICAudG9TdHJpbmcobUFjdGl2ZVBhc3N3b3JkTnVtZXJpYykpOworICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgInN5bWJvbHMiLCBJbnRlZ2VyLnRvU3RyaW5nKG1BY3RpdmVQYXNzd29yZFN5bWJvbHMpKTsKKyAgICAgICAgICAgICAgICBvdXQuYXR0cmlidXRlKG51bGwsICJub25sZXR0ZXIiLCBJbnRlZ2VyLnRvU3RyaW5nKG1BY3RpdmVQYXNzd29yZE5vbkxldHRlcikpOwogICAgICAgICAgICAgICAgIG91dC5lbmRUYWcobnVsbCwgImFjdGl2ZS1wYXNzd29yZCIpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgICAgIG91dC5lbmRUYWcobnVsbCwgInBvbGljaWVzIik7CiAKICAgICAgICAgICAgIG91dC5lbmREb2N1bWVudCgpOwpAQCAtNDM5LDYgKzUzMiwxOCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZShudWxsLCAicXVhbGl0eSIpKTsKICAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkTGVuZ3RoID0gSW50ZWdlci5wYXJzZUludCgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgImxlbmd0aCIpKTsKKyAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkVXBwZXJDYXNlID0gSW50ZWdlci5wYXJzZUludCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgInVwcGVyY2FzZSIpKTsKKyAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkTG93ZXJDYXNlID0gSW50ZWdlci5wYXJzZUludCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgImxvd2VyY2FzZSIpKTsKKyAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkTGV0dGVycyA9IEludGVnZXIucGFyc2VJbnQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsICJsZXR0ZXJzIikpOworICAgICAgICAgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmROdW1lcmljID0gSW50ZWdlci5wYXJzZUludCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgIm51bWVyaWMiKSk7CisgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZFN5bWJvbHMgPSBJbnRlZ2VyLnBhcnNlSW50KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZShudWxsLCAic3ltYm9scyIpKTsKKyAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkTm9uTGV0dGVyID0gSW50ZWdlci5wYXJzZUludCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgIm5vbmxldHRlciIpKTsKICAgICAgICAgICAgICAgICAgICAgWG1sVXRpbHMuc2tpcEN1cnJlbnRUYWcocGFyc2VyKTsKICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICBTbG9nLncoVEFHLCAiVW5rbm93biB0YWc6ICIgKyB0YWcpOwpAQCAtNDc2LDEwICs1ODEsMTYgQEAKICAgICAgICAgICAgICAgICAgICAgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKHV0aWxzLmdldEFjdGl2ZVBhc3N3b3JkUXVhbGl0eSgpKSk7CiAgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmRRdWFsaXR5ID0gRGV2aWNlUG9saWN5TWFuYWdlci5QQVNTV09SRF9RVUFMSVRZX1VOU1BFQ0lGSUVEOwogICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkTGVuZ3RoID0gMDsKKyAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZFVwcGVyQ2FzZSA9IDA7CisgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmRMb3dlckNhc2UgPSAwOworICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkTGV0dGVycyA9IDA7CisgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmROdW1lcmljID0gMDsKKyAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZFN5bWJvbHMgPSAwOworICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkTm9uTGV0dGVyID0gMDsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICB2YWxpZGF0ZVBhc3N3b3JkT3duZXJMb2NrZWQoKTsKLSAgICAgICAgCisKICAgICAgICAgbG9uZyB0aW1lTXMgPSBnZXRNYXhpbXVtVGltZVRvTG9jayhudWxsKTsKICAgICAgICAgaWYgKHRpbWVNcyA8PSAwKSB7CiAgICAgICAgICAgICB0aW1lTXMgPSBJbnRlZ2VyLk1BWF9WQUxVRTsKQEAgLTQ5OCwxMiArNjA5LDEzIEBACiAgICAgICAgICAgICBjYXNlIERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9OVU1FUklDOgogICAgICAgICAgICAgY2FzZSBEZXZpY2VQb2xpY3lNYW5hZ2VyLlBBU1NXT1JEX1FVQUxJVFlfQUxQSEFCRVRJQzoKICAgICAgICAgICAgIGNhc2UgRGV2aWNlUG9saWN5TWFuYWdlci5QQVNTV09SRF9RVUFMSVRZX0FMUEhBTlVNRVJJQzoKKyAgICAgICAgICAgIGNhc2UgRGV2aWNlUG9saWN5TWFuYWdlci5QQVNTV09SRF9RVUFMSVRZX0NPTVBMRVg6CiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkludmFsaWQgcXVhbGl0eSBjb25zdGFudDogMHgiCiAgICAgICAgICAgICAgICAgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKHF1YWxpdHkpKTsKICAgICB9Ci0gICAgCisKICAgICB2b2lkIHZhbGlkYXRlUGFzc3dvcmRPd25lckxvY2tlZCgpIHsKICAgICAgICAgaWYgKG1QYXNzd29yZE93bmVyID49IDApIHsKICAgICAgICAgICAgIGJvb2xlYW4gaGF2ZU93bmVyID0gZmFsc2U7CkBAIC01MjAsMTcgKzYzMiwxNyBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIHZvaWQgc3lzdGVtUmVhZHkoKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgbG9hZFNldHRpbmdzTG9ja2VkKCk7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgdm9pZCBzZXRBY3RpdmVBZG1pbihDb21wb25lbnROYW1lIGFkbWluUmVjZWl2ZXIpIHsKICAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKAogICAgICAgICAgICAgICAgIGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5CSU5EX0RFVklDRV9BRE1JTiwgbnVsbCk7Ci0gICAgICAgIAorCiAgICAgICAgIERldmljZUFkbWluSW5mbyBpbmZvID0gZmluZEFkbWluKGFkbWluUmVjZWl2ZXIpOwogICAgICAgICBpZiAoaW5mbyA9PSBudWxsKSB7CiAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJCYWQgYWRtaW46ICIgKyBhZG1pblJlY2VpdmVyKTsKQEAgLTU1MiwxMyArNjY0LDEzIEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgYm9vbGVhbiBpc0FkbWluQWN0aXZlKENvbXBvbmVudE5hbWUgYWRtaW5SZWNlaXZlcikgewogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIHJldHVybiBnZXRBY3RpdmVBZG1pblVuY2hlY2tlZExvY2tlZChhZG1pblJlY2VpdmVyKSAhPSBudWxsOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIExpc3Q8Q29tcG9uZW50TmFtZT4gZ2V0QWN0aXZlQWRtaW5zKCkgewogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIGZpbmFsIGludCBOID0gbUFkbWluTGlzdC5zaXplKCk7CkBAIC01NzIsNyArNjg0LDcgQEAKICAgICAgICAgICAgIHJldHVybiByZXM7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgYm9vbGVhbiBwYWNrYWdlSGFzQWN0aXZlQWRtaW5zKFN0cmluZyBwYWNrYWdlTmFtZSkgewogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIGZpbmFsIGludCBOID0gbUFkbWluTGlzdC5zaXplKCk7CkBAIC01ODQsNyArNjk2LDcgQEAKICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyB2b2lkIHJlbW92ZUFjdGl2ZUFkbWluKENvbXBvbmVudE5hbWUgYWRtaW5SZWNlaXZlcikgewogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gZ2V0QWN0aXZlQWRtaW5VbmNoZWNrZWRMb2NrZWQoYWRtaW5SZWNlaXZlcik7CkBAIC02MDMsMTAgKzcxNSwxMCBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIHZvaWQgc2V0UGFzc3dvcmRRdWFsaXR5KENvbXBvbmVudE5hbWUgd2hvLCBpbnQgcXVhbGl0eSkgewogICAgICAgICB2YWxpZGF0ZVF1YWxpdHlDb25zdGFudChxdWFsaXR5KTsKLSAgICAgICAgCisKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICBpZiAod2hvID09IG51bGwpIHsKICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgTnVsbFBvaW50ZXJFeGNlcHRpb24oIkNvbXBvbmVudE5hbWUgaXMgbnVsbCIpOwpAQCAtNjE5LDE2ICs3MzEsMTYgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyBpbnQgZ2V0UGFzc3dvcmRRdWFsaXR5KENvbXBvbmVudE5hbWUgd2hvKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgaW50IG1vZGUgPSBEZXZpY2VQb2xpY3lNYW5hZ2VyLlBBU1NXT1JEX1FVQUxJVFlfVU5TUEVDSUZJRUQ7Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgaWYgKHdobyAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBnZXRBY3RpdmVBZG1pblVuY2hlY2tlZExvY2tlZCh3aG8pOwogICAgICAgICAgICAgICAgIHJldHVybiBhZG1pbiAhPSBudWxsID8gYWRtaW4ucGFzc3dvcmRRdWFsaXR5IDogbW9kZTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1BZG1pbkxpc3Quc2l6ZSgpOwogICAgICAgICAgICAgZm9yICAoaW50IGk9MDsgaTxOOyBpKyspIHsKICAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IG1BZG1pbkxpc3QuZ2V0KGkpOwpAQCAtNjM5LDcgKzc1MSw3IEBACiAgICAgICAgICAgICByZXR1cm4gbW9kZTsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyB2b2lkIHNldFBhc3N3b3JkTWluaW11bUxlbmd0aChDb21wb25lbnROYW1lIHdobywgaW50IGxlbmd0aCkgewogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIGlmICh3aG8gPT0gbnVsbCkgewpAQCAtNjUzLDE2ICs3NjUsMTYgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyBpbnQgZ2V0UGFzc3dvcmRNaW5pbXVtTGVuZ3RoKENvbXBvbmVudE5hbWUgd2hvKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgaW50IGxlbmd0aCA9IDA7Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgaWYgKHdobyAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBnZXRBY3RpdmVBZG1pblVuY2hlY2tlZExvY2tlZCh3aG8pOwogICAgICAgICAgICAgICAgIHJldHVybiBhZG1pbiAhPSBudWxsID8gYWRtaW4ubWluaW11bVBhc3N3b3JkTGVuZ3RoIDogbGVuZ3RoOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgICAgIGZpbmFsIGludCBOID0gbUFkbWluTGlzdC5zaXplKCk7CiAgICAgICAgICAgICBmb3IgIChpbnQgaT0wOyBpPE47IGkrKykgewogICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gbUFkbWluTGlzdC5nZXQoaSk7CkBAIC02NzMsMTggKzc4NSwyNjcgQEAKICAgICAgICAgICAgIHJldHVybiBsZW5ndGg7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKKyAgICBwdWJsaWMgdm9pZCBzZXRQYXNzd29yZEhpc3RvcnlMZW5ndGgoQ29tcG9uZW50TmFtZSB3aG8sIGludCBsZW5ndGgpIHsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBpZiAod2hvID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgTnVsbFBvaW50ZXJFeGNlcHRpb24oIkNvbXBvbmVudE5hbWUgaXMgbnVsbCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgQWN0aXZlQWRtaW4gYXAgPSBnZXRBY3RpdmVBZG1pbkZvckNhbGxlckxvY2tlZCh3aG8sCisgICAgICAgICAgICAgICAgICAgIERldmljZUFkbWluSW5mby5VU0VTX1BPTElDWV9MSU1JVF9QQVNTV09SRCk7CisgICAgICAgICAgICBpZiAoYXAucGFzc3dvcmRIaXN0b3J5TGVuZ3RoICE9IGxlbmd0aCkgeworICAgICAgICAgICAgICAgIGFwLnBhc3N3b3JkSGlzdG9yeUxlbmd0aCA9IGxlbmd0aDsKKyAgICAgICAgICAgICAgICBzYXZlU2V0dGluZ3NMb2NrZWQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0UGFzc3dvcmRIaXN0b3J5TGVuZ3RoKENvbXBvbmVudE5hbWUgd2hvKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgaW50IGxlbmd0aCA9IDA7CisKKyAgICAgICAgICAgIGlmICh3aG8gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gZ2V0QWN0aXZlQWRtaW5VbmNoZWNrZWRMb2NrZWQod2hvKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gYWRtaW4gIT0gbnVsbCA/IGFkbWluLnBhc3N3b3JkSGlzdG9yeUxlbmd0aCA6IGxlbmd0aDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtQWRtaW5MaXN0LnNpemUoKTsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgTjsgaSsrKSB7CisgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBtQWRtaW5MaXN0LmdldChpKTsKKyAgICAgICAgICAgICAgICBpZiAobGVuZ3RoIDwgYWRtaW4ucGFzc3dvcmRIaXN0b3J5TGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9IGFkbWluLnBhc3N3b3JkSGlzdG9yeUxlbmd0aDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gbGVuZ3RoOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0UGFzc3dvcmRNaW5pbXVtVXBwZXJDYXNlKENvbXBvbmVudE5hbWUgd2hvLCBpbnQgbGVuZ3RoKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgaWYgKHdobyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE51bGxQb2ludGVyRXhjZXB0aW9uKCJDb21wb25lbnROYW1lIGlzIG51bGwiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFwID0gZ2V0QWN0aXZlQWRtaW5Gb3JDYWxsZXJMb2NrZWQod2hvLAorICAgICAgICAgICAgICAgICAgICBEZXZpY2VBZG1pbkluZm8uVVNFU19QT0xJQ1lfTElNSVRfUEFTU1dPUkQpOworICAgICAgICAgICAgaWYgKGFwLm1pbmltdW1QYXNzd29yZFVwcGVyQ2FzZSAhPSBsZW5ndGgpIHsKKyAgICAgICAgICAgICAgICBhcC5taW5pbXVtUGFzc3dvcmRVcHBlckNhc2UgPSBsZW5ndGg7CisgICAgICAgICAgICAgICAgc2F2ZVNldHRpbmdzTG9ja2VkKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldFBhc3N3b3JkTWluaW11bVVwcGVyQ2FzZShDb21wb25lbnROYW1lIHdobykgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIGludCBsZW5ndGggPSAwOworCisgICAgICAgICAgICBpZiAod2hvICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IGdldEFjdGl2ZUFkbWluVW5jaGVja2VkTG9ja2VkKHdobyk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGFkbWluICE9IG51bGwgPyBhZG1pbi5taW5pbXVtUGFzc3dvcmRVcHBlckNhc2UgOiBsZW5ndGg7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZpbmFsIGludCBOID0gbUFkbWluTGlzdC5zaXplKCk7CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CisgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBtQWRtaW5MaXN0LmdldChpKTsKKyAgICAgICAgICAgICAgICBpZiAobGVuZ3RoIDwgYWRtaW4ubWluaW11bVBhc3N3b3JkVXBwZXJDYXNlKSB7CisgICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9IGFkbWluLm1pbmltdW1QYXNzd29yZFVwcGVyQ2FzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gbGVuZ3RoOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0UGFzc3dvcmRNaW5pbXVtTG93ZXJDYXNlKENvbXBvbmVudE5hbWUgd2hvLCBpbnQgbGVuZ3RoKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgaWYgKHdobyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE51bGxQb2ludGVyRXhjZXB0aW9uKCJDb21wb25lbnROYW1lIGlzIG51bGwiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFwID0gZ2V0QWN0aXZlQWRtaW5Gb3JDYWxsZXJMb2NrZWQod2hvLAorICAgICAgICAgICAgICAgICAgICBEZXZpY2VBZG1pbkluZm8uVVNFU19QT0xJQ1lfTElNSVRfUEFTU1dPUkQpOworICAgICAgICAgICAgaWYgKGFwLm1pbmltdW1QYXNzd29yZExvd2VyQ2FzZSAhPSBsZW5ndGgpIHsKKyAgICAgICAgICAgICAgICBhcC5taW5pbXVtUGFzc3dvcmRMb3dlckNhc2UgPSBsZW5ndGg7CisgICAgICAgICAgICAgICAgc2F2ZVNldHRpbmdzTG9ja2VkKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldFBhc3N3b3JkTWluaW11bUxvd2VyQ2FzZShDb21wb25lbnROYW1lIHdobykgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIGludCBsZW5ndGggPSAwOworCisgICAgICAgICAgICBpZiAod2hvICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IGdldEFjdGl2ZUFkbWluVW5jaGVja2VkTG9ja2VkKHdobyk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGFkbWluICE9IG51bGwgPyBhZG1pbi5taW5pbXVtUGFzc3dvcmRMb3dlckNhc2UgOiBsZW5ndGg7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZpbmFsIGludCBOID0gbUFkbWluTGlzdC5zaXplKCk7CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CisgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBtQWRtaW5MaXN0LmdldChpKTsKKyAgICAgICAgICAgICAgICBpZiAobGVuZ3RoIDwgYWRtaW4ubWluaW11bVBhc3N3b3JkTG93ZXJDYXNlKSB7CisgICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9IGFkbWluLm1pbmltdW1QYXNzd29yZExvd2VyQ2FzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gbGVuZ3RoOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0UGFzc3dvcmRNaW5pbXVtTGV0dGVycyhDb21wb25lbnROYW1lIHdobywgaW50IGxlbmd0aCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIGlmICh3aG8gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBOdWxsUG9pbnRlckV4Y2VwdGlvbigiQ29tcG9uZW50TmFtZSBpcyBudWxsIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBBY3RpdmVBZG1pbiBhcCA9IGdldEFjdGl2ZUFkbWluRm9yQ2FsbGVyTG9ja2VkKHdobywKKyAgICAgICAgICAgICAgICAgICAgRGV2aWNlQWRtaW5JbmZvLlVTRVNfUE9MSUNZX0xJTUlUX1BBU1NXT1JEKTsKKyAgICAgICAgICAgIGlmIChhcC5taW5pbXVtUGFzc3dvcmRMZXR0ZXJzICE9IGxlbmd0aCkgeworICAgICAgICAgICAgICAgIGFwLm1pbmltdW1QYXNzd29yZExldHRlcnMgPSBsZW5ndGg7CisgICAgICAgICAgICAgICAgc2F2ZVNldHRpbmdzTG9ja2VkKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldFBhc3N3b3JkTWluaW11bUxldHRlcnMoQ29tcG9uZW50TmFtZSB3aG8pIHsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBpbnQgbGVuZ3RoID0gMDsKKworICAgICAgICAgICAgaWYgKHdobyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBnZXRBY3RpdmVBZG1pblVuY2hlY2tlZExvY2tlZCh3aG8pOworICAgICAgICAgICAgICAgIHJldHVybiBhZG1pbiAhPSBudWxsID8gYWRtaW4ubWluaW11bVBhc3N3b3JkTGV0dGVycyA6IGxlbmd0aDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtQWRtaW5MaXN0LnNpemUoKTsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKKyAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IG1BZG1pbkxpc3QuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChsZW5ndGggPCBhZG1pbi5taW5pbXVtUGFzc3dvcmRMZXR0ZXJzKSB7CisgICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9IGFkbWluLm1pbmltdW1QYXNzd29yZExldHRlcnM7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGxlbmd0aDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFBhc3N3b3JkTWluaW11bU51bWVyaWMoQ29tcG9uZW50TmFtZSB3aG8sIGludCBsZW5ndGgpIHsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBpZiAod2hvID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgTnVsbFBvaW50ZXJFeGNlcHRpb24oIkNvbXBvbmVudE5hbWUgaXMgbnVsbCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgQWN0aXZlQWRtaW4gYXAgPSBnZXRBY3RpdmVBZG1pbkZvckNhbGxlckxvY2tlZCh3aG8sCisgICAgICAgICAgICAgICAgICAgIERldmljZUFkbWluSW5mby5VU0VTX1BPTElDWV9MSU1JVF9QQVNTV09SRCk7CisgICAgICAgICAgICBpZiAoYXAubWluaW11bVBhc3N3b3JkTnVtZXJpYyAhPSBsZW5ndGgpIHsKKyAgICAgICAgICAgICAgICBhcC5taW5pbXVtUGFzc3dvcmROdW1lcmljID0gbGVuZ3RoOworICAgICAgICAgICAgICAgIHNhdmVTZXR0aW5nc0xvY2tlZCgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRQYXNzd29yZE1pbmltdW1OdW1lcmljKENvbXBvbmVudE5hbWUgd2hvKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgaW50IGxlbmd0aCA9IDA7CisKKyAgICAgICAgICAgIGlmICh3aG8gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gZ2V0QWN0aXZlQWRtaW5VbmNoZWNrZWRMb2NrZWQod2hvKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gYWRtaW4gIT0gbnVsbCA/IGFkbWluLm1pbmltdW1QYXNzd29yZE51bWVyaWMgOiBsZW5ndGg7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZpbmFsIGludCBOID0gbUFkbWluTGlzdC5zaXplKCk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IE47IGkrKykgeworICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gbUFkbWluTGlzdC5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGxlbmd0aCA8IGFkbWluLm1pbmltdW1QYXNzd29yZE51bWVyaWMpIHsKKyAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gYWRtaW4ubWluaW11bVBhc3N3b3JkTnVtZXJpYzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gbGVuZ3RoOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0UGFzc3dvcmRNaW5pbXVtU3ltYm9scyhDb21wb25lbnROYW1lIHdobywgaW50IGxlbmd0aCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIGlmICh3aG8gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBOdWxsUG9pbnRlckV4Y2VwdGlvbigiQ29tcG9uZW50TmFtZSBpcyBudWxsIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBBY3RpdmVBZG1pbiBhcCA9IGdldEFjdGl2ZUFkbWluRm9yQ2FsbGVyTG9ja2VkKHdobywKKyAgICAgICAgICAgICAgICAgICAgRGV2aWNlQWRtaW5JbmZvLlVTRVNfUE9MSUNZX0xJTUlUX1BBU1NXT1JEKTsKKyAgICAgICAgICAgIGlmIChhcC5taW5pbXVtUGFzc3dvcmRTeW1ib2xzICE9IGxlbmd0aCkgeworICAgICAgICAgICAgICAgIGFwLm1pbmltdW1QYXNzd29yZFN5bWJvbHMgPSBsZW5ndGg7CisgICAgICAgICAgICAgICAgc2F2ZVNldHRpbmdzTG9ja2VkKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldFBhc3N3b3JkTWluaW11bVN5bWJvbHMoQ29tcG9uZW50TmFtZSB3aG8pIHsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBpbnQgbGVuZ3RoID0gMDsKKworICAgICAgICAgICAgaWYgKHdobyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBnZXRBY3RpdmVBZG1pblVuY2hlY2tlZExvY2tlZCh3aG8pOworICAgICAgICAgICAgICAgIHJldHVybiBhZG1pbiAhPSBudWxsID8gYWRtaW4ubWluaW11bVBhc3N3b3JkU3ltYm9scyA6IGxlbmd0aDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtQWRtaW5MaXN0LnNpemUoKTsKKyAgICAgICAgICAgIGZvciAgKGludCBpPTA7IGk8TjsgaSsrKSB7CisgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBtQWRtaW5MaXN0LmdldChpKTsKKyAgICAgICAgICAgICAgICBpZiAobGVuZ3RoIDwgYWRtaW4ubWluaW11bVBhc3N3b3JkU3ltYm9scykgeworICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSBhZG1pbi5taW5pbXVtUGFzc3dvcmRTeW1ib2xzOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBsZW5ndGg7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRQYXNzd29yZE1pbmltdW1Ob25MZXR0ZXIoQ29tcG9uZW50TmFtZSB3aG8sIGludCBsZW5ndGgpIHsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBpZiAod2hvID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgTnVsbFBvaW50ZXJFeGNlcHRpb24oIkNvbXBvbmVudE5hbWUgaXMgbnVsbCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgQWN0aXZlQWRtaW4gYXAgPSBnZXRBY3RpdmVBZG1pbkZvckNhbGxlckxvY2tlZCh3aG8sCisgICAgICAgICAgICAgICAgICAgIERldmljZUFkbWluSW5mby5VU0VTX1BPTElDWV9MSU1JVF9QQVNTV09SRCk7CisgICAgICAgICAgICBpZiAoYXAubWluaW11bVBhc3N3b3JkTm9uTGV0dGVyICE9IGxlbmd0aCkgeworICAgICAgICAgICAgICAgIGFwLm1pbmltdW1QYXNzd29yZE5vbkxldHRlciA9IGxlbmd0aDsKKyAgICAgICAgICAgICAgICBzYXZlU2V0dGluZ3NMb2NrZWQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0UGFzc3dvcmRNaW5pbXVtTm9uTGV0dGVyKENvbXBvbmVudE5hbWUgd2hvKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgaW50IGxlbmd0aCA9IDA7CisKKyAgICAgICAgICAgIGlmICh3aG8gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gZ2V0QWN0aXZlQWRtaW5VbmNoZWNrZWRMb2NrZWQod2hvKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gYWRtaW4gIT0gbnVsbCA/IGFkbWluLm1pbmltdW1QYXNzd29yZE5vbkxldHRlciA6IGxlbmd0aDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtQWRtaW5MaXN0LnNpemUoKTsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKKyAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IG1BZG1pbkxpc3QuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChsZW5ndGggPCBhZG1pbi5taW5pbXVtUGFzc3dvcmROb25MZXR0ZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gYWRtaW4ubWluaW11bVBhc3N3b3JkTm9uTGV0dGVyOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBsZW5ndGg7CisgICAgICAgIH0KKyAgICB9CisKICAgICBwdWJsaWMgYm9vbGVhbiBpc0FjdGl2ZVBhc3N3b3JkU3VmZmljaWVudCgpIHsKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICAvLyBUaGlzIEFQSSBjYW4gb25seSBiZSBjYWxsZWQgYnkgYW4gYWN0aXZlIGRldmljZSBhZG1pbiwKICAgICAgICAgICAgIC8vIHNvIHRyeSB0byByZXRyaWV2ZSBpdCB0byBjaGVjayB0aGF0IHRoZSBjYWxsZXIgaXMgb25lLgogICAgICAgICAgICAgZ2V0QWN0aXZlQWRtaW5Gb3JDYWxsZXJMb2NrZWQobnVsbCwKICAgICAgICAgICAgICAgICAgICAgRGV2aWNlQWRtaW5JbmZvLlVTRVNfUE9MSUNZX0xJTUlUX1BBU1NXT1JEKTsKLSAgICAgICAgICAgIHJldHVybiBtQWN0aXZlUGFzc3dvcmRRdWFsaXR5ID49IGdldFBhc3N3b3JkUXVhbGl0eShudWxsKQotICAgICAgICAgICAgICAgICAgICAmJiBtQWN0aXZlUGFzc3dvcmRMZW5ndGggPj0gZ2V0UGFzc3dvcmRNaW5pbXVtTGVuZ3RoKG51bGwpOworICAgICAgICAgICAgaWYgKG1BY3RpdmVQYXNzd29yZFF1YWxpdHkgPCBnZXRQYXNzd29yZFF1YWxpdHkobnVsbCkKKyAgICAgICAgICAgICAgICAgICAgfHwgbUFjdGl2ZVBhc3N3b3JkTGVuZ3RoIDwgZ2V0UGFzc3dvcmRNaW5pbXVtTGVuZ3RoKG51bGwpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYobUFjdGl2ZVBhc3N3b3JkUXVhbGl0eSAhPSBEZXZpY2VQb2xpY3lNYW5hZ2VyLlBBU1NXT1JEX1FVQUxJVFlfQ09NUExFWCkgeworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIG1BY3RpdmVQYXNzd29yZFVwcGVyQ2FzZSA+PSBnZXRQYXNzd29yZE1pbmltdW1VcHBlckNhc2UobnVsbCkKKyAgICAgICAgICAgICAgICAgICAgJiYgbUFjdGl2ZVBhc3N3b3JkTG93ZXJDYXNlID49IGdldFBhc3N3b3JkTWluaW11bUxvd2VyQ2FzZShudWxsKQorICAgICAgICAgICAgICAgICAgICAmJiBtQWN0aXZlUGFzc3dvcmRMZXR0ZXJzID49IGdldFBhc3N3b3JkTWluaW11bUxldHRlcnMobnVsbCkKKyAgICAgICAgICAgICAgICAgICAgJiYgbUFjdGl2ZVBhc3N3b3JkTnVtZXJpYyA+PSBnZXRQYXNzd29yZE1pbmltdW1OdW1lcmljKG51bGwpCisgICAgICAgICAgICAgICAgICAgICYmIG1BY3RpdmVQYXNzd29yZFN5bWJvbHMgPj0gZ2V0UGFzc3dvcmRNaW5pbXVtU3ltYm9scyhudWxsKQorICAgICAgICAgICAgICAgICAgICAmJiBtQWN0aXZlUGFzc3dvcmROb25MZXR0ZXIgPj0gZ2V0UGFzc3dvcmRNaW5pbXVtTm9uTGV0dGVyKG51bGwpOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIGludCBnZXRDdXJyZW50RmFpbGVkUGFzc3dvcmRBdHRlbXB0cygpIHsKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICAvLyBUaGlzIEFQSSBjYW4gb25seSBiZSBjYWxsZWQgYnkgYW4gYWN0aXZlIGRldmljZSBhZG1pbiwKQEAgLTY5NCw3ICsxMDU1LDcgQEAKICAgICAgICAgICAgIHJldHVybiBtRmFpbGVkUGFzc3dvcmRBdHRlbXB0czsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyB2b2lkIHNldE1heGltdW1GYWlsZWRQYXNzd29yZHNGb3JXaXBlKENvbXBvbmVudE5hbWUgd2hvLCBpbnQgbnVtKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgLy8gVGhpcyBBUEkgY2FuIG9ubHkgYmUgY2FsbGVkIGJ5IGFuIGFjdGl2ZSBkZXZpY2UgYWRtaW4sCkBAIC03MDksMTYgKzEwNzAsMTYgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyBpbnQgZ2V0TWF4aW11bUZhaWxlZFBhc3N3b3Jkc0ZvcldpcGUoQ29tcG9uZW50TmFtZSB3aG8pIHsKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICBpbnQgY291bnQgPSAwOwotICAgICAgICAgICAgCisKICAgICAgICAgICAgIGlmICh3aG8gIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gZ2V0QWN0aXZlQWRtaW5VbmNoZWNrZWRMb2NrZWQod2hvKTsKICAgICAgICAgICAgICAgICByZXR1cm4gYWRtaW4gIT0gbnVsbCA/IGFkbWluLm1heGltdW1GYWlsZWRQYXNzd29yZHNGb3JXaXBlIDogY291bnQ7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtQWRtaW5MaXN0LnNpemUoKTsKICAgICAgICAgICAgIGZvciAgKGludCBpPTA7IGk8TjsgaSsrKSB7CiAgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBtQWRtaW5MaXN0LmdldChpKTsKQEAgLTczMiw3ICsxMDkzLDcgQEAKICAgICAgICAgICAgIHJldHVybiBjb3VudDsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyBib29sZWFuIHJlc2V0UGFzc3dvcmQoU3RyaW5nIHBhc3N3b3JkLCBpbnQgZmxhZ3MpIHsKICAgICAgICAgaW50IHF1YWxpdHk7CiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewpAQCAtNzQzLDE0ICsxMTA0LDE1IEBACiAgICAgICAgICAgICBxdWFsaXR5ID0gZ2V0UGFzc3dvcmRRdWFsaXR5KG51bGwpOwogICAgICAgICAgICAgaWYgKHF1YWxpdHkgIT0gRGV2aWNlUG9saWN5TWFuYWdlci5QQVNTV09SRF9RVUFMSVRZX1VOU1BFQ0lGSUVEKSB7CiAgICAgICAgICAgICAgICAgaW50IHJlYWxRdWFsaXR5ID0gTG9ja1BhdHRlcm5VdGlscy5jb21wdXRlUGFzc3dvcmRRdWFsaXR5KHBhc3N3b3JkKTsKLSAgICAgICAgICAgICAgICBpZiAocmVhbFF1YWxpdHkgPCBxdWFsaXR5KSB7CisgICAgICAgICAgICAgICAgaWYgKHJlYWxRdWFsaXR5IDwgcXVhbGl0eQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgcXVhbGl0eSAhPSBEZXZpY2VQb2xpY3lNYW5hZ2VyLlBBU1NXT1JEX1FVQUxJVFlfQ09NUExFWCkgewogICAgICAgICAgICAgICAgICAgICBTbG9nLncoVEFHLCAicmVzZXRQYXNzd29yZDogcGFzc3dvcmQgcXVhbGl0eSAweCIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIEludGVnZXIudG9IZXhTdHJpbmcocXVhbGl0eSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZG9lcyBub3QgbWVldCByZXF1aXJlZCBxdWFsaXR5IDB4IgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgSW50ZWdlci50b0hleFN0cmluZyhxdWFsaXR5KSk7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcXVhbGl0eSA9IHJlYWxRdWFsaXR5OworICAgICAgICAgICAgICAgIHF1YWxpdHkgPSBNYXRoLm1heChyZWFsUXVhbGl0eSwgcXVhbGl0eSk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpbnQgbGVuZ3RoID0gZ2V0UGFzc3dvcmRNaW5pbXVtTGVuZ3RoKG51bGwpOwogICAgICAgICAgICAgaWYgKHBhc3N3b3JkLmxlbmd0aCgpIDwgbGVuZ3RoKSB7CkBAIC03NTgsMTQgKzExMjAsODYgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBkb2VzIG5vdCBtZWV0IHJlcXVpcmVkIGxlbmd0aCAiICsgbGVuZ3RoKTsKICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAocXVhbGl0eSA9PSBEZXZpY2VQb2xpY3lNYW5hZ2VyLlBBU1NXT1JEX1FVQUxJVFlfQ09NUExFWCkgeworICAgICAgICAgICAgICAgIGludCBsZXR0ZXJzID0gMDsKKyAgICAgICAgICAgICAgICBpbnQgdXBwZXJjYXNlID0gMDsKKyAgICAgICAgICAgICAgICBpbnQgbG93ZXJjYXNlID0gMDsKKyAgICAgICAgICAgICAgICBpbnQgbnVtYmVycyA9IDA7CisgICAgICAgICAgICAgICAgaW50IHN5bWJvbHMgPSAwOworICAgICAgICAgICAgICAgIGludCBub25sZXR0ZXIgPSAwOworICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgcGFzc3dvcmQubGVuZ3RoKCk7IGkrKykgeworICAgICAgICAgICAgICAgICAgICBjaGFyIGMgPSBwYXNzd29yZC5jaGFyQXQoaSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChjID49ICdBJyAmJiBjIDw9ICdaJykgeworICAgICAgICAgICAgICAgICAgICAgICAgbGV0dGVycysrOworICAgICAgICAgICAgICAgICAgICAgICAgdXBwZXJjYXNlKys7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoYyA+PSAnYScgJiYgYyA8PSAneicpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxldHRlcnMrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxvd2VyY2FzZSsrOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGMgPj0gJzAnICYmIGMgPD0gJzknKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBudW1iZXJzKys7CisgICAgICAgICAgICAgICAgICAgICAgICBub25sZXR0ZXIrKzsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN5bWJvbHMrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgIG5vbmxldHRlcisrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGludCBuZWVkZWRMZXR0ZXJzID0gZ2V0UGFzc3dvcmRNaW5pbXVtTGV0dGVycyhudWxsKTsKKyAgICAgICAgICAgICAgICBpZihsZXR0ZXJzIDwgbmVlZGVkTGV0dGVycykgeworICAgICAgICAgICAgICAgICAgICBTbG9nLncoVEFHLCAicmVzZXRQYXNzd29yZDogbnVtYmVyIG9mIGxldHRlcnMgIiArIGxldHRlcnMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZG9lcyBub3QgbWVldCByZXF1aXJlZCBudW1iZXIgb2YgbGV0dGVycyAiICsgbmVlZGVkTGV0dGVycyk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaW50IG5lZWRlZE51bWJlcnMgPSBnZXRQYXNzd29yZE1pbmltdW1OdW1lcmljKG51bGwpOworICAgICAgICAgICAgICAgIGlmIChudW1iZXJzIDwgbmVlZGVkTnVtYmVycykgeworICAgICAgICAgICAgICAgICAgICBTbG9nCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLncoVEFHLCAicmVzZXRQYXNzd29yZDogbnVtYmVyIG9mIG51bWVyaWNhbCBkaWdpdHMgIiArIG51bWJlcnMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBkb2VzIG5vdCBtZWV0IHJlcXVpcmVkIG51bWJlciBvZiBudW1lcmljYWwgZGlnaXRzICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbmVlZGVkTnVtYmVycyk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaW50IG5lZWRlZExvd2VyQ2FzZSA9IGdldFBhc3N3b3JkTWluaW11bUxvd2VyQ2FzZShudWxsKTsKKyAgICAgICAgICAgICAgICBpZiAobG93ZXJjYXNlIDwgbmVlZGVkTG93ZXJDYXNlKSB7CisgICAgICAgICAgICAgICAgICAgIFNsb2cudyhUQUcsICJyZXNldFBhc3N3b3JkOiBudW1iZXIgb2YgbG93ZXJjYXNlIGxldHRlcnMgIiArIGxvd2VyY2FzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBkb2VzIG5vdCBtZWV0IHJlcXVpcmVkIG51bWJlciBvZiBsb3dlcmNhc2UgbGV0dGVycyAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBuZWVkZWRMb3dlckNhc2UpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGludCBuZWVkZWRVcHBlckNhc2UgPSBnZXRQYXNzd29yZE1pbmltdW1VcHBlckNhc2UobnVsbCk7CisgICAgICAgICAgICAgICAgaWYgKHVwcGVyY2FzZSA8IG5lZWRlZFVwcGVyQ2FzZSkgeworICAgICAgICAgICAgICAgICAgICBTbG9nLncoVEFHLCAicmVzZXRQYXNzd29yZDogbnVtYmVyIG9mIHVwcGVyY2FzZSBsZXR0ZXJzICIgKyB1cHBlcmNhc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZG9lcyBub3QgbWVldCByZXF1aXJlZCBudW1iZXIgb2YgdXBwZXJjYXNlIGxldHRlcnMgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbmVlZGVkVXBwZXJDYXNlKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpbnQgbmVlZGVkU3ltYm9scyA9IGdldFBhc3N3b3JkTWluaW11bVN5bWJvbHMobnVsbCk7CisgICAgICAgICAgICAgICAgaWYgKHN5bWJvbHMgPCBuZWVkZWRTeW1ib2xzKSB7CisgICAgICAgICAgICAgICAgICAgIFNsb2cudyhUQUcsICJyZXNldFBhc3N3b3JkOiBudW1iZXIgb2Ygc3BlY2lhbCBzeW1ib2xzICIgKyBzeW1ib2xzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGRvZXMgbm90IG1lZXQgcmVxdWlyZWQgbnVtYmVyIG9mIHNwZWNpYWwgc3ltYm9scyAiICsgbmVlZGVkU3ltYm9scyk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaW50IG5lZWRlZE5vbkxldHRlciA9IGdldFBhc3N3b3JkTWluaW11bU5vbkxldHRlcihudWxsKTsKKyAgICAgICAgICAgICAgICBpZiAobm9ubGV0dGVyIDwgbmVlZGVkTm9uTGV0dGVyKSB7CisgICAgICAgICAgICAgICAgICAgIFNsb2cudyhUQUcsICJyZXNldFBhc3N3b3JkOiBudW1iZXIgb2Ygbm9uLWxldHRlciBjaGFyYWN0ZXJzICIgKyBub25sZXR0ZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZG9lcyBub3QgbWVldCByZXF1aXJlZCBudW1iZXIgb2Ygbm9uLWxldHRlciBjaGFyYWN0ZXJzICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArIG5lZWRlZE5vbkxldHRlcik7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIExvY2tQYXR0ZXJuVXRpbHMgdXRpbHMgPSBuZXcgTG9ja1BhdHRlcm5VdGlscyhtQ29udGV4dCk7CisgICAgICAgICAgICBpZih1dGlscy5jaGVja1Bhc3N3b3JkSGlzdG9yeShwYXNzd29yZCkpIHsKKyAgICAgICAgICAgICAgICBTbG9nLncoVEFHLCAicmVzZXRQYXNzd29yZDogcGFzc3dvcmQgaXMgdGhlIHNhbWUgYXMgb25lIG9mIHRoZSBsYXN0ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgZ2V0UGFzc3dvcmRIaXN0b3J5TGVuZ3RoKG51bGwpICsgIiBwYXNzd29yZHMiKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgaW50IGNhbGxpbmdVaWQgPSBCaW5kZXIuZ2V0Q2FsbGluZ1VpZCgpOwogICAgICAgICBpZiAobVBhc3N3b3JkT3duZXIgPj0gMCAmJiBtUGFzc3dvcmRPd25lciAhPSBjYWxsaW5nVWlkKSB7CiAgICAgICAgICAgICBTbG9nLncoVEFHLCAicmVzZXRQYXNzd29yZDogYWxyZWFkeSBzZXQgYnkgYW5vdGhlciB1aWQgYW5kIG5vdCBlbnRlcmVkIGJ5IHVzZXIiKTsKICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICAvLyBEb24ndCBkbyB0aGlzIHdpdGggdGhlIGxvY2sgaGVsZCwgYmVjYXVzZSBpdCBpcyBnb2luZyB0byBjYWxsCiAgICAgICAgIC8vIGJhY2sgaW4gdG8gdGhlIHNlcnZpY2UuCiAgICAgICAgIGxvbmcgaWRlbnQgPSBCaW5kZXIuY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKQEAgLTc4MywxMCArMTIxNywxMCBAQAogICAgICAgICB9IGZpbmFsbHkgewogICAgICAgICAgICAgQmluZGVyLnJlc3RvcmVDYWxsaW5nSWRlbnRpdHkoaWRlbnQpOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIHJldHVybiB0cnVlOwogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyB2b2lkIHNldE1heGltdW1UaW1lVG9Mb2NrKENvbXBvbmVudE5hbWUgd2hvLCBsb25nIHRpbWVNcykgewogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIGlmICh3aG8gPT0gbnVsbCkgewpAQCAtNzk2LDE2ICsxMjMwLDE2IEBACiAgICAgICAgICAgICAgICAgICAgIERldmljZUFkbWluSW5mby5VU0VTX1BPTElDWV9GT1JDRV9MT0NLKTsKICAgICAgICAgICAgIGlmIChhcC5tYXhpbXVtVGltZVRvVW5sb2NrICE9IHRpbWVNcykgewogICAgICAgICAgICAgICAgIGFwLm1heGltdW1UaW1lVG9VbmxvY2sgPSB0aW1lTXM7Ci0gICAgICAgICAgICAgICAgCisKICAgICAgICAgICAgICAgICBsb25nIGlkZW50ID0gQmluZGVyLmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CiAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgc2F2ZVNldHRpbmdzTG9ja2VkKCk7Ci0gICAgICAgICAgICAgICAgICAgIAorCiAgICAgICAgICAgICAgICAgICAgIHRpbWVNcyA9IGdldE1heGltdW1UaW1lVG9Mb2NrKG51bGwpOwogICAgICAgICAgICAgICAgICAgICBpZiAodGltZU1zIDw9IDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVNcyA9IEludGVnZXIuTUFYX1ZBTFVFOwogICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIAorCiAgICAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBnZXRJUG93ZXJNYW5hZ2VyKCkuc2V0TWF4aW11bVNjcmVlbk9mZlRpbWVvdW50KChpbnQpdGltZU1zKTsKICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKQEAgLTgxNywxNiArMTI1MSwxNiBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIGxvbmcgZ2V0TWF4aW11bVRpbWVUb0xvY2soQ29tcG9uZW50TmFtZSB3aG8pIHsKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICBsb25nIHRpbWUgPSAwOwotICAgICAgICAgICAgCisKICAgICAgICAgICAgIGlmICh3aG8gIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gZ2V0QWN0aXZlQWRtaW5VbmNoZWNrZWRMb2NrZWQod2hvKTsKICAgICAgICAgICAgICAgICByZXR1cm4gYWRtaW4gIT0gbnVsbCA/IGFkbWluLm1heGltdW1UaW1lVG9VbmxvY2sgOiB0aW1lOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgICAgIGZpbmFsIGludCBOID0gbUFkbWluTGlzdC5zaXplKCk7CiAgICAgICAgICAgICBmb3IgIChpbnQgaT0wOyBpPE47IGkrKykgewogICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gbUFkbWluTGlzdC5nZXQoaSk7CkBAIC04NDAsNyArMTI3NCw3IEBACiAgICAgICAgICAgICByZXR1cm4gdGltZTsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyB2b2lkIGxvY2tOb3coKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgLy8gVGhpcyBBUEkgY2FuIG9ubHkgYmUgY2FsbGVkIGJ5IGFuIGFjdGl2ZSBkZXZpY2UgYWRtaW4sCkBAIC04NTcsNyArMTI5MSw3IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICB2b2lkIHdpcGVEYXRhTG9ja2VkKGludCBmbGFncykgewogICAgICAgICB0cnkgewogICAgICAgICAgICAgUmVjb3ZlcnlTeXN0ZW0ucmVib290V2lwZVVzZXJEYXRhKG1Db250ZXh0KTsKQEAgLTg2NSw3ICsxMjk5LDcgQEAKICAgICAgICAgICAgIFNsb2cudyhUQUcsICJGYWlsZWQgcmVxdWVzdGluZyBkYXRhIHdpcGUiLCBlKTsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyB2b2lkIHdpcGVEYXRhKGludCBmbGFncykgewogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIC8vIFRoaXMgQVBJIGNhbiBvbmx5IGJlIGNhbGxlZCBieSBhbiBhY3RpdmUgZGV2aWNlIGFkbWluLApAQCAtODgwLDExICsxMzE0LDExIEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgdm9pZCBnZXRSZW1vdmVXYXJuaW5nKENvbXBvbmVudE5hbWUgY29tcCwgZmluYWwgUmVtb3RlQ2FsbGJhY2sgcmVzdWx0KSB7CiAgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbigKICAgICAgICAgICAgICAgICBhbmRyb2lkLk1hbmlmZXN0LnBlcm1pc3Npb24uQklORF9ERVZJQ0VfQURNSU4sIG51bGwpOwotICAgICAgICAKKwogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gZ2V0QWN0aXZlQWRtaW5VbmNoZWNrZWRMb2NrZWQoY29tcCk7CiAgICAgICAgICAgICBpZiAoYWRtaW4gPT0gbnVsbCkgewpAQCAtOTA3LDIwICsxMzQxLDMwIEBACiAgICAgICAgICAgICB9LCBudWxsLCBBY3Rpdml0eS5SRVNVTFRfT0ssIG51bGwsIG51bGwpOwogICAgICAgICB9CiAgICAgfQotICAgIAotICAgIHB1YmxpYyB2b2lkIHNldEFjdGl2ZVBhc3N3b3JkU3RhdGUoaW50IHF1YWxpdHksIGludCBsZW5ndGgpIHsKKworICAgIHB1YmxpYyB2b2lkIHNldEFjdGl2ZVBhc3N3b3JkU3RhdGUoaW50IHF1YWxpdHksIGludCBsZW5ndGgsIGludCBsZXR0ZXJzLCBpbnQgdXBwZXJjYXNlLAorICAgICAgICAgICAgaW50IGxvd2VyY2FzZSwgaW50IG51bWJlcnMsIGludCBzeW1ib2xzLCBpbnQgbm9ubGV0dGVyKSB7CiAgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbigKICAgICAgICAgICAgICAgICBhbmRyb2lkLk1hbmlmZXN0LnBlcm1pc3Npb24uQklORF9ERVZJQ0VfQURNSU4sIG51bGwpOwotICAgICAgICAKKwogICAgICAgICB2YWxpZGF0ZVF1YWxpdHlDb25zdGFudChxdWFsaXR5KTsKLSAgICAgICAgCisKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICBpZiAobUFjdGl2ZVBhc3N3b3JkUXVhbGl0eSAhPSBxdWFsaXR5IHx8IG1BY3RpdmVQYXNzd29yZExlbmd0aCAhPSBsZW5ndGgKLSAgICAgICAgICAgICAgICAgICAgfHwgbUZhaWxlZFBhc3N3b3JkQXR0ZW1wdHMgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICB8fCBtRmFpbGVkUGFzc3dvcmRBdHRlbXB0cyAhPSAwIHx8IG1BY3RpdmVQYXNzd29yZExldHRlcnMgIT0gbGV0dGVycworICAgICAgICAgICAgICAgICAgICB8fCBtQWN0aXZlUGFzc3dvcmRVcHBlckNhc2UgIT0gdXBwZXJjYXNlCisgICAgICAgICAgICAgICAgICAgIHx8IG1BY3RpdmVQYXNzd29yZExvd2VyQ2FzZSAhPSBsb3dlcmNhc2UgfHwgbUFjdGl2ZVBhc3N3b3JkTnVtZXJpYyAhPSBudW1iZXJzCisgICAgICAgICAgICAgICAgICAgIHx8IG1BY3RpdmVQYXNzd29yZFN5bWJvbHMgIT0gc3ltYm9scyB8fCBtQWN0aXZlUGFzc3dvcmROb25MZXR0ZXIgIT0gbm9ubGV0dGVyKSB7CiAgICAgICAgICAgICAgICAgbG9uZyBpZGVudCA9IEJpbmRlci5jbGVhckNhbGxpbmdJZGVudGl0eSgpOwogICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZFF1YWxpdHkgPSBxdWFsaXR5OwogICAgICAgICAgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmRMZW5ndGggPSBsZW5ndGg7CisgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZExldHRlcnMgPSBsZXR0ZXJzOworICAgICAgICAgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmRMb3dlckNhc2UgPSBsb3dlcmNhc2U7CisgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZFVwcGVyQ2FzZSA9IHVwcGVyY2FzZTsKKyAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkTnVtZXJpYyA9IG51bWJlcnM7CisgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZFN5bWJvbHMgPSBzeW1ib2xzOworICAgICAgICAgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmROb25MZXR0ZXIgPSBub25sZXR0ZXI7CiAgICAgICAgICAgICAgICAgICAgIG1GYWlsZWRQYXNzd29yZEF0dGVtcHRzID0gMDsKICAgICAgICAgICAgICAgICAgICAgc2F2ZVNldHRpbmdzTG9ja2VkKCk7CiAgICAgICAgICAgICAgICAgICAgIHNlbmRBZG1pbkNvbW1hbmRMb2NrZWQoRGV2aWNlQWRtaW5SZWNlaXZlci5BQ1RJT05fUEFTU1dPUkRfQ0hBTkdFRCwKQEAgLTkzMSwxMSArMTM3NSwxMSBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIHZvaWQgcmVwb3J0RmFpbGVkUGFzc3dvcmRBdHRlbXB0KCkgewogICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oCiAgICAgICAgICAgICAgICAgYW5kcm9pZC5NYW5pZmVzdC5wZXJtaXNzaW9uLkJJTkRfREVWSUNFX0FETUlOLCBudWxsKTsKLSAgICAgICAgCisKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICBsb25nIGlkZW50ID0gQmluZGVyLmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CiAgICAgICAgICAgICB0cnkgewpAQCAtOTUyLDExICsxMzk2LDExIEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgdm9pZCByZXBvcnRTdWNjZXNzZnVsUGFzc3dvcmRBdHRlbXB0KCkgewogICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oCiAgICAgICAgICAgICAgICAgYW5kcm9pZC5NYW5pZmVzdC5wZXJtaXNzaW9uLkJJTkRfREVWSUNFX0FETUlOLCBudWxsKTsKLSAgICAgICAgCisKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICBpZiAobUZhaWxlZFBhc3N3b3JkQXR0ZW1wdHMgIT0gMCB8fCBtUGFzc3dvcmRPd25lciA+PSAwKSB7CiAgICAgICAgICAgICAgICAgbG9uZyBpZGVudCA9IEJpbmRlci5jbGVhckNhbGxpbmdJZGVudGl0eSgpOwpAQCAtOTcyLDcgKzE0MTYsNyBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgQE92ZXJyaWRlCiAgICAgcHJvdGVjdGVkIHZvaWQgZHVtcChGaWxlRGVzY3JpcHRvciBmZCwgUHJpbnRXcml0ZXIgcHcsIFN0cmluZ1tdIGFyZ3MpIHsKICAgICAgICAgaWYgKG1Db250ZXh0LmNoZWNrQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oYW5kcm9pZC5NYW5pZmVzdC5wZXJtaXNzaW9uLkRVTVApCkBAIC05ODMsMTIgKzE0MjcsMTIgQEAKICAgICAgICAgICAgICAgICAgICAgKyAiLCB1aWQ9IiArIEJpbmRlci5nZXRDYWxsaW5nVWlkKCkpOwogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIGZpbmFsIFByaW50ZXIgcCA9IG5ldyBQcmludFdyaXRlclByaW50ZXIocHcpOwotICAgICAgICAKKwogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIHAucHJpbnRsbigiQ3VycmVudCBEZXZpY2UgUG9saWN5IE1hbmFnZXIgc3RhdGU6Iik7Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgcC5wcmludGxuKCIgIEVuYWJsZWQgRGV2aWNlIEFkbWluczoiKTsKICAgICAgICAgICAgIGZpbmFsIGludCBOID0gbUFkbWluTGlzdC5zaXplKCk7CiAgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CkBAIC05OTksMTEgKzE0NDMsMTcgQEAKICAgICAgICAgICAgICAgICAgICAgYXAuZHVtcCgiICAgICIsIHB3KTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgcHcucHJpbnRsbigiICIpOwogICAgICAgICAgICAgcHcucHJpbnQoIiAgbUFjdGl2ZVBhc3N3b3JkUXVhbGl0eT0weCIpOwogICAgICAgICAgICAgICAgICAgICBwdy5wcmludGxuKEludGVnZXIudG9IZXhTdHJpbmcobUFjdGl2ZVBhc3N3b3JkUXVhbGl0eSkpOwogICAgICAgICAgICAgcHcucHJpbnQoIiAgbUFjdGl2ZVBhc3N3b3JkTGVuZ3RoPSIpOyBwdy5wcmludGxuKG1BY3RpdmVQYXNzd29yZExlbmd0aCk7CisgICAgICAgICAgICBwdy5wcmludCgiICBtQWN0aXZlUGFzc3dvcmRVcHBlckNhc2U9Iik7IHB3LnByaW50bG4obUFjdGl2ZVBhc3N3b3JkVXBwZXJDYXNlKTsKKyAgICAgICAgICAgIHB3LnByaW50KCIgIG1BY3RpdmVQYXNzd29yZExvd2VyQ2FzZT0iKTsgcHcucHJpbnRsbihtQWN0aXZlUGFzc3dvcmRMb3dlckNhc2UpOworICAgICAgICAgICAgcHcucHJpbnQoIiAgbUFjdGl2ZVBhc3N3b3JkTGV0dGVycz0iKTsgcHcucHJpbnRsbihtQWN0aXZlUGFzc3dvcmRMZXR0ZXJzKTsKKyAgICAgICAgICAgIHB3LnByaW50KCIgIG1BY3RpdmVQYXNzd29yZE51bWVyaWM9Iik7IHB3LnByaW50bG4obUFjdGl2ZVBhc3N3b3JkTnVtZXJpYyk7CisgICAgICAgICAgICBwdy5wcmludCgiICBtQWN0aXZlUGFzc3dvcmRTeW1ib2xzPSIpOyBwdy5wcmludGxuKG1BY3RpdmVQYXNzd29yZFN5bWJvbHMpOworICAgICAgICAgICAgcHcucHJpbnQoIiAgbUFjdGl2ZVBhc3N3b3JkTm9uTGV0dGVyPSIpOyBwdy5wcmludGxuKG1BY3RpdmVQYXNzd29yZE5vbkxldHRlcik7CiAgICAgICAgICAgICBwdy5wcmludCgiICBtRmFpbGVkUGF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FNOQVBTSE9UX0RJUiwgRmlsZU9ic2VydmVyLkFUVFJJQikgeworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkV2ZW50KGludCBldmVudCwgU3RyaW5nIHBhdGgpIHsKKyAgICAgICAgICAgICAgICBoYW5kbGVTbmFwc2hvdEZpbGUobmV3IEZpbGUoU05BUFNIT1RfRElSLCBwYXRoKSwgZHJvcGJveCk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgICAgIHNuYXBzaG90T2JzZXJ2ZXIuc3RhcnRXYXRjaGluZygpOworCisgICAgICAgIGlmIChMT0NBTF9MT0dWKSBTbG9nLnYoVEFHLCAiU2FtcGxpbmdQcm9maWxlclNlcnZpY2UgYWN0aXZhdGVkIik7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGhhbmRsZVNuYXBzaG90RmlsZShGaWxlIGZpbGUsIERyb3BCb3hNYW5hZ2VyIGRyb3Bib3gpIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGRyb3Bib3guYWRkRmlsZShUQUcsIGZpbGUsIDApOworICAgICAgICAgICAgaWYgKExPQ0FMX0xPR1YpIFNsb2cudihUQUcsIGZpbGUuZ2V0UGF0aCgpICsgIiBhZGRlZCB0byBkcm9wYm94Iik7CisgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIFNsb2cuZShUQUcsICJDYW4ndCBhZGQgIiArIGZpbGUuZ2V0UGF0aCgpICsgIiB0byBkcm9wYm94IiwgZSk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBmaWxlLmRlbGV0ZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHJlZ2lzdGVyU2V0dGluZ09ic2VydmVyKENvbnRleHQgY29udGV4dCkgeworICAgICAgICBDb250ZW50UmVzb2x2ZXIgY29udGVudFJlc29sdmVyID0gY29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKTsKKyAgICAgICAgY29udGVudFJlc29sdmVyLnJlZ2lzdGVyQ29udGVudE9ic2VydmVyKAorICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5nZXRVcmlGb3IoU2V0dGluZ3MuU2VjdXJlLlNBTVBMSU5HX1BST0ZJTEVSX0haKSwKKyAgICAgICAgICAgICAgICBmYWxzZSwgbmV3IFNhbXBsaW5nUHJvZmlsZXJTZXR0aW5nc09ic2VydmVyKGNvbnRlbnRSZXNvbHZlcikpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIGR1bXAoRmlsZURlc2NyaXB0b3IgZmQsIFByaW50V3JpdGVyIHB3LCBTdHJpbmdbXSBhcmdzKSB7CisgICAgICAgIHB3LnByaW50bG4oIlNhbXBsaW5nUHJvZmlsZXJTZXJ2aWNlOiIpOworICAgICAgICBwdy5wcmludGxuKCJXYXRjaGluZyBkaXJlY3Rvcnk6ICIgKyBTTkFQU0hPVF9ESVIpOworICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgU2FtcGxpbmdQcm9maWxlclNldHRpbmdzT2JzZXJ2ZXIgZXh0ZW5kcyBDb250ZW50T2JzZXJ2ZXIgeworICAgICAgICBwcml2YXRlIENvbnRlbnRSZXNvbHZlciBtQ29udGVudFJlc29sdmVyOworICAgICAgICBwdWJsaWMgU2FtcGxpbmdQcm9maWxlclNldHRpbmdzT2JzZXJ2ZXIoQ29udGVudFJlc29sdmVyIGNvbnRlbnRSZXNvbHZlcikgeworICAgICAgICAgICAgc3VwZXIobnVsbCk7CisgICAgICAgICAgICBtQ29udGVudFJlc29sdmVyID0gY29udGVudFJlc29sdmVyOworICAgICAgICAgICAgb25DaGFuZ2UoZmFsc2UpOworICAgICAgICB9CisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBvbkNoYW5nZShib29sZWFuIHNlbGZDaGFuZ2UpIHsKKyAgIC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ICAgICAgICAgaW50IGZhY3RvcnlUZXN0ID0gIiIuZXF1YWxzKGZhY3RvcnlUZXN0U3RyKSA/IFN5c3RlbVNlcnZlci5GQUNUT1JZX1RFU1RfT0ZGCiAgICAgICAgICAgICAgICAgOiBJbnRlZ2VyLnBhcnNlSW50KGZhY3RvcnlUZXN0U3RyKTsKQEAgLTMyOSwxMSArMzI2LDYgQEAKICAgICAgICAgICAgICAgICBTbG9nLmUoVEFHLCAiRmFpbHVyZSBzdGFydGluZyBTZWFyY2ggU2VydmljZSIsIGUpOwogICAgICAgICAgICAgfQogCi0gICAgICAgICAgICBpZiAoSU5DTFVERV9ERU1PKSB7Ci0gICAgICAgICAgICAgICAgU2xvZy5pKFRBRywgIkluc3RhbGxpbmcgZGVtbyBkYXRhLi4uIik7Ci0gICAgICAgICAgICAgICAgKG5ldyBEZW1vVGhyZWFkKGNvbnRleHQpKS5zdGFydCgpOwotICAgICAgICAgICAgfQotCiAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgIFNsb2cuaShUQUcsICJEcm9wQm94IFNlcnZpY2UiKTsKICAgICAgICAgICAgICAgICBTZXJ2aWNlTWFuYWdlci5hZGRTZXJ2aWNlKENvbnRleHQuRFJPUEJPWF9TRVJWSUNFLApAQCAtNDE4LDYgKzQxMCwxOCBAQAogICAgICAgICAgICAgfSBjYXRjaCAoVGhyb3dhYmxlIGUpIHsKICAgICAgICAgICAgICAgICBTbG9nLmUoVEFHLCAiRmFpbHVyZSBzdGFydGluZyBEaXNrU3RhdHMgU2VydmljZSIsIGUpOwogICAgICAgICAgICAgfQorCisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIC8vIG5lZWQgdG8gYWRkIHRoaXMgc2VydmljZSBldmVuIGlmIFNhbXBsaW5nUHJvZmlsZXJJbnRlZ3JhdGlvbi5pc0VuYWJsZWQoKQorICAgICAgICAgICAgICAgIC8vIGlzIGZhbHNlLCBiZWNhdXNlIGl0IGlzIHRoaXMgc2VydmljZSB0aGF0IGRldGVjdHMgc3lzdGVtIHByb3BlcnR5IGNoYW5nZSBhbmQKKyAgICAgICAgICAgICAgICAvLyB0dXJucyBvbiBTYW1wbGluZ1Byb2ZpbGVySW50ZWdyYXRpb24uIFBsdXMsIHdoZW4gc2FtcGxpbmcgcHJvZmlsZXIgZG9lc24ndCB3b3JrLAorICAgICAgICAgICAgICAgIC8vIHRoZXJlIGlzIGxpdHRsZSBvdmVyaGVhZCBmb3IgcnVubmluZyB0aGlzIHNlcnZpY2UuCisgICAgICAgICAgICAgICAgU2xvZy5pKFRBRywgIlNhbXBsaW5nUHJvZmlsZXIgU2VydmljZSIpOworICAgICAgICAgICAgICAgIFNlcnZpY2VNYW5hZ2VyLmFkZFNlcnZpY2UoInNhbXBsaW5ncHJvZmlsZXIiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBTYW1wbGluZ1Byb2ZpbGVyU2VydmljZShjb250ZXh0KSk7CisgICAgICAgICAgICB9IGNhdGNoIChUaHJvd2FibGUgZSkgeworICAgICAgICAgICAgICAgIFNsb2cuZShUQUcsICJGYWlsdXJlIHN0YXJ0aW5nIFNhbXBsaW5nUHJvZmlsZXIgU2VydmljZSIsIGUpOworICAgICAgICAgICAgfQogICAgICAgICB9CiAKICAgICAgICAgLy8gbWFrZSBzdXJlIHRoZSBBREJfRU5BQkxFRCBzZXR0aW5nIHZhbHVlIG1hdGNoZXMgdGhlIHNlY3VyZSBwcm9wZXJ0eSB2YWx1ZQpAQCAtNTE0LDM3ICs1MTgsNyBAQAogICAgIH0KIH0KIAotY2xhc3MgRGVtb1RocmVhZCBleHRlbmRzIFRocmVhZAotewotICAgIERlbW9UaHJlYWQoQ29udGV4dCBjb250ZXh0KQotICAgIHsKLSAgICAgICAgbUNvbnRleHQgPSBjb250ZXh0OwotICAgIH0KLQotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyB2b2lkIHJ1bigpCi0gICAgewotICAgICAgICB0cnkgewotICAgICAgICAgICAgQ3V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KLSAgICAgICAgICAgICAgICBSZWNvcmQgciA9IG1SZWNvcmRzLmdldChpKTsKKyAgICAgICAgICAgIGZvciAoUmVjb3JkIHIgOiBtUmVjb3JkcykgewogICAgICAgICAgICAgICAgIGlmICgoci5ldmVudHMgJiBQaG9uZVN0YXRlTGlzdGVuZXIuTElTVEVOX0NBTExfU1RBVEUpICE9IDApIHsKICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgICAgIHIuY2FsbGJhY2sub25DYWxsU3RhdGVDaGFuZ2VkKHN0YXRlLCBpbmNvbWluZ051bWJlcik7CiAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBleCkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlKHIuYmluZGVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZUxpc3QuYWRkKHIuYmluZGVyKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGZvciAoSUJpbmRlciBiIDogcmVtb3ZlTGlzdCkgcmVtb3ZlKGIpOwogICAgICAgICB9CiAgICAgICAgIGJyb2FkY2FzdENhbGxTdGF0ZUNoYW5nZWQoc3RhdGUsIGluY29taW5nTnVtYmVyKTsKICAgICB9CkBAIC0yNTUsOCArMjU3LDcgQEAKICAgICAgICAgfQogICAgICAgICBzeW5jaHJvbml6ZWQgKG1SZWNvcmRzKSB7CiAgICAgICAgICAgICBtU2VydmljZVN0YXRlID0gc3RhdGU7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gbVJlY29yZHMuc2l6ZSgpIC0gMTsgaSA+PSAwOyBpLS0pIHsKLSAgICAgICAgICAgICAgICBSZWNvcmQgciA9IG1SZWNvcmRzLmdldChpKTsKKyAgICAgICAgICAgIGZvciAoUmVjb3JkIHIgOiBtUmVjb3JkcykgewogICAgICAgICAgICAgICAgIGlmICgoci5ldmVudHMgJiBQaG9uZVN0YXRlTGlzdGVuZXIuTElTVEVOX1NFUlZJQ0VfU1RBVEUpICE9IDApIHsKICAgICAgICAgICAgICAgICAgICAgc2VuZFNlcnZpY2VTdGF0ZShyLCBzdGF0ZSk7CiAgICAgICAgICAgICAgICAgfQpAQCAtMjY5LDEwICsyNzAsMTAgQEAKICAgICAgICAgaWYgKCFjaGVja05vdGlmeVBlcm1pc3Npb24oIm5vdGlmeVNpZ25hbFN0cmVuZ3RoKCkiKSkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CisgICAgICAgIEFycmF5TGlzdDxJQmluZGVyPiByZW1vdmVMaXN0ID0gbmV3IEFycmF5TGlzdDxJQmluZGVyPigpOwogICAgICAgICBzeW5jaHJvbml6ZWQgKG1SZWNvcmRzKSB7CiAgICAgICAgICAgICBtU2lnbmFsU3RyZW5ndGggPSBzaWduYWxTdHJlbmd0aDsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSBtUmVjb3Jkcy5zaXplKCkgLSAxOyBpID49IDA7IGktLSkgewotICAgICAgICAgICAgICAgIFJlY29yZCByID0gbVJlY29yZHMuZ2V0KGkpOworICAgICAgICAgICAgZm9yIChSZWNvcmQgciA6IG1SZWNvcmRzKSB7CiAgICAgICAgICAgICAgICAgaWYgKChyLmV2ZW50cyAmIFBob25lU3RhdGVMaXN0ZW5lci5MSVNURU5fU0lHTkFMX1NUUkVOR1RIUykgIT0gMCkgewogICAgICAgICAgICAgICAgICAgICBzZW5kU2lnbmFsU3RyZW5ndGgociwgc2lnbmFsU3RyZW5ndGgpOwogICAgICAgICAgICAgICAgIH0KQEAgLTI4MiwxMCArMjgzLDExIEBACiAgICAgICAgICAgICAgICAgICAgICAgICByLmNhbGxiYWNrLm9uU2lnbmFsU3RyZW5ndGhDaGFuZ2VkKChnc21TaWduYWxTdHJlbmd0aCA9PSA5OSA/IC0xCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogZ3NtU2lnbmFsU3RyZW5ndGgpKTsKICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZW1vdmUoci5iaW5kZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlTGlzdC5hZGQoci5iaW5kZXIpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQorICAgICAgICAgICAgZm9yIChJQmluZGVyIGIgOiByZW1vdmVMaXN0KSByZW1vdmUoYik7CiAgICAgICAgIH0KICAgICAgICAgYnJvYWRjYXN0U2lnbmFsU3RyZW5ndGhDaGFuZ2VkKHNpZ25hbFN0cmVuZ3RoKTsKICAgICB9CkBAIC0yOTQsMTggKzI5NiwxOSBAQAogICAgICAgICBpZiAoIWNoZWNrTm90aWZ5UGVybWlzc2lvbigibm90aWZ5TWVzc2FnZVdhaXRpbmdDaGFuZ2VkKCkiKSkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CisgICAgICAgIEFycmF5TGlzdDxJQmluZGVyPiByZW1vdmVMaXN0ID0gbmV3IEFycmF5TGlzdDxJQmluZGVyPigpOwogICAgICAgICBzeW5jaHJvbml6ZWQgKG1SZWNvcmRzKSB7CiAgICAgICAgICAgICBtTWVzc2FnZVdhaXRpbmcgPSBtd2k7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gbVJlY29yZHMuc2l6ZSgpIC0gMTsgaSA+PSAwOyBpLS0pIHsKLSAgICAgICAgICAgICAgICBSZWNvcmQgciA9IG1SZWNvcmRzLmdldChpKTsKKyAgICAgICAgICAgIGZvciAoUmVjb3JkIHIgOiBtUmVjb3JkcykgewogICAgICAgICAgICAgICAgIGlmICgoci5ldmVudHMgJiBQaG9uZVN0YXRlTGlzdGVuZXIuTElTVEVOX01FU1NBR0VfV0FJVElOR19JTkRJQ0FUT1IpICE9IDApIHsKICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgICAgIHIuY2FsbGJhY2sub25NZXNzYWdlV2FpdGluZ0luZGljYXRvckNoYW5nZWQobXdpKTsKICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZW1vdmUoci5iaW5kZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlTGlzdC5hZGQoci5iaW5kZXIpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQorICAgICAgICAgICAgZm9yIChJQmluZGVyIGIgOiByZW1vdmVMaXN0KSByZW1vdmUoYik7CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTMxMywxOCArMzE2LDE5IEBACiAgICAgICAgIGlmICghY2hlY2tOb3RpZnlQZXJtaXNzaW9uKCJub3RpZnlDYWxsRm9yd2FyZGluZ0NoYW5nZWQoKSIpKSB7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KKyAgICAgICAgQXJyYXlMaXN0PElCaW5kZXI+IHJlbW92ZUxpc3QgPSBuZXcgQXJyYXlMaXN0PElCaW5kZXI+KCk7CiAgICAgICAgIHN5bmNocm9uaXplZCAobVJlY29yZHMpIHsKICAgICAgICAgICAgIG1DYWxsRm9yd2FyZGluZyA9IGNmaTsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSBtUmVjb3Jkcy5zaXplKCkgLSAxOyBpID49IDA7IGktLSkgewotICAgICAgICAgICAgICAgIFJlY29yZCByID0gbVJlY29yZHMuZ2V0KGkpOworICAgICAgICAgICAgZm9yIChSZWNvcmQgciA6IG1SZWNvcmRzKSB7CiAgICAgICAgICAgICAgICAgaWYgKChyLmV2ZW50cyAmIFBob25lU3RhdGVMaXN0ZW5lci5MSVNURU5fQ0FMTF9GT1JXQVJESU5HX0lORElDQVRPUikgIT0gMCkgewogICAgICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICAgICAgci5jYWxsYmFjay5vbkNhbGxGb3J3YXJkaW5nSW5kaWNhdG9yQ2hhbmdlZChjZmkpOwogICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZShyLmJpbmRlcik7CisgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVMaXN0LmFkZChyLmJpbmRlcik7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CisgICAgICAgICAgICBmb3IgKElCaW5kZXIgYiA6IHJlbW92ZUxpc3QpIHJlbW92ZShiKTsKICAgICAgICAgfQogICAgIH0KIApAQCAtMzMyLDU2ICszMzYsODAgQEAKICAgICAgICAgaWYgKCFjaGVja05vdGlmeVBlcm1pc3Npb24oIm5vdGlmeURhdGFBY3Rpdml0eSgpIiApKSB7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KKyAgICAgICAgQXJyYXlMaXN0PElCaW5kZXI+IHJlbW92ZUxpc3QgPSBuZXcgQXJyYXlMaXN0PElCaW5kZXI+KCk7CiAgICAgICAgIHN5bmNocm9uaXplZCAobVJlY29yZHMpIHsKICAgICAgICAgICAgIG1EYXRhQWN0aXZpdHkgPSBzdGF0ZTsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSBtUmVjb3Jkcy5zaXplKCkgLSAxOyBpID49IDA7IGktLSkgewotICAgICAgICAgICAgICAgIFJlY29yZCByID0gbVJlY29yZHMuZ2V0KGkpOworICAgICAgICAgICAgZm9yIChSZWNvcmQgciA6IG1SZWNvcmRzKSB7CiAgICAgICAgICAgICAgICAgaWYgKChyLmV2ZW50cyAmIFBob25lU3RhdGVMaXN0ZW5lci5MSVNURU5fREFUQV9BQ1RJVklUWSkgIT0gMCkgewogICAgICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICAgICAgci5jYWxsYmFjay5vbkRhdGFBY3Rpdml0eShzdGF0ZSk7CiAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBleCkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlKHIuYmluZGVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZUxpc3QuYWRkKHIuYmluZGVyKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGZvciAoSUJpbmRlciBiIDogcmVtb3ZlTGlzdCkgcmVtb3ZlKGIpOwogICAgICAgICB9CiAgICAgfQogCiAgICAgcHVibGljIHZvaWQgbm90aWZ5RGF0YUNvbm5lY3Rpb24oaW50IHN0YXRlLCBib29sZWFuIGlzRGF0YUNvbm5lY3Rpdml0eVBvc3NpYmxlLAotICAgICAgICAgICAgU3RyaW5nIHJlYXNvbiwgU3RyaW5nIGFwbiwgU3RyaW5nW10gYXBuVHlwZXMsIFN0cmluZyBpbnRlcmZhY2VOYW1lLCBpbnQgbmV0d29ya1R5cGUpIHsKKyAgICAgICAgICAgIFN0cmluZyByZWFzb24sIFN0cmluZyBhcG4sIFN0cmluZyBhcG5UeXBlLCBTdHJpbmcgaW50ZXJmYWNlTmFtZSwgaW50IG5ldHdvcmtUeXBlKSB7CiAgICAgICAgIGlmICghY2hlY2tOb3RpZnlQZXJtaXNzaW9uKCJub3RpZnlEYXRhQ29ubmVjdGlvbigpIiApKSB7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KICAgICAgICAgc3luY2hyb25pemVkIChtUmVjb3JkcykgewotICAgICAgICAgICAgbURhdGFDb25uZWN0aW9uU3RhdGUgPSBzdGF0ZTsKKyAgICAgICAgICAgIGJvb2xlYW4gbW9kaWZpZWQgPSBmYWxzZTsKKyAgICAgICAgICAgIGlmIChzdGF0ZSA9PSBUZWxlcGhvbnlNYW5hZ2VyLkRBVEFfQ09OTkVDVEVEKSB7CisgICAgICAgICAgICAgICAgaWYgKCFtQ29ubmVjdGVkQXBucy5jb250YWlucyhhcG5UeXBlKSkgeworICAgICAgICAgICAgICAgICAgICBtQ29ubmVjdGVkQXBucy5hZGQoYXBuVHlwZSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChtRGF0YUNvbm5lY3Rpb25TdGF0ZSAhPSBzdGF0ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgbURhdGFDb25uZWN0aW9uU3RhdGUgPSBzdGF0ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1vZGlmaWVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbUNvbm5lY3RlZEFwbnMucmVtb3ZlKGFwblR5cGUpOworICAgICAgICAgICAgICAgIGlmIChtQ29ubmVjdGVkQXBucy5pc0VtcHR5KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgbURhdGFDb25uZWN0aW9uU3RhdGUgPSBzdGF0ZTsKKyAgICAgICAgICAgICAgICAgICAgbW9kaWZpZWQgPSB0cnVlOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIC8vIHdlJ3JlIHN0aWxsIGNvbm5lY3RlZCwgc28gc2VuZCB0aGF0IG91dCBpZiB3ZSBzZW5kIGFueXRoaW5nLgorICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IG1EYXRhQ29ubmVjdGlvblN0YXRlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KICAgICAgICAgICAgIG1EYXRhQ29ubmVjdGlvblBvc3NpYmxlID0gaXNEYXRhQ29ubmVjdGl2aXR5UG9zc2libGU7CiAgICAgICAgICAgICBtRGF0YUNvbm5lY3Rpb25SZWFzb24gPSByZWFzb247CiAgICAgICAgICAgICBtRGF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nJheUxpc3Q8SUJpbmRlcj4oKTsKKyAgICAgICAgICAgICAgICBmb3IgKFJlY29yZCByIDogbVJlY29yZHMpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKChyLmV2ZW50cyAmIFBob25lU3RhdGVMaXN0ZW5lci5MSVNURU5fREFUQV9DT05ORUNUSU9OX1NUQVRFKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIuY2FsbGJhY2sub25EYXRhQ29ubmVjdGlvblN0YXRlQ2hhbmdlZChzdGF0ZSwgbmV0d29ya1R5cGUpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlTGlzdC5hZGQoci5iaW5kZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGZvciAoSUJpbmRlciBiIDogcmVtb3ZlTGlzdCkgcmVtb3ZlKGIpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIGJyb2FkY2FzdERhdGFDb25uZWN0aW9uU3RhdGVDaGFuZ2VkKHN0YXRlLCBpc0RhdGFDb25uZWN0aXZpdHlQb3NzaWJsZSwgcmVhc29uLCBhcG4sCi0gICAgICAgICAgICAgICAgYXBuVHlwZXMsIGludGVyZmFjZU5hbWUpOworICAgICAgICAgICAgICAgIGFwblR5cGUsIGludGVyZmFjZU5hbWUpOwogICAgIH0KIAotICAgIHB1YmxpYyB2b2lkIG5vdGlmeURhdGFDb25uZWN0aW9uRmFpbGVkKFN0cmluZyByZWFzb24pIHsKKyAgICBwdWJsaWMgdm9pZCBub3RpZnlEYXRhQ29ubmVjdGlvbkZhaWxlZChTdHJpbmcgcmVhc29uLCBTdHJpbmcgYXBuVHlwZSkgewogICAgICA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TG9jYXRpb247Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gbVJlY29yZHMuc2l6ZSgpIC0gMTsgaSA+PSAwOyBpLS0pIHsKLSAgICAgICAgICAgICAgICBSZWNvcmQgciA9IG1SZWNvcmRzLmdldChpKTsKKyAgICAgICAgICAgIGZvciAoUmVjb3JkIHIgOiBtUmVjb3JkcykgewogICAgICAgICAgICAgICAgIGlmICgoci5ldmVudHMgJiBQaG9uZVN0YXRlTGlzdGVuZXIuTElTVEVOX0NFTExfTE9DQVRJT04pICE9IDApIHsKICAgICAgICAgICAgICAgICAgICAgc2VuZENlbGxMb2NhdGlvbihyLCBjZWxsTG9jYXRpb24pOwogICAgICAgICAgICAgICAgIH0KQEAgLTQ2Myw4ICs0OTAsNyBAQAogICAgICAgICAgICAgcHcucHJpbnRsbigiICBtRGF0YUNvbm5lY3Rpb25JbnRlcmZhY2VOYW1lPSIgKyBtRGF0YUNvbm5lY3Rpb25JbnRlcmZhY2VOYW1lKTsKICAgICAgICAgICAgIHB3LnByaW50bG4oIiAgbUNlbGxMb2NhdGlvbj0iICsgbUNlbGxMb2NhdGlvbik7CiAgICAgICAgICAgICBwdy5wcmludGxuKCJyZWdpc3RyYXRpb25zOiBjb3VudD0iICsgcmVjb3JkQ291bnQpOwotICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCByZWNvcmRDb3VudDsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgUmVjb3JkIHIgPSBtUmVjb3Jkcy5nZXQoaSk7CisgICAgICAgICAgICBmb3IgKFJlY29yZCByIDogbVJlY29yZHMpIHsKICAgICAgICAgICAgICAgICBwdy5wcmludGxuKCIgICIgKyByLnBrZ0ZvckRlYnVnICsgIiAweCIgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKHIuZXZlbnRzKSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KQEAgLTUzNSw3ICs1NjEsNyBAQAogCiAgICAgcHJpdmF0ZSB2b2lkIGJyb2FkY2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KChwZXJpb2QgPT0gVGhyb3R0bGVNYW5hZ2VyLlBFUklPRF9DWUNMRSkgJiYKLSAgICAgICAgICAgICAgICAobVJlY29yZGVyICE9IG51bGwpKSB7CisgICAgICAgIGlmICgocGVyaW9kID09IFRocm90dGxlTWFuYWdlci5QRVJJT0RfQ1lDTEUpICYmIChtUmVjb3JkZXIgIT0gbnVsbCkpIHsKICAgICAgICAgICAgIGlmIChkaXIgPT0gVGhyb3R0bGVNYW5hZ2VyLkRJUkVDVElPTl9UWCkgcmV0dXJuIG1SZWNvcmRlci5nZXRQZXJpb2RUeChhZ28pOwogICAgICAgICAgICAgaWYgKGRpciA9PSBUaHJvdHRsZU1hbmFnZXIuRElSRUNUSU9OX1JYKSByZXR1cm4gbVJlY29yZGVyLmdldFBlcmlvZFJ4KGFnbyk7CiAgICAgICAgIH0KQEAgLTI3OSwxMCArMjg2LDEwIEBACiAKICAgICAvLyBUT0RPIC0gYSBiZXR0ZXIgbmFtZSAtIGdldEN1cnJlbnRUaHJvdHRsZVJhdGU/CiAgICAgLy8gVE9ETyAtIGZldGNoIGZvciB0aGUgaWZhY2UKLSAgICBwdWJsaWMgc3luY2hyb25pemVkIGludCBnZXRUaHJvdHRsZShTdHJpbmcgaWZhY2UpIHsKKyAgICBwdWJsaWMgaW50IGdldFRocm90dGxlKFN0cmluZyBpZmFjZSkgewogICAgICAgICBlbmZvcmNlQWNjZXNzUGVybWlzc2lvbigpOwotICAgICAgICBpZiAobVRocm90dGxlSW5kZXggPT0gMSkgewotICAgICAgICAgICAgcmV0dXJuIG1Qb2xpY3lUaHJvdHRsZVZhbHVlOworICAgICAgICBpZiAobVRocm90dGxlSW5kZXguZ2V0KCkgPT0gMSkgeworICAgICAgICAgICAgcmV0dXJuIG1Qb2xpY3lUaHJvdHRsZVZhbHVlLmdldCgpOwogICAgICAgICB9CiAgICAgICAgIHJldHVybiAwOwogICAgIH0KQEAgLTMwNSwyMiArMzEyLDYgQEAKICAgICAgICAgICAgICAgICB9Ci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iAKIApAQCAtMzc1LDcgKzM4Miw3IEBACiAgICAgICAgICAgICAvLyBjaGVjayBmb3Igc2ltIGNoYW5nZSBUT0RPCiAgICAgICAgICAgICAvLyByZXJlZ2lzdGVyIGZvciBub3RpZmljYXRpb24gb2YgcG9saWN5IGNoYW5nZQogCi0gICAgICAgICAgICBtVGhyb3R0bGVJbmRleCA9IFRIUk9UVExFX0lOREVYX1VOSU5JVElBTElaRUQ7CisgICAgICAgICAgICBtVGhyb3R0bGVJbmRleC5zZXQoVEhST1RUTEVfSU5ERVhfVU5JTklUSUFMSVpFRCk7CiAKICAgICAgICAgICAgIG1SZWNvcmRlciA9IG5ldyBEYXRhUmVjb3JkZXIobUNvbnRleHQsIFRocm90dGxlU2VydmljZS50aGlzKTsKIApAQCAtNDAzLDE1ICs0MTAsMTYgQEAKICAgICAgICAgICAgICAgICAgICAgUi5pbnRlZ2VyLmNvbmZpZ19kYXRhdXNlX3RocmVzaG9sZF9ieXRlcyk7CiAgICAgICAgICAgICBpbnQgZGVmYXVsdFZhbHVlID0gbUNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0SW50ZWdlcigKICAgICAgICAgICAgICAgICAgICAgUi5pbnRlZ2VyLmNvbmZpZ19kYXRhdXNlX3Rocm90dGxlX2tiaXRzcHMpOwotICAgICAgICAgICAgc3luY2hyb25pemVkIChUaHJvdHRsZVNlcnZpY2UudGhpcykgewotICAgICAgICAgICAgICAgIG1Qb2xpY3lUaHJlc2hvbGQgPSBTZXR0aW5ncy5TZWN1cmUuZ2V0TG9uZyhtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5USFJPVFRMRV9USFJFU0hPTERfQllURVMsIGRlZmF1bHRUaHJlc2hvbGQpOwotICAgICAgICAgICAgICAgIG1Qb2xpY3lUaHJvdHRsZVZhbHVlID0gU2V0dGluZ3MuU2VjdXJlLmdldEludChtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5USFJPVFRMRV9WQUxVRV9LQklUU1BTLCBkZWZhdWx0VmFsdWUpOwotICAgICAgICAgICAgICAgIGlmICh0ZXN0aW5nKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1Qb2xpY3lQb2xsUGVyaW9kU2VjID0gVEVTVElOR19QT0xMSU5HX1BFUklPRF9TRUM7Ci0gICAgICAgICAgICAgICAgICAgIG1Qb2xpY3lUaHJlc2hvbGQgPSBURVNUSU5HX1RIUkVTSE9MRDsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICBsb25nIHRocmVzaG9sZCA9IFNldHRpbmdzLlNlY3VyZS5nZXRMb25nKG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLAorICAgICAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuVEhST1RUTEVfVEhSRVNIT0xEX0JZVEVTLCBkZWZhdWx0VGhyZXNob2xkKTsKKyAgICAgICAgICAgIGludCB2YWx1ZSA9IFNldHRpbmdzLlNlY3VyZS5nZXRJbnQobUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCksCisgICAgICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5USFJPVFRMRV9WQUxVRV9LQklUU1BTLCBkZWZhdWx0VmFsdWUpOworCisgICAgICAgICAgICBtUG9saWN5VGhyZXNob2xkLnNldCh0aHJlc2hvbGQpOworICAgICAgICAgICAgbVBvbGljeVRocm90dGxlVmFsdWUuc2V0KHZhbHVlKTsKKyAgICAgICAgICAgIGlmICh0ZXN0aW5nKSB7CisgICAgICAgICAgICAgICAgbVBvbGljeVBvbGxQZXJpb2RTZWMgPSBURVNUSU5HX1BPTExJTkdfUEVSSU9EX1NFQzsKKyAgICAgICAgICAgICAgICBtUG9saWN5VGhyZXNob2xkLnNldChURVNUSU5HX1RIUkVTSE9MRCk7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIG1Qb2xpY3lSZXNldERheSA9IFNldHRpbmdzLlNlY3VyZS5nZXRJbnQobUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCksCkBAIC00MjMsMTAgKzQzMSw4IEBACiAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLnB1dEludChtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKICAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuVEhST1RUTEVfUkVTRVRfREFZLCBtUG9saWN5UmVzZXREYXkpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgc3luY2hyb25pemVkIChUaHJvdHRsZVNlcnZpY2UudGhpcykgewotICAgICAgICAgICAgICAgIGlmIChtSWZhY2UgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBtUG9saWN5VGhyZXNob2xkID0gMDsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobUlmYWNlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtUG9saWN5VGhyZXNob2xkLnNldCgwKTsKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgaW50IGRlZmF1bHROb3RpZmljYXRpb25UeXBlID0gbUNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0SW50ZWdlcigKQEAgLTQzNywxNSArNDQzLDE2IEBACiAgICAgICAgICAgICBtTWF4TnRwQ2FjaGVBZ2VTZWMgPSBTZXR0aW5ncy5TZWN1cmUuZ2V0SW50KG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLAogICAgICAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuVEhST1RUTEVfTUFYX05UUF9DQUNIRV9BR0VfU0VDLCBNQVhfTlRQX0NBQ0hFX0FHRV9TRUMpOwogCi0gICAgICAgICAgICBpZiAoVkRCRyB8fCAobVBvbGljeVRocmVzaG9sZCAhPSAwKSkgeworICAgICAgICAgICAga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yb3R0bGVJbmRleCA9PSAxKSB7CisgICAgICAgICAgICBpZiAobVRocm90dGxlSW5kZXguZ2V0KCkgPT0gMSkgewogICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgIG1OTVNlcnZpY2Uuc2V0SW50ZXJmYWNlVGhyb3R0bGUobUlmYWNlLCAtMSwgLTEpOwogICAgICAgICAgICAgICAgICAgICBtTk1TZXJ2aWNlLnNldEludGVyZmFjZVRocm90dGxlKG1JZmFjZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUG9saWN5VGhyb3R0bGVWYWx1ZSwgbVBvbGljeVRocm90dGxlVmFsdWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Qb2xpY3lUaHJvdHRsZVZhbHVlLmdldCgpLCBtUG9saWN5VGhyb3R0bGVWYWx1ZS5nZXQoKSk7CiAgICAgICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgICAgICAgICAgU2xvZy5lKFRBRywgImVycm9yIHNldHRpbmcgVGhyb3R0bGU6ICIgKyBlKTsKICAgICAgICAgICAgICAgICB9CkBAIC01MjMsNyArNTMwLDggQEAKIAogICAgICAgICBwcml2YXRlIHZvaWQgY2hlY2tUaHJvdHRsZUFuZFBvc3ROb3RpZmljYXRpb24obG9uZyBjdXJyZW50VG90YWwpIHsKICAgICAgICAgICAgIC8vIGlzIHRocm90dGxpbmcgZW5hYmxlZD8KLSAgICAgICAgICAgIGlmIChtUG9saWN5VGhyZXNob2xkID09IDApIHsKKyAgICAgICAgICAgIGxvbmcgdGhyZXNob2xkID0gbVBvbGljeVRocmVzaG9sZC5nZXQoKTsKKyAgICAgICAgICAgIGlmICh0aHJlc2hvbGQgPT0gMCkgewogICAgICAgICAgICAgICAgIGNsZWFyVGhyb3R0bGVBbmROb3RpZmljYXRpb24oKTsKICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICB9CkBAIC01MzUsMTUgKzU0MywxMyBAQAogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAvLyBjaGVjayBpZiB3ZSBuZWVkIHRvIHRocm90dGxlCi0gICAgICAgICAgICBpZiAoY3VycmVudFRvdGFsID4gbVBvbGljeVRocmVzaG9sZCkgewotICAgICAgICAgICAgICAgIGlmIChtVGhyb3R0bGVJbmRleCAhPSAxKSB7Ci0gICAgICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAoVGhyb3R0bGVTZXJ2aWNlLnRoaXMpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1UaHJvdHRsZUluZGV4ID0gMTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSBTbG9nLmQoVEFHLCAiVGhyZXNob2xkICIgKyBtUG9saWN5VGhyZXNob2xkICsgIiBleGNlZWRlZCEiKTsKKyAgICAgICAgICAgIGlmIChjdXJyZW50VG90YWwgPiB0aHJlc2hvbGQpIHsKKyAgICAgICAgICAgICAgICBpZiAobVRocm90dGxlSW5kZXguZ2V0KCkgIT0gMSkgeworICAgICAgICAgICAgICAgICAgICBtVGhyb3R0bGVJbmRleC5zZXQoMSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIFNsb2cuZChUQUcsICJUaHJlc2hvbGQgIiArIHRocmVzaG9sZCArICIgZXhjZWVkZWQhIik7CiAgICAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBtTk1TZXJ2aWNlLnNldEludGVyZmFjZVRocm90dGxlKG1JZmFjZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVBvbGljeVRocm90dGxlVmFsdWUsIG1Qb2xpY3lUaHJvdHRsZVZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVBvbGljeVRocm90dGxlVmFsdWUuZ2V0KCksIG1Qb2xpY3lUaHJvdHRsZVZhbHVlLmdldCgpKTsKICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIFNsb2cuZShUQUcsICJlcnJvciBzZXR0aW5nIFRocm90dGxlOiAiICsgZSk7CiAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTU1Niw3ICs1NjIsOCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5vdGlmaWNhdGlvbi5GTEFHX09OR09JTkdfRVZFTlQpOwogCiAgICAgICAgICAgICAgICAgICAgIEludGVudCBicm9hZGNhc3QgPSBuZXcgSW50ZW50KFRocm90dGxlTWFuYWdlci5USFJPVFRMRV9BQ1RJT04pOwotICAgICAgICAgICAgICAgICAgICBicm9hZGNhc3QucHV0RXh0cmEoVGhyb3R0bGVNYW5hZ2VyLkVYVFJBX1RIUk9UVExFX0xFVkVMLCBtUG9saWN5VGhyb3R0bGVWYWx1ZSk7CisgICAgICAgICAgICAgICAgICAgIGJyb2FkY2FzdC5wdXRFeHRyYShUaHJvdHRsZU1hbmFnZXIuRVhUUkFfVEhST1RUTEVfTEVWRUwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVBvbGljeVRocm90dGxlVmFsdWUuZ2V0KCkpOwogICAgICAgICAgICAgICAgICAgICBtQ29udGV4dC5zZW5kU3RpY2t5QnJvYWRjYXN0KGJyb2FkY2FzdCk7CiAKICAgICAgICAgICAgICAgICB9IC8vIGVsc2UgYWxyZWFkeSB1cCEKQEAgLTU3OSw4ICs1ODYsOCBAQAogICAgICAgICAgICAgICAgICAgICBsb25nIHBlcmlvZExlbmd0aCA9IGVuZCAtIHN0YXJ0OwogICAgICAgICAgICAgICAgICAgICBsb25nIG5vdyA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOwogICAgICAgICAgICAgICAgICAgICBsb25nIHRpbWVVc2VkID0gbm93IC0gc3RhcnQ7Ci0gICAgICAgICAgICAgICAgICAgIGxvbmcgd2FybmluZ1RocmVzaG9sZCA9IDIqbVBvbGljeVRocmVzaG9sZCp0aW1lVXNlZC8odGltZVVzZWQrcGVyaW9kTGVuZ3RoKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKChjdXJyZW50VG90YWwgPiB3YXJuaW5nVGhyZXNob2xkKSAmJiAoY3VycmVudFRvdGFsID4gbVBvbGljeVRocmVzaG9sZC80KSkgeworICAgICAgICAgICAgICAgICAgICBsb25nIHdhcm5pbmdUaHJlc2hvbGQgPSAyKnRocmVzaG9sZCp0aW1lVXNlZC8odGltZVVzZWQrcGVyaW9kTGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKChjdXJyZW50VG90YWwgPiB3YXJuaW5nVGhyZXNob2xkKSAmJiAoY3VycmVudFRvdGFsID4gdGhyZXNob2xkLzQpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobVdhcm5pbmdOb3RpZmljYXRpb25TZW50ID09IGZhbHNlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVdhcm5pbmdOb3RpZmljYXRpb25TZW50ID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTm90aWZpY2F0aW9uTWFuYWdlci5jYW5jZWwoUi5kcmF3YWJsZS5zdGF0X3N5c190aHJvdHRsZWQpOwpAQCAtNjI1LDExICs2MzIsOSBAQAogICAgICAgICB9CiAKIAotICAgICAgICBwcml2YXRlIHN5bmNocm9uaXplZCB2b2lkIGNsZWFyVGhyb3R0bGVBbmROb3RpZmljYXRpb24oKSB7Ci0gICAgICAgICAgICBpZiAobVRocm90dGxlSW5kZXggIT0gVEhST1RUTEVfSU5ERVhfVU5USFJPVFRMRUQpIHsKLSAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKFRocm90dGxlU2VydmljZS50aGlzKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1UaHJvdHRsZUluZGV4ID0gVEhST1RUTEVfSU5ERVhfVU5USFJPVFRMRUQ7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICBwcml2YXRlIHZvaWQgY2xlYXJUaHJvdHRsZUFuZE5vdGlmaWNhdGlvbigpIHsKKyAgICAgICAgICAgIGlmIChtVGhyb3R0bGVJbmRleC5nZXQoKSAhPSBUSFJPVFRMRV9JTkRFWF9VTlRIUk9UVExFRCkgeworICAgICAgICAgICAgICAgIG1UaHJvdHRsZUluZGV4LnNldChUSFJPVFRMRV9JTkRFWF9VTlRIUk9UVExFRCk7CiAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgbU5NU2VydmljZS5zZXRJbnRlcmZhY2VUaHJvdHRsZShtSWZhY2UsIC0xLCAtMSk7CiAgICAgICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKQEAgLTY4NywxMiArNjkyLDEyIEBACiAgICAgICAgIH0KIAogICAgICAgICBwcml2YXRlIHZvaWQgb25SZXNldEFsYXJtKCkgewotICAgICAgICAgICAgaWYgKFZEQkcgfHwgKG1Qb2xpY3lUaHJlc2hvbGQgIT0gMCkpIHsKKyAgICAgICAgICAgIGlmIChWREJHIHx8IChtUG9saWN5VGhyZXNob2xkLmdldCgpICE9IDApKSB7CiAgICAgICAgICAgICAgICAgU2xvZy5kKFRBRywgIm9uUmVzZXRBbGFybSAtIGxhc3QgcGVyaW9kIGhhZCAiICsgbVJlY29yZGVyLmdldFBlcmlvZFJ4KDApICsKICAgICAgICAgICAgICAgICAgICAgICAgICIgYnl0ZXMgcmVhZCBhbmQgIiArIG1SZWNvcmRlci5nZXRQZXJpb2RUeCgwKSArICIgd3JpdHRlbiIpOwogICAgICAgICAgICAgfQogCi0gICAgICAgICAgICBsb25nIG5vdyA9IGdldEJlc3RUaW1lKCk7CisgICAgICAgICAgICBsb25nIG5vdyA9IGdldEJlc3RUaW1lKGZhbHNlKTsKIAogICAgICAgICAgICAgaWYgKG1OdHBBY3RpdmUgfHwgKG1OdHBTZXJ2ZXIgPT0gbnVsbCkpIHsKICAgICAgICAgICAgICAgICBD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3dlciBtZXRob2QgKCFmYXN0KQorICAgIHByaXZhdGUgbG9uZyBnZXRCZXN0VGltZShib29sZWFuIGZhc3QpIHsKICAgICAgICAgaWYgKG1OdHBTZXJ2ZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgaWYgKG1OdHBBY3RpdmUpIHsKICAgICAgICAgICAgICAgICBsb25nIG50cEFnZSA9IFN5c3RlbUNsb2NrLmVsYXBzZWRSZWFsdGltZSgpIC0gY2FjaGVkTnRwVGltZXN0YW1wOwotICAgICAgICAgICAgICAgIGlmIChudHBBZ2UgPCBtTWF4TnRwQ2FjaGVBZ2VTZWMgKiAxMDAwKSB7CisgICAgICAgICAgICAgICAgaWYgKG50cEFnZSA8IG1NYXhOdHBDYWNoZUFnZVNlYyAqIDEwMDAgfHwgZmFzdCkgewogICAgICAgICAgICAgICAgICAgICBpZiAoVkRCRykgU2xvZy52KFRBRywgInVzaW5nIGNhY2hlZCB0aW1lIik7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWNoZWROdHAgKyBudHBBZ2U7CiAgICAgICAgICAgICAgICAgfQpAQCAtMTAyNSwzOSArMTAzMyw1NyBAQAogICAgICAgICAgICAgICAgIGlmIChEQkcpIFNsb2cuZChUQUcsICJkYXRhIGZpbGUgZW1wdHkiKTsKICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1QYXJlbnQpIHsKLSAgICAgICAgICAgICAgICBTdHJpbmdbXSBwYXJzZWQgPSBkYXRhLnNwbGl0KCI6Iik7Ci0gICAgICAgICAgICAgICAgaW50IHBhcnNlZFVzZWQgPSAwOwotICAgICAgICAgICAgICAgIGlmIChwYXJzZWQubGVuZ3RoIDwgNikgewotICAgICAgICAgICAgICAgICAgICBTbG9nLmUoVEFHLCAicmVhZGluZyBkYXRhIGZpbGUgd2l0aCBpbnN1ZmZpY2llbnQgbGVuZ3RoIC0gaWdub3JpbmciKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIFN0cmluZ1tdIHBhcnNlZCA9IGRhdGEuc3BsaXQoIjoiKTsKKyAgICAgICAgICAgIGludCBwYXJzZWRVc2VkID0gMDsKKyAgICAgICAgICAgIGlmIChwYXJzZWQubGVuZ3RoIDwgNikgeworICAgICAgICAgICAgICAgIFNsb2cuZShUQUcsICJyZWFkaW5nIGRhdGEgZmlsZSB3aXRoIGluc3VmZmljaWVudCBsZW5ndGggLSBpZ25vcmluZyIpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KIAorICAgICAgICAgICAgaW50IHBlcmlvZENvdW50OworICAgICAgICAgICAgbG9uZ1tdIHBlcmlvZFJ4RGF0YTsKKyAgICAgICAgICAgIGxvbmdbXSBwZXJpb2RUeERhdGE7CisgICAgICAgICAgICBpbnQgY3VycmVudFBlcmlvZDsKKyAgICAgICAgICAgIENhbGVuZGFyIHBlcmlvZFN0YXJ0OworICAgICAgICAgICAgQ2FsZW5kYXIgcGVyaW9kRW5kOworICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICBpZiAoSW50ZWdlci5wYXJzZUludChwYXJzZWRbcGFyc2VkVXNlZCsrXSkgIT0gREFUQV9GSUxFX1ZFUlNJT04pIHsKICAgICAgICAgICAgICAgICAgICAgU2xvZy5lKFRBRywgInJlYWRpbmcgZGF0YSBmaWxlIHdpdGggYmFkIHZlcnNpb24gLSBpZ25vcmluZyIpOwogICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgbVBlcmlvZENvdW50ID0gSW50ZWdlci5wYXJzZUludChwYXJzZWRbcGFyc2VkVXNlZCsrXSk7Ci0gICAgICAgICAgICAgICAgaWYgKHBhcnNlZC5sZW5ndGggIT0gNSArICgyICogbVBlcmlvZENvdW50KSkgeworICAgICAgICAgICAgICAgIHBlcmlvZENvdW50ID0gSW50ZWdlci5wYXJzZUludChwYXJzZWRbcGFyc2VkVXNlZCsrXSk7CisgICAgICAgICAgICAgICAgaWYgKHBhcnNlZC5sZW5ndGggIT0gNSArICgyICogcGVyaW9kQ291bnQpKSB7CiAgICAgICAgICAgICAgICAgICAgIFNsb2cuZShUQUcsICJyZWFkaW5nIGRhdGEgZmlsZSB3aXRoIGJhZCBsZW5ndGggKCIgKyBwYXJzZWQubGVuZ3RoICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiICE9ICIgKyAoNSsoMiptUGVyaW9kQ291bnQpKSArICIpIC0gaWdub3JpbmciKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiICE9ICIgKyAoNSArICgyICogcGVyaW9kQ291bnQpKSArICIpIC0gaWdub3JpbmciKTsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBwZXJpb2RSeERhdGEgPSBuZXcgbG9uZ1twZXJpb2RDb3VudF07CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBwZXJpb2RDb3VudDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIHBlcmlvZFJ4RGF0YVtpXSA9IExvbmcucGFyc2VMb25nKHBhcnNlZFtwYXJzZWRVc2VkKytdKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcGVyaW9kVHhEYXRhID0gbmV3IGxvbmdbcGVyaW9kQ291bnRdOworICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgcGVyaW9kQ291bnQ7IGkrKykgeworICAgICAgICAgICAgICAgICAgICBwZXJpb2RUeERhdGFbaV0gPSBMb25nLnBhcnNlTG9uZyhwYXJzZWRbcGFyc2VkVXNlZCsrXSk7CisgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgbVBlcmlvZFJ4RGF0YSA9IG5ldyBsb25nW21QZXJpb2RDb3VudF07Ci0gICAgICAgICAgICAgICAgZm9yKGludCBpID0gMDsgaSA8IG1QZXJpb2RDb3VudDsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1QZXJpb2RSeERhdGFbaV0gPSBMb25nLnBhcnNlTG9uZyhwYXJzZWRbcGFyc2VkVXNlZCsrXSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1QZXJpb2RUeERhdGEgPSBuZXcgbG9uZ1ttUGVyaW9kQ291bnRdOwotICAgICAgICAgICAgICAgIGZvcihpbnQgaSA9IDA7IGkgPCBtUGVyaW9kQ291bnQ7IGkrKykgewotICAgICAgICAgICAgICAgICAgICBtUGVyaW9kVHhEYXRhW2ldID0gTG9uZy5wYXJzZUxvbmcocGFyc2VkW3BhcnNlZFVzZWQrK10pOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtQ3VycmVudFBlcmlvZCA9IEludGVnZXIucGFyc2VJbnQocGFyc2VkW3BhcnNlZFVzZWQrK10pOwotICAgICAgICAgICAgICAgIG1QZXJpb2RTdGFydCA9IG5ldyBHcmVnb3JpYW5DYWxlbmRhcigpOwotICAgICAgICAgICAgICAgIG1QZXJpb2RTdGFydC5zZXRUaW1lSW5NaWxsaXMoTG9uZy5wYXJzZUxvbmcocGFyc2VkW3BhcnNlZFVzZWQrK10pKTsKLSAgICAgICAgICAgICAgICBtUGVyaW9kRW5kID0gbmV3IEdyZWdvcmlhbkNhbGVuZGFyKCk7Ci0gICAgICAgICAgICAgICAgbVBlcmlvZEVuZC5zZXRUaW1lSW5NaWxsaXMoTG9uZy5wYXJzZUxvbmcocGFyc2VkW3BhcnNlZFVzZWQrK10pKTsKKyAgICAgICAgICAgICAgICBjdXJyZW50UGVyaW9kID0gSW50ZWdlci5wYXJzZUludChwYXJzZWRbcGFyc2VkVXNlZCsrXSk7CisKKyAgICAgICAgICAgICAgICBwZXJpb2RTdGFydCA9IG5ldyBHcmVnb3JpYW5DYWxlbmRhcigpOworICAgICAgICAgICAgICAgIHBlcmlvZFN0YXJ0LnNldFRpbWVJbk1pbGxpcyhMb25nLnBhcnNlTG9uZyhwYXJzZWRbcGFyc2VkVXNlZCsrXSkpOworICAgICAgICAgICAgICAgIHBlcmlvZEVuZCA9IG5ldyBHcmVnb3JpYW5DYWxlbmRhcigpOworICAgICAgICAgICAgICAgIHBlcmlvZEVuZC5zZXRUaW1lSW5NaWxsaXMoTG9uZy5wYXJzZUxvbmcocGFyc2VkW3BhcnNlZFVzZWQrK10pKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgU2xvZy5lKFRBRywgIkVycm9yIHBhcnNpbmcgZGF0YSBmaWxlIC0gaWdub3JpbmciKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1QYXJlbnQpIHsKKyAgICAgICAgICAgICAgICBtUGVyaW9kQ291bnQgPSBwZXJpb2RDb3VudDsKKyAgICAgICAgICAgICAgICBtUGVyaW9kUnhEYXRhID0gcGVyaW9kUnhEYXRhOworICAgICAgICAgICAgICAgIG1QZXJpb2RUeERhdGEgPSBwZXJpb2RUeERhdGE7CisgICAgICAgICAgICAgICAgbUN1cnJlbnRQZXJpb2QgPSBjdXJyZW50UGVyaW9kOworICAgICAgICAgICAgICAgIG1QZXJpb2RTdGFydCA9IHBlcmlvZFN0YXJ0OworICAgICAgICAgICAgICAgIG1QZXJpb2RFbmQgPSBwZXJpb2RFbmQ7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIApAQCAtMTA5MSwxNSArMTExNywxNSBAQAogICAgICAgICB9CiAgICAgICAgIHB3LnByaW50bG4oKTsKIAotICAgICAgICBwdy5wcmludGxuKCJUaGUgdGhyZXNob2xkIGlzICIgKyBtUG9saWN5VGhyZXNob2xkICsKKyAgICAgICAgcHcucHJpbnRsbigiVGhlIHRocmVzaG9sZCBpcyAiIC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ODE3LDEyIEBACiAgICAgICAgICAgICAgICAgICAgIHNXYWtlTG9jay5hY3F1aXJlKCk7CiAgICAgICAgICAgICAgICAgICAgIHNlbmRTdGFydE1lc3NhZ2Uoc3Ryb25nZXN0TG9ja01vZGUgPT0gV2lmaU1hbmFnZXIuV0lGSV9NT0RFX1NDQU5fT05MWSk7CiAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICghbVdpZmlTdGF0ZVRyYWNrZXIuaXNEcml2ZXJTdG9wcGVkKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgaW50IHdha2VMb2NrVGltZW91dCA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLmdldEludCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLldJRklfTU9CSUxFX0RBVEFfVFJBTlNJVElPTl9XQUtFTE9DS19USU1FT1VUX01TLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREVGQVVMVF9XQUtFTE9DS19USU1FT1VUKTsKLSAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICogV2UgYXJlIGFzc3VtaW5nIHRoYXQgQ29ubmVjdGl2aXR5U2VydmljZSBjYW4gbWFrZQotICAgICAgICAgICAgICAgICAgICAgKiBhIHRyYW5zaXRpb24gdG8gY2VsbHVsYXIgZGF0YSB3aXRoaW4gd2FrZUxvY2tUaW1lb3V0IHRpbWUuCi0gICAgICAgICAgICAgICAgICAgICAqIFRoZSB3YWtlbG9jayBpcyByZWxlYXNlZCBieSB0aGUgZGVsYXllZCBtZXNzYWdlLgotICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgc0RyaXZlclN0b3BXYWtlTG9jay5hY3F1aXJlKCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChtQ20gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbUNtID0gKENvbm5lY3Rpdml0eU1hbmFnZXIpbUNvbnRleHQuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldFN5c3RlbVNlcnZpY2UoQ29udGV4dC5DT05ORUNUSVZJVFlfU0VSVklDRSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgbUNtLnJlcXVlc3ROZXR3b3JrVHJhbnNpdGlvbldha2Vsb2NrKFRBRyk7CiAgICAgICAgICAgICAgICAgICAgIG1XaWZpSGFuZGxlci5zZW5kRW1wdHlNZXNzYWdlKE1FU1NBR0VfU1RPUF9XSUZJKTsKLSAgICAgICAgICAgICAgICAgICAgbVdpZmlIYW5kbGVyLnNlbmRFbXB0eU1lc3NhZ2VEZWxheWVkKE1FU1NBR0VfUkVMRUFTRV9XQUtFTE9DSywgd2FrZUxvY2tUaW1lb3V0KTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIHNXYWtlTG9jay5hY3F1aXJlKCk7CkBAIC0xOTI3LDEwICsxOTA4LDYgQEAKICAgICAgICAgICAgICAgICAgICAgLy8gZG9uJ3QgcmVsZWFzZSB3YWtlbG9jawogICAgICAgICAgICAgICAgICAgICBicmVhazsKIAotICAgICAgICAgICAgICAgIGNhc2UgTUVTU0FHRV9SRUxFQVNFX1dBS0VMT0NLOgotICAgICAgICAgICAgICAgICAgICBzRHJpdmVyU3RvcFdha2VMb2NrLnJlbGVhc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KICAgICAgICAgICAgICAgICBjYXNlIE1FU1NBR0VfU1RBUlRfQUNDRVNTX1BPSU5UOgogICAgICAgICAgICAgICAgICAgICBzZXRXaWZpQXBFbmFibGVkQmxvY2tpbmcodHJ1ZSwKICAgICAgICAgICAgICAgICAgICAgICA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luZG93U3RhdGUgdyA9IChXaW5kb3dTdGF0ZSltV2luZG93cy5nZXQoaSk7Ci0gICAgICAgICAgICAgICAgaWYgKHcuaXNWaXNpYmxlTHcoKSAmJiAhdy5tT2JzY3VyZWQKLSAgICAgICAgICAgICAgICAgICAgICAgICYmICh3Lm1PcmllbnRhdGlvbkNoYW5naW5nIHx8ICF3LmlzRHJhd25MdygpKSkgeworICAgICAgICAgICAgICAgIGlmICh3LmlzVmlzaWJsZUx3KCkgJiYgIXcubU9ic2N1cmVkICYmICF3LmlzRHJhd25MdygpKSB7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CkBAIC01NzczLDE5ICs1NzcxLDI0IEBACiAgICAgICAgICAgICAgICAgICAgIFdpbmRvd1N0YXRlIG91dCA9IG1LZXlXYWl0ZXIubU91dHNpZGVUb3VjaFRhcmdldHM7CiAgICAgICAgICAgICAgICAgICAgIGlmIChvdXQgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgTW90aW9uRXZlbnQgb2V2ID0gTW90aW9uRXZlbnQub2J0YWluKGV2KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG9ldi5zZXRBY3Rpb24oTW90aW9uRXZlbnQuQUNUSU9OX09VVFNJREUpOwotICAgICAgICAgICAgICAgICAgICAgICAgZG8gewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFJlY3QgZnJhbWUgPSBvdXQubUZyYW1lOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9ldi5vZmZzZXRMb2NhdGlvbigtKGZsb2F0KWZyYW1lLmxlZnQsIC0oZmxvYXQpZnJhbWUudG9wKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXQubUNsaWVudC5kaXNwYXRjaFBvaW50ZXIob2V2LCBldmVudFRpbWUsIGZhbHNlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChhbmRyb2lkLm9zLlJlbW90ZUV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNsb2cuaShUQUcsICJXSU5ET1cgRElFRCBkdXJpbmcgb3V0c2lkZSBtb3Rpb24gZGlzcGF0Y2g6ICIgKyBvdXQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZXYub2Zmc2V0TG9jYXRpb24oKGZsb2F0KWZyYW1lLmxlZnQsIChmbG9hdClmcmFtZS50b3ApOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dCA9IG91dC5tTmV4dE91dHNpZGVUb3VjaDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKG91dCAhPSBudWxsKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1LZXlXYWl0ZXIubU91dHNpZGVUb3VjaFRhcmdldHMgPSBudWxsOworICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZXYuc2V0QWN0aW9uKE1vdGlvbkV2ZW50LkFDVElPTl9PVVRTSURFKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFJlY3QgZnJhbWUgPSBvdXQubUZyYW1lOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZXYub2Zmc2V0TG9jYXRpb24oLShmbG9hdClmcmFtZS5sZWZ0LCAtKGZsb2F0KWZyYW1lLnRvcCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXQubUNsaWVudC5kaXNwYXRjaFBvaW50ZXIob2V2LCBldmVudFRpbWUsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoYW5kcm9pZC5vcy5SZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2xvZy5pKFRBRywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIldJTkRPVyBESUVEIGR1cmluZyBvdXRzaWRlIG1vdGlvbiBkaXNwYXRjaDogIiArIG91dCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2V2Lm9mZnNldExvY2F0aW9uKChmbG9hdClmcmFtZS5sZWZ0LCAoZmxvYXQpZnJhbWUudG9wKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0ID0gb3V0Lm1OZXh0T3V0c2lkZVRvdWNoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKG91dCAhPSBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtS2V5V2FpdGVyLm1PdXRzaWRlVG91Y2hUYXJnZXRzID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2V2LnJlY3ljbGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KIApAQCAtODU1Nyw3ICs4NTYwLDcgQEAKICAgICAgICAgICAgIGZpbmFsIEFwcFdpbmRvd1Rva2VuIGF0b2tlbiA9IG1BcHBUb2tlbjsKICAgICAgICAgICAgIHJldHVybiBtU3VyZmFjZSAhPSBudWxsICYmICFtQXR0YWNoZWRIaWRkZW4KICAgICAgICAgICAgICAgICAgICAgJiYgKGF0b2tlbiA9PSBudWxsID8gbVBvbGljeVZpc2liaWxpdHkgOiAhYXRva2VuLmhpZGRlblJlcXVlc3RlZCkKLSAgICAgICAgICAgICAgICAgICAgJiYgKG1PcmllbnRhdGlvbkNoYW5naW5nIHx8ICghbURyYXdQZW5kaW5nICYmICFtQ29tbWl0RHJhd1BlbmRpbmcpKQorICAgICAgICAgICAgICAgICAgICAmJiAhbURyYXdQZW5kaW5nICYmICFtQ29tbWl0RHJhd1BlbmRpbmcKICAgICAgICAgICAgICAgICAgICAgJiYgIW1FeGl0aW5nICYmICFtRGVzdHJveWluZzsKICAgICAgICAgfQogCkBAIC04NjYxLDE0ICs4NjY0LDEyIEBACiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFJldHVybnMgdHJ1ZSBpZiB0aGUgd2luZG93IGhhcyBhIHN1cmZhY2UgdGhhdCBpdCBoYXMgZHJhd24gYQotICAgICAgICAgKiBjb21wbGV0ZSBVSSBpbiB0by4gIE5vdGUgdGhhdCB0aGlzIHJldHVybnMgdHJ1ZSBpZiB0aGUgb3JpZW50YXRpb24KLSAgICAgICAgICogaXMgY2hhbmdpbmcgZXZlbiBpZiB0aGUgd2luZG93IGhhc24ndCByZWRyYXduIGJlY2F1c2Ugd2UgZG9uJ3Qgd2FudAotICAgICAgICAgKiB0byBzdG9wIHRoaW5ncyBmcm9tIGV4ZWN1dGluZyBkdXJpbmcgdGhhdCB0aW1lLgorICAgICAgICAgKiBjb21wbGV0ZSBVSSBpbiB0by4KICAgICAgICAgICovCiAgICAgICAgIHB1YmxpYyBib29sZWFuIGlzRHJhd25MdygpIHsKICAgICAgICAgICAgIGZpbmFsIEFwcFdpbmRvd1Rva2VuIGF0b2tlbiA9IG1BcHBUb2tlbjsKICAgICAgICAgICAgIHJldHVybiBtU3VyZmFjZSAhPSBudWxsICYmICFtRGVzdHJveWluZwotICAgICAgICAgICAgICAgICYmIChtT3JpZW50YXRpb25DaGFuZ2luZyB8fCAoIW1EcmF3UGVuZGluZyAmJiAhbUNvbW1pdERyYXdQZW5kaW5nKSk7CisgICAgICAgICAgICAgICAgJiYgIW1EcmF3UGVuZGluZyAmJiAhbUNvbW1pdERyYXdQZW5kaW5nOwogICAgICAgICB9CiAKICAgICAgICAgcHVibGljIGJvb2xlYW4gZmlsbHNTY3JlZW5MdyhpbnQgc2NyZWVuV2lkdGgsIGludCBzY3JlZW5IZWlnaHQsCkBAIC0xMDk0MSwxMiArMTA5NDIsNiBAQAogICAgICAgICAgICAgICAgICAgICBpZiAody5tQXR0YWNoZWRIaWRkZW4gfHwgIXcuaXNSZWFkeUZvckRpc3BsYXkoKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF3Lm1MYXN0SGlkZGVuKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9kdW1wKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHX0NPTkZJR1VSQVRJT04pIFNsb2cudihUQUcsICJXaW5kb3cgaGlkaW5nOiB3YWl0aW5nVG9TaG93PSIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgdy5tUm9vdFRva2VuLndhaXRpbmdUb1Nob3cgKyAiIHBvbHZpcz0iCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHcubVBvbGljeVZpc2liaWxpdHkgKyAiIGF0dGhpZD0iCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHcubUF0dGFjaGVkSGlkZGVuICsgIiB0b2toaWQ9IgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyB3Lm1Sb290VG9rZW4uaGlkZGVuICsgIiB2aXM9IgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyB3Lm1WaWV3VmlzaWJpbGl0eSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy5tTGFzdEhpZGRlbiA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFNIT1dfVFJBTlNBQ1RJT05TKSBsb2dTdXJmYWNlKHcsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiSElERSAocGVyZm9ybUxheW91dCkiLCBudWxsKTsKQEAgLTExMzQyLDI4ICsxMTMzNywyMyBAQAogICAgICAgICB9IGVsc2UgaWYgKGFuaW1hdGluZykgewogICAgICAgICAgICAgcmVxdWVzdEFuaW1hdGlvbkxvY2tlZChjdXJyZW50VGltZSsoMTAwMC82MCktU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCkpOwogICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICBpZiAoREVCVUdfRlJFRVpFKSBTbG9nLnYoVEFHLCAiTGF5b3V0OiBtRGlzcGxheUZyb3plbj0iICsgbURpc3BsYXlGcm96ZW4KLSAgICAgICAgICAgICAgICArICIgaG9sZFNjcmVlbj0iICsgaG9sZFNjcmVlbik7Ci0gICAgICAgIGlmICghbURpc3BsYXlGcm96ZW4pIHsKLSAgICAgICAgICAgIHNldEhvbGRTY3JlZW5Mb2NrZWQoaG9sZFNjcmVlbiAhPSBudWxsKTsKLSAgICAgICAgICAgIGlmIChzY3JlZW5CcmlnaHRuZXNzIDwgMCB8fCBzY3JlZW5CcmlnaHRuZXNzID4gMS4wZikgewotICAgICAgICAgICAgICAgIG1Qb3dlck1hbmFnZXIuc2V0U2NyZWVuQnJpZ2h0bmVzc092ZXJyaWRlKC0xKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgbVBvd2VyTWFuYWdlci5zZXRTY3JlZW5CcmlnaHRuZXNzT3ZlcnJpZGUoKGludCkKLSAgICAgICAgICAgICAgICAgICAgICAgIChzY3JlZW5CcmlnaHRuZXNzICogUG93ZXIuQlJJR0hUTkVTU19PTikpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKGJ1dHRvbkJyaWdodG5lc3MgPCAwIHx8IGJ1dHRvbkJyaWdodG5lc3MgPiAxLjBmKSB7Ci0gICAgICAgICAgICAgICAgbVBvd2VyTWFuYWdlci5zZXRCdXR0b25CcmlnaHRuZXNzT3ZlcnJpZGUoLTEpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBtUG93ZXJNYW5hZ2VyLnNldEJ1dHRvbkJyaWdodG5lc3NPdmVycmlkZSgoaW50KQotICAgICAgICAgICAgICAgICAgICAgICAgKGJ1dHRvbkJyaWdodG5lc3MgKiBQb3dlci5CUklHSFRORVNTX09OKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoaG9sZFNjcmVlbiAhPSBtSG9sZGluZ1NjcmVlbk9uKSB7Ci0gICAgICAgICAgICAgICAgbUhvbGRpbmdTY3JlZW5PbiA9IGhvbGRTY3JlZW47Ci0gICAgICAgICAgICAgICAgTWVzc2FnZSBtID0gbUgub2J0YWluTWVzc2FnZShILkhPTERfU0NSRUVOX0NIQU5HRUQsIGhvbGRTY3JlZW4pOwotICAgICAgICAgICAgICAgIG1ILnNlbmRNZXNzYWdlKG0pOwotICAgICAgICAgICAgfQorICAgICAgICBzZXRIb2xkU2NyZWVuTG9ja2VkKGhvbGRTY3JlZW4gIT0gbnVsbCk7CisgICAgICAgIGlmIChzY3JlZW5CcmlnaHRuZXNzIDwgMCB8fCBzY3JlZW5CcmlnaHRuZXNzID4gMS4wZikgeworICAgICAgICAgICAgbVBvd2VyTWFuYWdlci5zZXRTY3JlZW5CcmlnaHRuZXNzT3ZlcnJpZGUoLTEpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbVBvd2VyTWFuYWdlci5zZXRTY3JlZW5CcmlnaHRuZXNzT3ZlcnJpZGUoKGludCkKKyAgICAgICAgICAgICAgICAgICAgKHNjcmVlbkJyaWdodG5lc3MgKiBQb3dlci5CUklHSFRORVNTX09OKSk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGJ1dHRvbkJyaWdodG5lc3MgPCAwIHx8IGJ1dHRvbkJyaWdodG5lc3MgPiAxLjBmKSB7CisgICAgICAgICAgICBtUG93ZXJNYW5hZ2VyLnNldEJ1dHRvbkJyaWdodG5lc3NPdmVycmlkZS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aWwKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgVGhyZWFkLnNsZWVwKHBvbGxUbWVvdXQpOworICAgICAgICAgICAgfSBjYXRjaCAoSW50ZXJydXB0ZWRFeGNlcHRpb24gaWUpIHsKKyAgICAgICAgICAgICAgICAvKiBpZ25vcmUgKi8KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIHBvbGwgZm9yIHZlcmlmaWNhdGlvbiBhbmQgaWYgdGhpcyBmYWlscyBzYXZlIHRoZSBleGNlcHRpb24gYW5kCisgICAgICAgICAgICAvLyBrZWVwIHBvbGxpbmcKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgc2VydmljZS52ZXJpZnkoKTsKKyAgICAgICAgICAgICAgICAvLyByZXNldCBzbyBpdCBkb2VzIG5vdCBhY2NlcHQgbW9yZSBldmVudHMKKyAgICAgICAgICAgICAgICBzZXJ2aWNlLnJlc2V0KCk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBsYXN0VmVyaWZ5RXhjZXB0aW9uID0gZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIHJlc2V0LCB3ZSBoYXZlIGFscmVhZHkgZmFpbGVkCisgICAgICAgIHNlcnZpY2UucmVzZXQoKTsKKworICAgICAgICAvLyBhbHdheXMgbm90IG51bGwKKyAgICAgICAgdGhyb3cgbGFzdFZlcmlmeUV4Y2VwdGlvbjsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUaGlzIGNsYXNzIGlzIHRoZSBmaXJzdCBtb2NrIHtAbGluayBBY2Nlc3NpYmlsaXR5U2VydmljZX0uCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBjbGFzcyBNeUZpcnN0TW9ja0FjY2Vzc2liaWxpdHlTZXJ2aWNlIGV4dGVuZHMgTW9ja0FjY2Vzc2lia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KKworICAgIC8qKgorICAgICAqIFJlc2V0cyB0aGlzIGluc3RhbmNlIHNvIGl0IGNhbiBiZSByZXVzZWQuCisgICAgICovCisgICAgcHVibGljIHZvaWQgcmVzZXQoKSB7CisgICAgICAgIG1FeHBlY3RlZEV2ZW50cy5jbGVhcigpOworICAgICAgICBtRXhwZWN0ZWRJbnRlcnJ1cHQgPSBmYWxzZTsKKyAgICAgICAgbVJlcGxheWluZyA9IGZhbHNlOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldHMgYW4gZXhwZWN0ZWQgY2FsbCB0bworICAgICAqIHtAbGluayAjb25BY2Nlc3NpYmlsaXR5RXZlbnQoQWNjZXNzaWJpbGl0eUV2ZW50KX0gd2l0aCBnaXZlbiBldmVudCBhcworICAgICAqIGFyZ3VtZW50LgorICAgICAqCisgICAgICogQHBhcmFtIGV4cGVjdGVkRXZlbnQgVGhlIGV4cGVjdGVkIGV2ZW50IGFyZ3VtZW50LgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGV4cGVjdEV2ZW50KEFjY2Vzc2liaWxpdHlFdmVudCBleHBlY3RlZEV2ZW50KSB7CisgICAgICAgIG1FeHBlY3RlZEV2ZW50cy5hZGQoZXhwZWN0ZWRFdmVudCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0cyBhbiBleHBlY3RlZCBjYWxsIG9mIHtAbGluayAjb25JbnRlcnJ1cHQoKX0uCisgICAgICovCisgICAgcHVibGljIHZvaWQgZXhwZWN0SW50ZXJydXB0KCkgeworICAgICAgICBtRXhwZWN0ZWRJbnRlcnJ1cHQgPSB0cnVlOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIG9uQWNjZXNzaWJpbGl0eUV2ZW50KEFjY2Vzc2liaWxpdHlFdmVudCByZWNlaXZlZEV2ZW50KSB7CisgICAgICAgIGlmICghbVJlcGxheWluZykgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgaWYgKG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ICAvLyBNYWtlIHN1cmUgdXNlciBpcyBkZWxldGluZyBvbmUgY2hhciwgd2l0aG91dCBhIHNlbGVjdGlvbgotICAgICAgICAgICAgZmluYWwgaW50IHNlbFN0YXJ0ID0gU2VsZWN0aW9uLmdldFNlbGVjdGlvblN0YXJ0KHMpOwotICAgICAgICAgICAgZmluYWwgaW50IHNlbEVuZCA9IFNlbGVjdGlvbi5nZXRTZWxlY3Rpb25FbmQocyk7Ci0gICAgICAgICAgICBpZiAocy5sZW5ndGgoKSA+IDEgLy8gQ2FuIGRlbGV0ZSBhbm90aGVyIGNoYXJhY3RlcgotICAgICAgICAgICAgICAgICAgICAmJiBjb3VudCA9PSAxIC8vIERlbGV0aW5nIG9ubHkgb25lIGNoYXJhY3RlcgotICAgICAgICAgICAgICAgICAgICAmJiBhZnRlciA9PSAwIC8vIERlbGV0aW5nCi0gICAgICAgICAgICAgICAgICAgICYmIHMuY2hhckF0KHN0YXJ0KSA9PSAnLScgLy8gYSBoeXBoZW4KLSAgICAgICAgICAgICAgICAgICAgJiYgc2VsU3RhcnQgPT0gc2VsRW5kKSB7IC8vIG5vIHNlbGVjdGlvbgotICAgICAgICAgICAgICAgIG1EZWxldGluZ0h5cGhlbiA9IHRydWU7Ci0gICAgICAgICAgICAgICAgbUh5cGhlblN0YXJ0ID0gc3RhcnQ7Ci0gICAgICAgICAgICAgICAgLy8gQ2hlY2sgaWYgdGhlIHVzZXIgaXMgZGVsZXRpbmcgZm9yd2FyZCBvciBiYWNrd2FyZAotICAgICAgICAgICAgICAgIGlmIChzZWxTdGFydCA9PSBzdGFydCArIDEpIHsKLSAgICAgICAgICAgICAgICAgICAgbURlbGV0aW5nQmFja3dhcmQgPSB0cnVlOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIG1EZWxldGluZ0JhY2t3YXJkID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAg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SBzLCBpbnQgc3RhcnQsIGludCBiZWZvcmUsIGludCBjb3VudCkgewotICAgICAgICAvLyBEb2VzIG5vdGhpbmcKKyAgICAgICAgaWYgKG1TZWxmQ2hhbmdlIHx8IG1TdG9wRm9ybWF0dGluZykgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGlmIChtU3RhdGUgPT0gU1RBVEVfT1RIRVIpIHsKKyAgICAgICAgICAgIGlmIChjb3VudCA+IDAgJiYgIWhhc1NlcGFyYXRvcihzLCBzdGFydCwgY291bnQpKSB7CisgICAgICAgICAgICAgICAgLy8gVXNlciBpbnNlcnRlZCB0aGUgZGlhbGFibGUgY2hhcmFjdGVycyBpbiB0aGUgbWlkZGxlIG9mIHRleHQuCisgICAgICAgICAgICAgICAgbVN0YXRlID0gU1RBVEVfTU9ESUZZX0RJR0lUUzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAvLyBDaGVjayB3aGV0aGVyIHdlIHNob3VsZCBzdG9wIGZvcm1hdHRpbmcuCisgICAgICAgIGlmIChtU3RhdGUgPT0gU1RBVEVfQVBQRU5EICYmIGNvdW50ID4gMCAmJiBoYXNTZXBhcmF0b3Iocywgc3RhcnQsIGNvdW50KSkgeworICAgICAgICAgICAgLy8gVXNlciBhcHBlbmRlZCB0aGUgbm9uLWRpYWxhYmxlIGNoYXJhY3Rlciwgc3RvcCBmb3JtYXR0aW5nLgorICAgICAgICAgICAgc3RvcEZvcm1hdHRpbmcoKTsKKyAgICAgICAgfSBlbHNlIGlmIChtU3RhdGUgPT0gU1RBVEVfT1RIRVIpIHsKKyAgICAgICAgICAgIC8vIFVzZXIgbXVzdCBpbnNlcnQgb3IgcmVtb3ZlIHRoZSBub24tZGlhbGFibGUgY2hhcmFjdGVycyBpbiB0aGUgYmVnaW4gb3IgbWlkZGxlIG9mCisgICAgICAgICAgICAvLyBudW1iZXIsIHN0b3AgZm9ybWF0dGluZy4gCisgICAgICAgICAgICBzdG9wRm9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W47IGkrKykgeworICAgICAgICAgICAgY2hhciBjID0gcy5jaGFyQXQoaSk7CisgICAgICAgICAgICBpZiAoUGhvbmVOdW1iZXJVdGlscy5pc05vblNlcGFyYXRvcihjKSkgeworICAgICAgICAgICAgICAgIGlmIChsYXN0Tm9uU2VwYXJhdG9yICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgZm9ybWF0dGVkID0gZ2V0Rm9ybWF0dGVkTnVtYmVyKGxhc3ROb25TZXBhcmF0b3IsIGhhc0N1cnNvcik7CisgICAgICAgICAgICAgICAgICAgIGhhc0N1cnNvciA9IGZhbHNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBsYXN0Tm9uU2VwYXJhdG9yID0gYzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChpID09IGN1ckluZGV4KSB7CisgICAgICAgICAgICAgICAgaGFzQ3Vyc29yID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAobGFzdE5vblNlcGFyYXRvciAhPSAwKSB7CisgICAgICAgICAgICBmb3JtYXR0ZWQgPSBnZXRGb3JtYXR0ZWROdW1iZXIobGFzdE5vblNlcGFyYXRvciwgaGFzQ3Vyc29yKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZm9ybWF0dGVkOworICAgIH0KKworICAgIHByaXZhdGUgU3RyaW5nIGdldEZvcm1hdHRlZE51bWJlcihjaGFyIGxhc3ROb25TZXBhcmF0b3IsIGJvb2xlYW4gaGFzQ3Vyc29yKSB7CisgICAgICAgIHJldHVybiBoYXNDdXJzb3IgPyBtRm9ybWF0dGVyLmlucHV0RGlnaXRBbmRSZW1lbWJlclBvc2l0aW9uKGxhc3ROb25TZXBhcmF0b3IpCisgICAgICAgICAgICAgICAgOiBtRm9ybWF0dGVyLmlucHV0RGlnaXQobGFzdE5vblNlcGFyYXRvcik7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHN0b3BGb3JtYXR0aW5nKCkgeworICAgICAgICBtU3RvcEZvcm1hdHRpbmcgPSB0cnVlOworICAgICAgICBtRm9ybWF0dGVyLmNsZWFyKCk7CisgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIGhhc1NlcGFyYXRvcihmaW5hbCBDaGFyU2VxdWVuY2UgcywgZmluYWwgaW50IHN0YXJ0LCBmaW5hbCBpbnQgY291bnQpIHsKKyAgICAgICAgZm9yIChpbnQgaSA9IHN0YXJ0OyBpIDwgc3RhcnQgKyBjb3VudDsgaSsrKSB7CisgICAgICAgICAgICBjaGFyIGMgPSBzLmNoYXJBdChpKTsKKyAgICAgICAgICAgIGlmICghUGhvbmVOdW1iZXJVdGlscy5pc05vblNlcGFyYXRvcihjKSkgeworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKICAgICB9CiB9CmRpZmYgLS1naXQgYS90ZWxlcGhvbnkvamF2YS9hbmRyb2lkL3RlbGVwaG9ueS9QaG9uZU51bWJlclV0aWxzLmphdmEgYi90ZWxlcGhvbnkvamF2YS9hbmRyb2lkL3RlbGVwaG9ueS9QaG9uZU51bWJlclV0aWxzLmphdmEKaW5kZXggZjIyMTJmYi4uZTFiOWI2MCAxMDA2NDQKLS0tIGEvdGVsZXBob255L2phdmEvYW5kcm9pZC90ZWxlcGhvbnkvUGhvbmVOdW1iZXJVdGlscy5qYXZhCisrKyBiL3RlbGVwaG9ueS9qYXZhL2FuZHJvaWQvdGVsZXBob255L1Bob25lTnVtYmVyVXRpbHMuamF2YQpAQCAtNTg2LDcgKzU4Niw3IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAvLyBJbiB0aGUgVVMsIDEtNjUwLTU1NS0xMjM0IG11c3QgYmUgZXF1YWwgdG8gNjUwLTU1NS0xMjM0LAotICAgICAgICAgICAgLy8gd2hpbGUgMDkwLTEyMzQtMTIzNC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W5hbCBSZWdpc3RyYW50TGlzdCBtU3VwcFNlcnZpY2VGYWlsZWRSZWdpc3RyYW50cworICAgID0gbmV3IFJlZ2lzdHJhbnRMaXN0KCk7CisKKyAgICBwcml2YXRlIENhbGxNYW5hZ2VyKCkgeworICAgICAgICBtUGhvbmVzID0gbmV3IEFycmF5TGlzdDxQaG9uZT4oKTsKKyAgICAgICAgbVJpbmdpbmdDYWxscyA9IG5ldyBBcnJheUxpc3Q8Q2FsbD4oKTsKKyAgICAgICAgbUJhY2tncm91bmRDYWxscyA9IG5ldyBBcnJheUxpc3Q8Q2FsbD4oKTsKKyAgICAgICAgbUZvcmVncm91bmRDYWxscyA9IG5ldyBBcnJheUxpc3Q8Q2FsbD4oKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBnZXQgc2luZ2xldG9uIGluc3RhbmNlIG9mIENhbGxNYW5hZ2VyCisgICAgICogQHJldHVybiBDYWxsTWFuYWdlcgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgQ2FsbE1hbmFnZXIgZ2V0SW5zdGFuY2UoKSB7CisgICAgICAgIHJldHVybiBJTlNUQU5DRTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZWdpc3RlciBwaG9uZSB0byBDYWxsTWFuYWdlcgorICAgICAqIEBwYXJhbSBwaG9uZQorICAgICAqIEByZXR1cm4KKyAgICAgKi8KKyAgICBwdWJsaWMgYm9vbGVhbiByZWdpc3RlclBob25lKFBob25lIHBob25lKSB7CisgICAgICAgIGlmIChwaG9uZSAhPSBudWxsICYmICFtUGhvbmVzLmNvbnRhaW5zKHBob25lKSkgeworICAgICAgICAgICAgbVBob25lcy5hZGQocGhvbmUpOworICAgICAgICAgICAgbVJpbmdpbmdDYWxscy5hZGQocGhvbmUuZ2V0UmluZ2luZ0NhbGwoKSk7CisgICAgICAgICAgICBtQmFja2dyb3VuZENhbGxzLmFkZChwaG9uZS5nZXRCYWNrZ3JvdW5kQ2FsbCgpKTsKKyAgICAgICAgICAgIG1Gb3JlZ3JvdW5kQ2FsbHMuYWRkKHBob25lLmdldEZvcmVncm91bmRDYWxsKCkpOworICAgICAgICAgICAgcmVnaXN0ZXJGb3JQaG9uZVN0YXRlcyhwaG9uZSk7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgLyoqCisgICAgICogdW5yZWdpc3RlciBwaG9uZSBmcm9tIENhbGxNYW5hZ2VyCisgICAgICogQHBhcmFtIHBob25lCisgICAgICovCisgICAgcHVibGljIHZvaWQgdW5yZWdpc3RlclBob25lKFBob25lIHBob25lKSB7CisgICAgICAgIGlmIChwaG9uZSAhPSBudWxsICYmICFtUGhvbmVzLmNvbnRhaW5zKHBob25lKSkgeworICAgICAgICAgICAgbVBob25lcy5yZW1vdmUocGhvbmUpOworICAgICAgICAgICAgbVJpbmdpbmdDYWxscy5yZW1vdmUocGhvbmUuZ2V0UmluZ2luZ0NhbGwoKSk7CisgICAgICAgICAgICBtQmFja2dyb3VuZENhbGxzLnJlbW92ZShwaG9uZS5nZXRCYWNrZ3JvdW5kQ2FsbCgpKTsKKyAgICAgICAgICAgIG1Gb3JlZ3JvdW5kQ2FsbHMucmVtb3ZlKHBob25lLmdldEZvcmVncm91bmRDYWxsKCkpOworICAgICAgICAgICAgdW5yZWdpc3RlckZvclBob25lU3RhdGVzKHBob25lKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCByZWdpc3RlckZvclBob25lU3RhdGVzKFBob25lIHBob25lKSB7CisgICAgICAgIHBob25lLnJlZ2lzdGVyRm9yUHJlY2lzZUNhbGxTdGF0ZUNoYW5nZWQobUhhbmRsZXIsIEVWRU5UX0NBTExfU1RBVEVfQ0hBTkdFRCwgbnVsbCk7CisgICAgICAgIHBob25lLnJlZ2lzdGVyRm9yRGlzY29ubmVjdChtSGFuZGxlciwgRVZFTlRfRElTQ09OTkVDVCwgbnVsbCk7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ICAgIHJldHVybiBtQmFja2dyb3VuZENhbGxzOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybiB0aGUgbm9uIGlkbGUgZm9yZWdyb3VuZCBjYWxsLAorICAgICAqIG5vdGU6IHRoZXJlIGlzIGRpZmZlcmVuY2UgYmV0d2VlbiBpc0FsaXZlIGFuZCBub24gaWRsZQorICAgICAqLworICAgIHB1YmxpYyBDYWxsIGdldEFjdGl2ZUZnQ2FsbCgpIHsKKyAgICAgICAgZm9yIChDYWxsIGNhbGwgOiBtRm9yZWdyb3VuZENhbGxzKSB7CisgICAgICAgICAgICBpZiAoY2FsbC5nZXRTdGF0ZSgpICE9IENhbGwuU3RhdGUuSURMRSkgeworICAgICAgICAgICAgICAgIHJldHVybiBjYWxsOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIC8qKgorICAgICAqIHJldHVybiB0aGUgZmlyc3QgYWN0aXZlIGNhbGwgZnJvbSBhIGNhbGwgbGlzdAorICAgICAqLworICAgIHByaXZhdGUgIENhbGwgZ2V0Rmlyc3RBY3RpdmVDYWxsKEFycmF5TGlzdDxDYWxsPiBjYWxscykgeworICAgICAgICBmb3IgKENhbGwgY2FsbCA6IGNhbGxzKSB7CisgICAgICAgICAgICBpZiAoIWNhbGwuaXNJZGxlKCkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gY2FsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm4gdHJ1ZSBpZiB0aGVyZSBpcyBhdCBsZWFzdCBvbmUgYWN0aXZlIGZvcmVncm91bmQgY2FsbAorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIGhhc0FjdGl2ZUZnQ2FsbCgpIHsKKyAgICAgICAgcmV0dXJuIChnZXRGaXJzdEFjdGl2ZUNhbGwobUZvcmVncm91bmRDYWxscykgIT0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vbiBwb2ludCBmb3Igc3Vic2NyaXB0aW9uIGluZm8gcmVhZHkKKyAgICAgKiBAcGFyYW0gaCBoYW5kbGVyIHRvIG5vdGlmeQorICAgICAqIEBwYXJhbSB3aGF0IHdoYXQgY29kZSBvZiBtZXNzYWdlIHdoZW4gZGVsaXZlcmVkCisgICAgICogQHBhcmFtIG9iaiBwbGFjZWQgaW4gTWVzc2FnZS5vYmoKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCByZWdpc3RlckZvclN1YnNjcmlwdGlvbkluZm9SZWFkeShIYW5kbGVyIGgsIGludCB3aGF0LCBPYmplY3Qgb2JqKXt9CisKKyAgICAvKioKKyAgICAgKiBVbnJlZ2lzdGVyIGZvciBub3RpZmljYXRpb25zIGZvciBzdWJzY3JpcHRpb24gaW5mbworICAgICAqIEBwYXJhbSBoIEhhbmRsZXIgdG8gYmUgcmVtb3ZlZCBmcm9tIHRoZSByZWdpc3RyYW50IGxpc3QuCisgICAgICovCisgICAgcHVibGljIHZvaWQgdW5yZWdpc3RlckZvclN1YnNjcmlwdGlvbkluZm9SZWFkeShIYW5kbGVyIGgpe30KKworICAgIHByaXZhdGUgSGFuZGxlciBtSGFuZGxlciA9IG5ldyBIYW5kbGVyKCkgeworCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBoYW5kbGVNZXNzYWdlKE1lc3NhZ2UgbXNnKSB7CisgICAgICAgICAgICBzd2l0Y2ggKG1zZy53aGF0KSB7CisgICAgICAgICAgICAgICAgY2FzZSBFVkVOVF9ESVNDT05ORUNUOgorICAgICAgICAgICAgICAgICAgICBtRGlzY29ubmVjdFJlZ2lzdHJhbnRzLm5vdGlmeVJlZ2lzdHJhbnRzKChBc3luY1Jlc3VsdCkgbXNnLm9iaik7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgRVZFTlRfQ0FMTF9TVEFURV9DSEFOR0VEOgorICAgICAgICAgICAgICAgICA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RyaW5nIGFwblR5cGUpIHsKKyAgICAgICAgcmV0dXJuIGlzQXBuSWRFbmFibGVkKGFwblR5cGVUb0lkKGFwblR5cGUpKTsKKyAgICB9CisKKyAgICBwcm90ZWN0ZWQgc3luY2hyb25pemVkIGJvb2xlYW4gaXNBcG5JZEVuYWJsZWQoaW50IGlkKSB7CiAgICAgICAgIGlmIChpZCAhPSBBUE5fSU5WQUxJRF9JRCkgewogICAgICAgICAgICAgcmV0dXJuIGRhdGFFbmFibGVkW2lkXTsKICAgICAgICAgfQpAQCAtNDQ0LDIyICs1MjQsMjEgQEAKICAgICAgICAgICAgIHJldHVybiBQaG9uZS5BUE5fUkVRVUVTVF9GQUlMRUQ7CiAgICAgICAgIH0KIAotICAgICAgICBpZiAoREJHKSBMb2cuZChMT0dfVEFHLCAiZW5hYmxlQXBuVHlwZSgiK3R5cGUrIiksIGlzQXBuVHlwZUFjdGl2ZSA9ICIKLSAgICAgICAgICAgICAgICArIGlzQXBuVHlwZUFjdGl2ZSh0eXBlKSArICIgYW5kIHN0YXRlID0gIiArIHN0YXRlKTsKKyAgICAgICAgaWYgKERCRykgeworICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgImVuYWJsZUFwblR5cGUoIiArIHR5cGUgKyAiKSwgaXNBcG5UeXBlQWN0aXZlID0gIgorICAgICAgICAgICAgICAgICAgICArIGlzQXBuVHlwZUFjdGl2ZSh0eXBlKSArICIsIGlzQXBuSWRFbmFibGVkID0iICsgaXNBcG5JZEVuYWJsZWQoaWQpICsKKyAgICAgICAgICAgICAgICAgICAgIiBhbmQgc3RhdGUgPSAiICsgc3RhdGUpOworICAgICAgICB9CiAKICAgICAgICAgaWYgKCFpc0FwblR5cGVBdmFpbGFibGUodHlwZSkpIHsKICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKExPR19UQUcsICJ0eXBlIG5vdCBhdmFpbGFibGUiKTsKICAgICAgICAgICAgIHJldHVybiBQaG9uZS5BUE5fVFlQRV9OT1RfQVZBSUx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ludCBhcG5JZCwgaW50IGVuYWJsZWQpIHsKICAgICAgICAgaWYgKERCRykgewogICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIkVWRU5UX0FQTl9FTkFCTEVfUkVRVUVTVCAiICsgYXBuSWQgKyAiLCAiICsgZW5hYmxlZCk7Ci0gICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiIGRhdGFFbmFibGVkID0gIiArIGRhdGFFbmFibGVkW2FwbklkXSArCi0gICAgICAgICAgICAgICAgICAgICIsIGVuYWJsZWRDb3VudCA9ICIgKyBlbmFibGVkQ291bnQgKwotICAgICAgICAgICAgICAgICAgICAiLCBpc0FwblR5cGVBY3RpdmUgPSAiICsgaXNBcG5UeXBlQWN0aXZlKGFwbklkVG9UeXBlKGFwbklkKSkpOworICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIiBkYXRhRW5hYmxlZCA9ICIgKyBkYXRhRW5hYmxlZFthcG5JZF0gKyAiLCBlbmFibGVkQ291bnQgPSAiCisgICAgICAgICAgICAgICAgICAgICsgZW5hYmxlZENvdW50ICsgIiwgaXNBcG5UeXBlQWN0aXZlID0gIiArIGlzQXBuVHlwZUFjdGl2ZShhcG5JZFRvVHlwZShhcG5JZCkpKTsKICAgICAgICAgfQogICAgICAgICBpZiAoZW5hYmxlZCA9PSBFTkFCTEVEKSB7CiAgICAgICAgICAgICBpZiAoIWRhdGFFbmFibGVkW2FwbklkXSkgewpAQCAtNTIwLDYgKzU5OSw4IEBACiAgICAgICAgICAgICBpZiAoIWlzQXBuVHlwZUFjdGl2ZSh0eXBlKSkgewogICAgICAgICAgICAgICAgIG1SZXF1ZXN0ZWRBcG5UeXBlID0gdHlwZTsKICAgICAgICAgICAgICAgICBvbkVuYWJsZU5ld0FwbigpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBub3RpZnlBcG5JZFVwVG9DdXJyZW50KFBob25lLlJFQVNPTl9BUE5fU1dJVENIRUQsIGFwbklkKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIC8vIGRpc2FibGUKQEAgLTUyOCw4ICs2MDksMTcgQEAKICAgICAgICAgICAgICAgICBlbmFibGVkQ291bnQtLTsKICAgICAgICAgICAgICAgICBpZiAoZW5hYmxlZENvdW50ID09IDApIHsKICAgICAgICAgICAgICAgICAgICAgb25DbGVhblVwQ29ubmVjdGlvbih0cnVlLCBQaG9uZS5SRUFTT05fREFUQV9ESVNBQkxFRCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChkYXRhRW5hYmxlZFtBUE5fREVGQVVMVF9JRF0gPT0gdHJ1ZSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgIWlzQXBuVHlwZUFjdGl2ZShQaG9uZS5BUE5fVFlQRV9ERUZBVUxUKSkgeworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8vIHNlbmQgdGhlIGRpc2Nvbm5lY3QgbXNnIG1hbnVhbGx5LCBzaW5jZSB0aGUgbm9ybWFsIHJvdXRlIHdvbnQgc2VuZAorICAgICAgICAgICAgICAgIC8vIGl0IChpdCdzIG5vdCBlbmFibGVkKQorICAgICAgICAgICAgICAgIG5vdGlmeUFwbklkRGlzY29ubmVjdGVkKFBob25lLlJFQVNPTl9EQVRBX0RJU0FCTEVELCBhcG5JZCk7CisgICAgICAgICAgICAgICAgaWYgKGRhdGFFbmFibGVkW0FQTl9ERUZBVUxUX0lEXSA9PSB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhaXNBcG5UeXBlQWN0aXZlKFBob25lLkFQTl9UWVBFX0RFRkFVTFQpKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFRPRE8gLSB0aGlzIGlzIGFuIHVnbHkgd2F5IHRvIHJlc3RvcmUgdGhlIGRlZmF1bHQgY29ubiAtIHNob3VsZCBiZSBkb25lCisgICAgICAgICAgICAgICAgICAgIC8vIGJ5IGEgcmVhbCBjb250ZW50aW9uIG1hbm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gICAgICAgIFRlbGVwaG9ueU1hbmFnZXIgdGVsZXBob255ID0gVGVsZXBob255TWFuYWdlci5nZXREZWZhdWx0KCk7CiAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICBtUmVnaXN0cnkubm90aWZ5RGF0YUNvbm5lY3Rpb24oCi0gICAgICAgICAgICAgICAgICAgIGNvbnZlcnREYXRhU3RhdGUoc2VuZGVyLmdldERhdGFDb25uZWN0aW9uU3RhdGUoKSksCisgICAgICAgICAgICAgICAgICAgIGNvbnZlcnREYXRhU3RhdGUoc3RhdGUpLAogICAgICAgICAgICAgICAgICAgICBzZW5kZXIuaXNEYXRhQ29ubmVjdGl2aXR5UG9zc2libGUoKSwgcmVhc29uLAogICAgICAgICAgICAgICAgICAgICBzZW5kZXIuZ2V0QWN0aXZlQXBuKCksCi0gICAgICAgICAgICAgICAgICAgIHNlbmRlci5nZXRBY3RpdmVBcG5UeXBlcygpLAorICAgICAgICAgICAgICAgICAgICBhcG5UeXBlLAogICAgICAgICAgICAgICAgICAgICBzZW5kZXIuZ2V0SW50ZXJmYWNlTmFtZShudWxsKSwKICAgICAgICAgICAgICAgICAgICAgKCh0ZWxlcGhvbnkhPW51bGwpID8gdGVsZXBob255LmdldE5ldHdvcmtUeXBlKCkgOgogICAgICAgICAgICAgICAgICAgICBUZWxlcGhvbnlNYW5hZ2VyLk5FVFdPUktfVFlQRV9VTktOT1dOKSk7CkBAIC0xMDgsOSArMTIxLDkgQEAKICAgICAgICAgfQogICAgIH0KIAotICAgIHB1YmxpYyB2b2lkIG5vdGlmeURhdGFDb25uZWN0aW9uRmFpbGVkKFBob25lIHNlbmRlciwgU3RyaW5nIHJlYXNvbikgeworICAgIHB1YmxpYyB2b2lkIG5vdGlmeURhdGFDb25uZWN0aW9uRmFpbGVkKFBob25lIHNlbmRlciwgU3RyaW5nIHJlYXNvbiwgU3RyaW5nIGFwblR5cGUpIHsKICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIG1SZWdpc3RyeS5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ZSBBcnJheUxpc3QgbVNUcmFja2VycyA9IG5ldyBBcnJheUxpc3QoTU9fTVNHX1FVRVVFX0xJTUlUKTsKKyAgICBwcml2YXRlIEFycmF5TGlzdDxTbXNUcmFja2VyPiBtU1RyYWNrZXJzID0gbmV3IEFycmF5TGlzdDxTbXNUcmFja2VyPihNT19NU0dfUVVFVUVfTElNSVQpOwogCiAgICAgLyoqIFdha2UgbG9jayB0byBlbnN1cmUgZGV2aWNlIHN0YXlzIGF3YWtlIHdoaWxlIGRpc3BhdGNoaW5nIHRoZSBTTVMgaW50ZW50LiAqLwogICAgIHByaXZhdGUgUG93ZXJNYW5hZ2VyLldha2VMb2NrIG1XYWtlTG9jazsKQEAgLTI2NSw2ICsyNjUsNyBAQAogICAgICAgICBtQ20udW5yZWdpc3RlckZvck9uKHRoaXMpOwogICAgIH0KIAorICAgIEBPdmVycmlkZQogICAgIHByb3RlY3RlZCB2b2lkIGZpbmFsaXplKCkgewogICAgICAgICBMb2cuZChUQUcsICJTTVNEaXNwYXRjaGVyIGZpbmFsaXplZCIpOwogICAgIH0KQEAgLTM0NSw3ICszNDYsNyBAQAogICAgICAgICAgICAgbXNnLm9iaiA9IG51bGw7CiAgICAgICAgICAgICBpZiAobVNUcmFja2Vycy5pc0VtcHR5KCkgPT0gZmFsc2UpIHsKICAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICBTbXNUcmFja2VyIHNUcmFja2VyID0gKFNtc1RyYWNrZXIpbVNUcmFja2Vycy5yZW1vdmUoMCk7CisgICAgICAgICAgICAgICAgICAgIFNtc1RyYWNrZXIgc1RyYWNrZXIgPSBtU1RyYWNrZXJzLnJlbW92ZSgwKTsKICAgICAgICAgICAgICAgICAgICAgc1RyYWNrZXIubVNlbnRJbnRlbnQuc2VuZChSRVNVTFRfRVJST1JfTElNSVRfRVhDRUVERUQpOwogICAgICAgICAgICAgICAgIH0gY2F0Y2ggKENhbmNlbGVkRXhjZXB0aW9uIGV4KSB7CiAgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgImZhaWxlZCB0byBzZW5kIGJhY2sgUkVTVUxUX0VSUk9SX0xJTUlUX0VYQ0VFREVEIik7CkBAIC0zNTgsNyArMzU5LDcgQEAKIAogICAgICAgICBjYXNlIEVWRU5UX1NFTkRfQ09ORklSTUVEX1NNUzoKICAgICAgICAgICAgIGlmIChtU1RyYWNrZXJzLmlzRW1wdHkoKSA9PSBmYWxzZSkgewotICAgICAgICAgICAgICAgIFNtc1RyYWNrZXIgc1RyYWNrZXIgPSAoU21zVHJhY2tlciltU1RyYWNrZXJzLnJlbW92ZShtU1RyYWNrZXJzLnNpemUoKSAtIDEpOworICAgICAgICAgICAgICAgIFNtc1RyYWNrZXIgc1RyYWNrZXIgPSBtU1RyYWNrZXJzLnJlbW92ZShtU1RyYWNrZXJzLnNpemUoKSAtIDEpOwogICAgICAgICAgICAgICAgIGlmIChpc011bHRpcGFydFRyYWNrZXIoc1RyYWNrZXIpKSB7CiAgICAgICAgICAgICAgICAgICAgIHNlbmRNdWx0aXBhcnRTbXMoc1RyYWNrZXIpOwogICAgICAgICAgICAgICAgIH0gZWxzZSB7CkBAIC0zNzIsNyArMzczLDcgQEAKICAgICAgICAgICAgIGlmIChtU1RyYWNrZXJzLmlzRW1wdHkoKSA9PSBmYWxzZSkgewogICAgICAgICAgICAgICAgIC8vIFJlbW92ZSB0aGUgbGF0ZXN0IG9uZS4KICAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICBTbXNUcmFja2VyIHNUcmFja2VyID0gKFNtc1RyYWNrZXIpbVNUcmFja2Vycy5yZW1vdmUobVNUcmFja2Vycy5zaXplKCkgLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgU21zVHJhY2tlciBzVHJhY2tlciA9IG1TVHJhY2tlcnMucmVtb3ZlKG1TVHJhY2tlcnMuc2l6ZSgpIC0gMSk7CiAgICAgICAgICAgICAgICAgICAgIHNUcmFja2VyLm1TZW50SW50ZW50L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ICAgIGlmIChEQkcpIExvZy5kKExPR19UQUcsICJuZWVkc090YVNlcnZpY2VQcm92aXNpb25pbmc6IHJldD0iICsgbmVlZHNQcm92aXNpb25pbmcpOwotICAgICAgICByZXR1cm4gbmVlZHNQcm92aXNpb25pbmc7Ci0gICAgfQotCiAgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIHZvaWQgZXhpdEVtZXJnZW5jeUNhbGxiYWNrTW9kZSgpIHsKICAgICAgICAgaWYgKG1XYWtlTG9jay5pc0hlbGQoKSkgewpAQCAtMTE4MCw2ICsxMTU0LDI2IEBACiAgICAgICAgIG1TTVMuc2V0Q2VsbEJyb2FkY2FzdENvbmZpZyhjb25maWdWYWx1ZXNBcnJheSwgcmVzcG9uc2UpOwogICAgIH0KIAorICAgIC8qKgorICAgICAqIFJldHVybnMgdHJ1ZSBpZiBPVEEgU2VydmljZSBQcm92aXNpb25pbmcgbmVlZHMgdG8gYmUgcGVyZm9ybWVkLgorICAgICAqLworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIG5lZWRzT3RhU2VydmljZVByb3Zpc2lvbmluZygpIHsKKyAgICAgICAgU3RyaW5nIGNkbWFNaW4gPSBnZXRDZG1hTWluKCk7CisgICAgICAgIGJvb2xlYW4gbmVlZHNQcm92aXNpb25pbmc7CisgICAgICAgIGlmIChjZG1hTWluID09IG51bGwgfHwgKGNkbWFNaW4ubGVuZ3RoKCkgPCA2KSkgeworICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoTE9HX1RBRywgIm5lZWRzT3RhU2VydmljZVByb3Zpc2lvbmluZzogaWxsZWdhbCBjZG1hTWluPSciCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGNkbWFNaW4gKyAiJyBhc3N1bWUgcHJvdmlzaW9uaW5nIG5lZWRlZC4iKTsKKyAgICAgICAgICAgIG5lZWRzUHJvdmlzaW9uaW5nID0gdHJ1ZTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAg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OVl9SRUFEWSB8fAorICAgICAgICAgICAgICAgICBtQ2RtYVBob25lLm1SdWltUmVjb3Jkcy5nZXRSZWNvcmRzTG9hZGVkKCkpICYmCisgICAgICAgICAgICAgICAgKG1DZG1hUGhvbmUubVNTVC5pc0NvbmN1cnJlbnRWb2ljZUFuZERhdGEoKSB8fAorICAgICAgICAgICAgICAgICBwaG9uZS5nZXRTdGF0ZSgpID09IFBob25lLlN0YXRlLklETEUpICYmCisgICAgICAgICAgICAgICAgIXJvYW1pbmcgJiYKKyAgICAgICAgICAgICAgICBtTWFzdGVyRGF0YUVuYWJsZWQgJiYKKyAgICAgICAgICAgICAgICBkZXNpcmVkUG93ZXJTdGF0ZSAmJgorICAgICAgICAgICAgICAgICFtUGVuZGluZ1Jlc3RhcnRSYWRpbyAmJgorICAgICAgICAgICAgICAgICFtQ2RtYVBob25lLm5lZWRzT3RhU2VydmljZVByb3Zpc2lvbmluZygpKTsKKyAgICAgICAgaWYgKCFhbGxvd2VkICYmIERCRykgeworICAgICAgICAgICAgU3RyaW5nIHJlYXNvbiA9ICIiOworICAgICAgICAgICAgaWYgKHBzU3RhdGUgIT0gU2VydmljZVN0YXRlLlNUQVRFX0lOX1NFUlZJQ0UpIHJlYXNvbiArPSAiIC0gcHNTdGF0ZT0gIiArIHBzU3RhdGU7CisgICAgICAgICAgICBpZiAocGhvbmUubUNNLmdldFJhZGlvU3RhdGUoKSAhPSBDb21tYW5kc0ludGVyZmFjZS5SYWRpb1N0YXRlLk5WX1JFQURZICYmCisgICAgICAgICAgICAgICAgICAgICFtQ2RtYVBob25lLm1SdWltUmVjb3Jkcy5nZXRSZWNvcmRzTG9hZGVkKCkpIHsKKyAgICAgICAgICAgICAgICByZWFzb24gKz0gIiAtIHJhZGlvU3RhdGU9ICIgKyBwaG9uZS5tQ00uZ2V0UmFkaW9TdGF0ZSgpICsgIiAtIFJVSU0gbm90IGxvYWRlZCI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAocGhvbmUu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N1cnJlbnRWb2ljZUFuZERhdGEoKSB8fAotICAgICAgICAgICAgICAgICAgICAgICAgcGhvbmUuZ2V0U3RhdGUoKSA9PSBQaG9uZS5TdGF0ZS5JRExFICkKLSAgICAgICAgICAgICAgICAmJiBpc0RhdGFBbGxvd2VkKCkKLSAgICAgICAgICAgICAgICAmJiBkZXNpcmVkUG93ZXJTdGF0ZQotICAgICAgICAgICAgICAgICYmICFtUGVuZGluZ1Jlc3RhcnRSYWRpbwotICAgICAgICAgICAgICAgICYmICFtQ2RtYVBob25lLm5lZWRzT3RhU2VydmljZVByb3Zpc2lvbmluZygpKSB7Ci0KLSAgICAgICAgICAgIHJldHVybiBzZXR1cERhdGEocmVhc29uKTsKLQorICAgICAgICBpZiAoKHN0YXRlID09IFN0YXRlLklETEUgfHwgc3RhdGUgPT0gU3RhdGUuU0NBTk5JTkcpICYmCisgICAgICAgICAgICAgICAgaXNEYXRhQWxsb3dlZCgpICYmIGdldEFueURhdGFFbmFibGVkKCkpIHsKKyAgICAgICAgICAgIGJvb2xlYW4gcmV0VmFsdWUgPSBzZXR1cERhdGEocmVhc29uKTsKKyAgICAgICAgICAgIG5vdGlmeU9mZkFwbnNPZkF2YWlsYWJpbGl0eShyZWFzb24sIHJldFZhbHVlKTsKKyAgICAgICAgICAgIHJldHVybiByZXRWYWx1ZTsKICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGlmIChEQkcpIHsKLSAgICAgICAgICAgICAgICAgICAgbG9nKCJ0cnlTZXR1cERhdGE6IE5vdCByZWFkeSBmb3IgZGF0YTogIiArCi0gICAgICAgICAgICAgICAgICAgICIgZGF0YVN0YXRlPSIgKyBzdGF0ZSArCi0gICAgICAgICAgICAgICAgICAgICIgUFMgc3RhdGU9IiArIHBzU3RhdGUgKwotICAgICAgICAgICAgICAgICAgICAiIHJhZGlvIHN0YXRlPSIgKyBwaG9uZS5tQ00uZ2V0UmFkaW9TdGF0ZSgpICsKLSAgICAgICAgICAgICAgICAgICAgIiBydWltPSIgKyBtQ2RtYVBob25lLm1SdWltUmVjb3Jkcy5nZXRSZWNvcmRzTG9hZGVkKCkgKwotICAgICAgICAgICAgICAgICAgICAiIGNvbmN1cnJlbnRWb2ljZSZEYXRhPSIgKyBtQ2RtYVBob25lLm1TU1QuaXNDb25jdXJyZW50Vm9pY2VBbmREYXRhKCkgKwotICAgICAgICAgICAgICAgICAgICAiIHBob25lU3RhdGU9IiArIHBob25lLmdldFN0YXRlKCkgKwotICAgICAgICAgICAgICAgICAgICAiIGRhdGFFbmFibGVkPSIgKyBnZXRBbnlEYXRhRW5hYmxlZCgpICsKLSAgICAgICAgICAgICAgICAgICAgIiByb2FtaW5nPSIgKyByb2FtaW5nICsKLSAgICAgICAgICAgICAgICAgICAgIiBkYXRhT25Sb2FtaW5nRW5hYmxlPSIgKyBnZXREYXRhT25Sb2FtaW5nRW5hYmxlZCgpICsKLSAgICAgICAgICAgICAgICAgICAgIiBkZXNpcmVkUG93ZXJTdGF0ZT0iICsgZGVzaXJlZFBvd2VyU3RhdGUgKwotICAgICAgICAgICAgICAgICAgICAiIFBlbmRpbmdSZXN0YXJ0UmFkaW89IiArIG1QZW5kaW5nUmVzdGFydFJhZGlvICsKLSAgICAgICAgICAgICAgICAgICAgIiBNYXN0ZXJEYXRhRW5hYmxlZD0iICsgbU1hc3RlckRhdGFFbmFibGVkICsKLSAgICAgICAgICAgICAgICAgICAgIiBuZWVkc090YVNlcnZpY2VQcm92aXNpb25pbmc9IiArIG1DZG1hUGhvbmUubmVlZHNPdGFTZXJ2aWNlUHJvdmlzaW9uaW5nKCkpOwotICAgICAgICAgICAgfQorICAgICAgICAgICAgbm90aWZ5T2ZmQXBuc09mQXZhaWxhYmlsaXR5KHJlYXNvbiwgZmFsc2UpOwogICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICB9CiAgICAgfQpAQCAtMzgyLDYgKzM5MSw3IEBACiAgICAgICAgIH0KIAogICAgICAgICBzZXRTdGF0ZShTdGF0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Z5RGF0YUNvbm5lY3Rpb24oU3RyaW5nIHJlYXNvbikgewogICAgICAgICBpZiAoREJHKSBsb2coImdvdG9JZGxlQW5kTm90aWZ5RGF0YUNvbm5lY3Rpb246IHJlYXNvbj0iICsgcmVhc29uKTsKICAgICAgICAgc2V0U3RhdGUoU3RhdGUuSURMRSk7Ci0gICAgICAgIHBob25lLm5vdGlmeURhdGFDb25uZWN0aW9uKHJlYXNvbik7CisgICAgICAgIG5vdGlmeURhdGFDb25uZWN0aW9uKHJlYXNvbik7CiAgICAgICAgIG1BY3RpdmVBcG4gPSBudWxsOwogICAgIH0KIApAQCAtNjg3LDExICs2OTgsMTMgQEAKICAgICAgICAgICAgIC8vIEFzc3VtZSBkYXRhIGlzIGNvbm5lY3RlZCBvbiB0aGUgc2ltdWxhdG9yCiAgICAgICAgICAgICAvLyBGSVhNRSAgdGhpcyBjYW4gYmUgaW1wcm92ZWQKICAgICAgICAgICAgIHNldFN0YXRlKFN0YXRlLkNPTk5FQ1RFRCk7Ci0gICAgICAgICAgICBwaG9uZS5ub3RpZnlEYXRhQ29ubmVjdGlvbihudWxsKTsKKyAgICAgICAgICAgIG5vdGlmeURhdGFDb25uZWN0aW9uKG51bGwpOwogCiAgICAgICAgICAgICBMb2cuaShMT0dfVEFHLCAiV2UncmUgb24gdGhlIHNpbXVsYXRvcjsgYXNzdW1pbmcgZGF0YSBpcyBjb25uZWN0ZWQiKTsKICAgICAgICAgfQogCisgICAgICAgIG5vdGlmeURhdGFBdmFpbGFiaWxpdHkobnVsbCk7CisKICAgICAgICAgaWYgKHN0YXRlICE9IFN0YXRlLklETEUpIHsKICAgICAgICAgICAgIGNsZWFuVXBDb25uZWN0aW9uKHRydWUsIG51bGwpOwogICAgICAgICB9CkBAIC03NjIsNyArNzc1LDcgQEAKICAgICAgICAgICAgIG9uUmVzdGFydFJhZGlvKCk7CiAgICAgICAgIH0KIAotICAgICAgICBwaG9uZS5ub3RpZnlEYXRhQ29ubmVjdGlvbihyZWFzb24pOworICAgICAgICBub3RpZnlEYXRhQ29ubmVjdGlvbihyZWFzb24pOwogICAgICAgICBtQWN0aXZlQXBuID0gbnVsbDsKICAgICAgICAgaWYgKHJldHJ5QWZ0ZXJEaXNjb25uZWN0ZWQocmVhc29uKSkgewogICAgICAgICAgIHRyeVNldHVwRGF0YShyZWFzb24pOwpAQCAtNzg5LDcgKzgwMiw4IEBACiAgICAgcHJvdGVjdGVkIHZvaWQgb25Wb2ljZUNhbGxTdGFydGVkKCkgewogICAgICAgICBpZiAoc3RhdGUgPT0gU3RhdGUuQ09OTkVDVEVEICYmICFtQ2RtYVBob25lLm1TU1QuaXNDb25jdXJyZW50Vm9pY2VBbmREYXRhKCkpIHsKICAgICAgICAgICAgIHN0b3BOZXRTdGF0UG9sbCgpOwotICAgICAgICAgICAgcGhvbmUubm90aWZ5RGF0YUNvbm5lY3Rpb24oUGhvbmUuUkVBU09OX1ZPSUNFX0NBTExfU1RBUlRFRCk7CisgICAgICAgICAgICBub3RpZnlEYXRhQ29ubmVjdGlvbihQaG9uZS5SRUFTT05fVk9JQ0VfQ0FMTF9TVEFSVEVEKTsKKyAgICAgICAgICAgIG5vdGlmeURhdGFBdmFpbGFiaWxpdHkoUGhvbmUuUkVBU09OX1ZPSUNFX0NBTExfU1RBUlRFRCk7CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTgwMCwxMSArODE0LDEyIEBACiAgICAgICAgIGlmIChzdGF0ZSA9PSBTdGF0ZS5DT05ORUNURUQpIHsKICAgICAgICAgICAgIGlmICghbUNkbWFQaG9uZS5tU1NULmlzQ29uY3VycmVudFZvaWNlQW5kRGF0YSgpKSB7CiAgICAgICAgICAgICAgICAgc3RhcnROZXRTdGF0UG9sbCgpOwotICAgICAgICAgICAgICAgIHBob25lLm5vdGlmeURhdGFDb25uZWN0aW9uKFBob25lLlJFQVNPTl9WT0lDRV9DQUxMX0VOREVEKTsKKyAgICAgICAgICAgICAgICBub3RpZnlEYXRhQ29ubmVjdGlvbihQaG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aW50ZXJuYWwvdGVsZXBob255L2NkbWEvUnVpbVNtc0ludGVyZmFjZU1hbmFnZXIuamF2YQppbmRleCBjZmNmZDk4Li5hOWRmMzc1IDEwMDY0NAotLS0gYS90ZWxlcGhvbnkvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC90ZWxlcGhvbnkvY2RtYS9SdWltU21zSW50ZXJmYWNlTWFuYWdlci5qYXZhCisrKyBiL3RlbGVwaG9ueS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL3RlbGVwaG9ueS9jZG1hL1J1aW1TbXNJbnRlcmZhY2VNYW5hZ2VyLmphdmEKQEAgLTY3LDggKzY3LDcgQEAKICAgICAgICAgICAgICAgICAgICAgYXIgPSAoQXN5bmNSZXN1bHQpbXNnLm9iajsKICAgICAgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChtTG9jaykgewogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFyLmV4Y2VwdGlvbiA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNtcyAgPSAoTGlzdDxTbXNSYXdEYXRhPikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkVmFsaWRSYXdEYXRhKChBcnJheUxpc3Q8Ynl0ZVtdPikgYXIucmVzdWx0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU21zID0gYnVpbGRWYWxpZFJhd0RhdGEoKEFycmF5TGlzdDxieXRlW10+KSBhci5yZXN1bHQpOwogICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihEQkcpIGxvZygiQ2Fubm90IGxvYWQgU21zIHJlY29yZHMiKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobVNtcyAhPSBudWxsKQpkaWZmIC0tZ2l0IGEvdGVsZXBob255L2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdGVsZXBob255L2NkbWEv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LDcgQEAKICAgICBwcml2YXRlIHN0YXRpYyBTdHJpbmcgZGVjb2RlN2JpdEdzbShieXRlW10gZGF0YSwgaW50IG9mZnNldCwgaW50IG51bUZpZWxkcykKICAgICAgICAgdGhyb3dzIENvZGluZ0V4Y2VwdGlvbgogICAgIHsKLSAgICAgICAgLy8gU3RhcnQgcmVhZGluZyBmcm9tIHRoZSBuZXh0IDctYml0IGFsaWduZWQgYm91bmRyeSBhZnRlciBvZmZzZXQuCisgICAgICAgIC8vIFN0YXJ0IHJlYWRpbmcgZnJvbSB0aGUgbmV4dCA3LWJpdCBhbGlnbmVkIGJvdW5kYXJ5IGFmdGVyIG9mZnNldC4KICAgICAgICAgaW50IG9mZnNldEJpdHMgPSBvZmZzZXQgKiA4OwogICAgICAgICBpbnQgb2Zmc2V0U2VwdGV0cyA9IChvZmZzZXRCaXRzICsgNikgLyA3OwogICAgICAgICBudW1GaWVsZHMgLT0gb2Zmc2V0U2VwdGV0czsKQEAgLTE1NTMsNyArMTU1MCw3IEBACiAgICAgICAgICAgICAgICAgY2FzZSBTVUJQQVJBTV9VU0VSX0RBVEE6CiAgICAgICAgICAgICAgICAgICAgIGRlY29kZVN1Y2Nlc3MgPSBkZWNvZGVVc2VyRGF0YShiRGF0YSwgaW5TdHJlYW0pOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIFNVQlBBUkFNX1VTRVJfUkVQT05TRV9DT0RFOgorICAgICAgICAgICAgICAgIGNhc2UgU1VCUEFSQU1fVVNFUl9SRVNQT05TRV9DT0RFOgogICAgICAgICAgICAgICAgICAgICBkZWNvZGVTdWNjZXNzID0gZGVjb2RlVXNlclJlc3BvbnNlQ29kZShiRGF0YSwgaW5TdHJlYW0pOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBjYXNlIFNVQlBBUkFNX1JFUExZX09QVElPTjoKZGlmZiAtLWdpdCBhL3RlbGVwaG9ueS9qYXZhL2Nv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iYKKyAgICAgICAgICAgICAgICBwaG9uZS5nZXRTdGF0ZSgpID09IFBob25lLlN0YXRlLklETEUgJiYKKyAgICAgICAgICAgICAgICBtTWFzdGVyRGF0YUVuYWJsZWQgJiYKKyAgICAgICAgICAgICAgICAoIXBob25lLmdldFNlcnZpY2VTdGF0ZSgpLmdldFJvYW1pbmcoKSB8fCBnZXREYXRhT25Sb2FtaW5nRW5hYmxlZCgpKSAmJgorICAgICAgICAgICAgICAgICFtSXNQc1Jlc3RyaWN0ZWQgJiYKKyAgICAgICAgICAgICAgICBkZXNpcmVkUG93ZXJTdGF0ZSk7CisgICAgICAgIGlmICghYWxsb3dlZCAmJiBEQkcpIHsKKyAgICAgICAgICAgIFN0cmluZyByZWFzb24gPSAiIjsKKyAgICAgICAgICAgIGlmIChncHJzU3RhdGUgIT0gU2VydmljZVN0YXRlLlNUQVRFX0lOX1NFUlZJQ0UpIHJlYXNvbiArPSAiIC0gZ3Bycz0gIiArIGdwcnNTdGF0ZTsKKyAgICAgICAgICAgIGlmICghbUdzbVBob25lLm1TSU1SZWNvcmRzLmdldFJlY29yZHNMb2FkZWQoKSkgcmVhc29uICs9ICIgLSBTSU0gbm90IGxvYWRlZCI7CisgICAgICAgICAgICBpZiAocGhvbmUuZ2V0U3RhdGUoKSAhPSBQaG9uZS5TdGF0ZS5JRExFKSB7CisgICAgICAgICAgICAgICAgcmVhc29uICs9ICIgLSBQaG9uZVN0YXRlPSAiICsgcGhvbmUuZ2V0U3RhdGUoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghbU1hc3RlckRhdGFFbmFibGVkKSByZWFzb24gKz0gIiAtIG1NYXN0ZXJEYXRhRW5hYmxlZD0gZmFsc2UiOworICAgICAgICAgICAgaWYgKHBob25lLmdldFNlcnZpY2VTdGF0ZSgpLmdldFJvYW1pbmcoKSAmJiBnZXREYXRhT25Sb2FtaW5nRW5hYmxlZCgpKSB7CisgICAgICAgICAgICAgICAgcmVhc29uICs9ICIgL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1Hc21QaG9uZS5tU1NULmdldEN1cnJlbnRHcHJzU3RhdGUoKTsKICAgICAgICAgYm9vbGVhbiBkZXNpcmVkUG93ZXJTdGF0ZSA9IG1Hc21QaG9uZS5tU1NULmdldERlc2lyZWRQb3dlclN0YXRlKCk7CiAKLSAgICAgICAgaWYgKChzdGF0ZSA9PSBTdGF0ZS5JRExFIHx8IHN0YXRlID09IFN0YXRlLlNDQU5OSU5HKQotICAgICAgICAgICAgICAgICYmIChncHJzU3RhdGUgPT0gU2VydmljZVN0YXRlLlNUQVRFX0lOX1NFUlZJQ0UgfHwgbm9BdXRvQXR0YWNoKQotICAgICAgICAgICAgICAgICYmIG1Hc21QaG9uZS5tU0lNUmVjb3Jkcy5nZXRSZWNvcmRzTG9hZGVkKCkKLSAgICAgICAgICAgICAgICAmJiBwaG9uZS5nZXRTdGF0ZSgpID09IFBob25lLlN0YXRlLklETEUKLSAgICAgICAgICAgICAgICAmJiBpc0RhdGFBbGxvd2VkKCkKLSAgICAgICAgICAgICAgICAmJiAhbUlzUHNSZXN0cmljdGVkCi0gICAgICAgICAgICAgICAgJiYgZGVzaXJlZFBvd2VyU3RhdGUgKSB7CisgICAgICAgIGlmICgoKHN0YXRlID09IFN0YXRlLklETEUpIHx8IChzdGF0ZSA9PSBTdGF0ZS5TQ0FOTklORykpICYmCisgICAgICAgICAgICAgICAgaXNEYXRhQWxsb3dlZCgpICYmIGdldEFueURhdGFFbmFibGVkKCkpIHsKIAogICAgICAgICAgICAgaWYgKHN0YXRlID09IFN0YXRlLklETEUpIHsKICAgICAgICAgICAgICAgICB3YWl0aW5nQXBucyA9IGJ1aWxkV2FpdGluZ0FwbnMoKTsKICAgICAgICAgICAgICAgICBpZiAod2FpdGluZ0FwbnMuaXNFbXB0eSgpKSB7CiAgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIGxvZygiTm8gQVBOIGZvdW5kIik7CiAgICAgICAgICAgICAgICAgICAgIG5vdGlmeU5vRGF0YShHc21EYXRhQ29ubmVjdGlvbi5GYWlsQ2F1c2UuTUlTU0lOR19VTktOT1dOX0FQTik7CisgICAgICAgICAgICAgICAgICAgIG5vdGlmeU9mZkFwbnNPZkF2YWlsYWJpbGl0eShyZWFzb24sIGZhbHNlKTsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgIGxvZyAoIkNyZWF0ZSBmcm9tIGFsbEFwbnMgOiAiICsgYXBuTGlzdFRvU3RyaW5nKGFsbEFwbnMpKTsKQEAgLTQ2MSwyMiArNDgwLDExIEBACiAgICAgICAgICAgICBpZiAoREJHKSB7CiAgICAgICAgICAgICAgICAgbG9nICgiU2V0dXAgd2FpdG5nQXBucyA6ICIgKyBhcG5MaXN0VG9TdHJpbmcod2FpdGluZ0FwbnMpKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiBzZXR1cERhdGEocmVhc29uKTsKKyAgICAgICAgICAgIGJvb2xlYW4gcmV0VmFsdWUgPSBzZXR1cERhdGEocmVhc29uKTsKKyAgICAgICAgICAgIG5vdGlmeU9mZkFwbnNPZkF2YWlsYWJpbGl0eShyZWFzb24sIHJldFZhbHVlKTsKKyAgICAgICAgICAgIHJldHVybiByZXRWYWx1ZTsKICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGlmIChEQkcpCi0gICAgICAgICAgICAgICAgbG9nKCJ0cnlTZXR1cERhdGE6IE5vdCByZWFkeSBmb3IgZGF0YTogIiArCi0gICAgICAgICAgICAgICAgICAgICIgZGF0YVN0YXRlPSIgKyBzdGF0ZSArCi0gICAgICAgICAgICAgICAgICAgICIgZ3Byc1N0YXRlPSIgKyBncHJzU3RhdGUgKwotICAgICAgICAgICAgICAgICAgICAiIHNpbT0iICsgbUdzbVBob25lLm1TSU1SZWNvcmRzLmdldFJlY29yZHNMb2FkZWQoKSArCi0gICAgICAgICAgICAgICAgICAgICIgVU1UUz0iICsgbUdzbVBob25lLm1TU1QuaXNDb25jdXJyZW50Vm9pY2VBbmREYXRhKCkgKwotICAgICAgICAgICAgICAgICAgICAiIHBob25lU3RhdGU9IiArIHBob25lLmdldFN0YXRlKCkgKwotICAgICAgICAgICAgICAgICAgICAiIGlzRGF0YUFsbG93ZWQ9IiArIGlzRGF0YUFsbG93ZWQoKSArCi0gICAgICAgICAgICAgICAgICAgICIgZGF0YUVuYWJsZWQ9IiArIGdldEFueURhdGFFbmFibGVkKCkgKwotICAgICAgICAgICAgICAgICAgICAiIHJvYW1pbmc9IiArIHBob25lLmdldFNlcnZpY2VTdGF0ZSgpLmdldFJvYW1pbmcoKSArCi0gICAgICAgICAgICAgICAgICAgICIgZGF0YU9uUm9hbWluZ0VuYWJsZT0iICsgZ2V0RGF0YU9uUm9hbWluZ0VuYWJsZWQoKSArCi0gICAgICAgICAgICAgICAgICAgICIgcHMgcmVzdHJpY3RlZD0iICsgbUlzUHNSZXN0cmljdGVkICsKLSAgICAgICAgICAgICAgICAgICAgIiBkZXNpcmVkUG93ZXJTdGF0ZT0iICsgZGVzaXJlZFBvd2VyU3RhdGUgKwotICAgICAgICAgICAgICAgICAgICAiIE1hc3RlckRhdGFFbmFibGVkPSIgKyBtTWFzdGVyRGF0YUVuYWJsZWQpOworICAgICAgICAgICAgbm90aWZ5T2ZmQXBuc09mQXZhaWxhYmlsaXR5KHJlYXNvbiwgZmFsc2UpOwogICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICB9CiAgICAgfQpAQCAtNTk1LDcgKzYwMyw3IEBACiAgICAgICAgIHBkcC5jb25uZWN0KG1zZywgYXBuKTsKIAogICAgICAgICBzZXRTdGF0ZShTdGF0ZS5JTklUSU5HKTsKLSAgICAgICAgcGhvbmUubm90aWZ5RGF0YUNvbm5lY3Rpb24ocmVhc29uKTsKKyAgICAgICAgbm90aWZ5RGF0YUNvbm5lY3Rpb24ocmVhc29uKTsKICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgfQogCkBAIC03NDYsNyArNzU0LDcgQEAKIAogICAgIHByaXZhdGUgdm9pZCBub3RpZnlEZWZhdWx0RGF0YShTdHJpbmcgcmVhc29uKSB7CiAgICAgICAgIHNldFN0YXRlKFN0YXRlLkNPTk5FQ1RFRCk7Ci0gICAgICAgIHBob25lLm5vdGlmeURhdGFDb25uZWN0aW9uKHJlYXNvbik7CisgICAgICAgIG5vdGlmeURhdGFDb25uZWN0aW9uKHJlYXNvbik7CiAgICAgICAgIHN0YXJ0TmV0U3RhdFBvbGwoKTsKICAgICAgICAgLy8gcmVzZXQgcmVjb25uZWN0IHRpbWVyCiAgICAgICAgIG1SZXRyeU1nci5yZXNldFJldHJ5Q291bnQoKTsKQEAgLTc1Niw3ICs3NjQsNyBAQAogICAgIHByaXZhdGUgdm9pZCBnb3RvSWRsZUFuZE5vdGlmeURhdGFDb25uZWN0aW9uKFN0cmluZyByZWFzb24pIHsKICAgICAgICAgaWYgKERCRykgbG9nKCJnb3RvSWRsZUFuZE5vdGlmeURhdGFDb25uZWN0aW9uOiByZWFzb249IiArIHJlYXNvbik7CiAgICAgICAgIHNldFN0YXRlKFN0YXRlLklETEUpOwotICAgICAgICBwaG9uZS5ub3RpZnlEYXRhQ29ubmVjdGlvbihyZWFzb24pOworICAgICAgICBub3RpZnlEYXRhQ29ubmVjdGlvbihyZWFzb24pOwogICAgICAgICBtQWN0aXZlQXBuID0gbnVsbDsKICAgICB9CiAKQEAgLTk5OCw3ICsxMDA2LDcgQEAKICAgICAgICAgICAgIGlmICghbVJldHJ5TWdyLmlzUmV0cnlOZWVkZWQoKSkgewogICAgICAgICAgICAgICAgIGlmICghbVJlcXVlc3RlZEFwblR5cGUuZXF1YWxzKFBob25lLkFQTl9UWVBFX0RFRkFVTFQpKSB7CiAgICAgICAgICAgICAgICAgICAgIC8vIGlmIG5vIG1vcmUgcmV0cmllcyBvbiBhIHNlY29uZGFyeSBBUE4gYXR0ZW1wdCwgdGVsbCB0aGUgd29ybGQgYW5kIHJldmVydC4KLSAgICAgICAgICAgICAgICAgICAgcGhvbmUubm90aWZ5RGF0YUNvbm5lY3Rpb24oUGhvbmUuUkVBU09OX0FQTl9GQUlMRUQpOworICAgICAgICAgICAgICAgICAgICBub3RpZnlEYXRhQ29ubmVjdGlvbihQaG9uZS5SRUFTT05fQVBOX0ZBSUxFRCk7CiAgICAgICAgICAgICAgICAgICAgIG9uRW5hYmxlQXBuKGFwblR5cGVUb0lkKG1SZXF1ZXN0ZWRBcG5UeXBlKSwgRElTQUJMRUQpOwogICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgfQpAQCAtMTA5MSw3ICsxMDk5LDcgQEAKICAgICAgICAgICAgIC8vIEFzc3VtZSBkYXRhIGlzIGNvbm5lY3RlZCBvbiB0aGUgc2ltdWxhdG9yCiAgICAgICAgICAgICAvLyBGSVhNRSAgdGhpcyBjYW4gYmUgaW1wcm92ZWQKICAgICAgICAgICAgIHNldFN0YXRlKFN0YXRlLkNPTk5FQ1RFRCk7Ci0gICAgICAgICAgICBwaG9uZS5ub3RpZnlEYXRhQ29ubmVjdGlvbihudWxsKTsKKyAgICAgICAgICAgIG5vdGlmeURhdGFDb25uZWN0aW9uKG51bGwpOwogCiAgICAgICAgICAgICBMb2cuaShMT0dfVEFHLCAiV2UncmUgb24gdGhlIHNpbXVsYXRvcjsgYXNzdW1pbmcgZGF0YSBpcyBjb25uZWN0ZWQiKTsKICAgICAgICAgfQpAQCAtMTE1OCw3ICsxMTY2LDcgQEAKICAgICAgICAgICAgIGlmIChjYXVzZS5pc1Blcm1hbmVudEZhaWwoKSkgewogICAgICAgICAgICAgICAgIG5vdGlmeU5vRGF0YShjYXVzZSk7CiAgICAgICAgICAgICAgICAgaWYgKCFtUmVxdWVzdGVkQXBuVHlwZS5lcXVhbHMoUGhvbmUuQVBOX1RZUEVfREVGQVVMVCkpIHsKLSAgICAgICAgICAgICAgICAgICAgcGhvbmUubm90aWZ5RGF0YUNvbm5lY3Rpb24oUGhvbmUuUkVBU09OX0FQTl9GQUlMRUQpOworICAgICAgICAgICAgICAgICAgICBub3RpZnlEYXRhQ29ubmVjdGlvbihQaG9uZS5SRUFTT05fQVBOX0ZBSUxFRCk7CiAgICAgICAgICAgICAgICAgICAgIG9uRW5hYmxlQXBuKGFwblR5cGVUb0lkKG1SZXF1ZXN0ZWRBcG5UeXBlKSwgRElTQUJMRUQpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICByZXR1cm47CkBAIC0xMTg4LDcgKzExOTYsNyBAQAogICAgICAgICAgICByZWFzb24gPSAoU3RyaW5nKSBhci51c2VyT2JqOwogICAgICAgICB9CiAgICAgICAgIHNldFN0YXRlKFN0YXRlLklETEUpOwotICAgICAgICBwaG9uZS5ub3RpZnlEYXRhQ29ubmVjdGlvbihyZWFzb24pOworICAgICAgICBub3RpZnlEYXRhQ29ubmVjdGlvbihyZWFzb24pOwogICAgICAgICBtQWN0aXZlQXBuID0gbnVsbDsKICAgICAgICAgaWYgKHJldHJ5QWZ0ZXJEaXNjb25uZWN0ZWQocmVhc29uKSkgewogICAgICAgICAgICAgdHJ5U2V0dXBEYXRhKHJlYXNvbik7CkBAIC0xMjE5LDcgKzEyMjcsNyBAQAogICAgIHByb3RlY3RlZCB2b2lkIG9uVm9pY2VDYWxsU3RhcnRlZCgpIHsKICAgICAgICAgaWYgKHN0YXRlID09IFN0YXRlLkNPTk5FQ1RFRCAmJiAhIG1Hc21QaG9uZS5tU1NULmlzQ29uY3VycmVudFZvaWNlQW5kRGF0YSgpKSB7CiAgICAgICAgICAgICBzdG9wTmV0U3RhdFBvbGwoKTsKLSAgICAgICAgICAgIHBob25lLm5vdGlmeURhdGFDb25uZWN0aW9uKFBob25lLlJFQVNPTl9WT0lDRV9DQUxMX1NUQVJURUQpOworICAgICAgICAgICAgbm90aWZ5RGF0YUNvbm5lY3Rpb24oUGhvbmUuUkVBU09OX1ZPSUNFX0NBTExfU1RBUlRFRCk7CiAgIC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sMTIgKzMyOSwxMyBAQAogICAgICAqCiAgICAgICogQHBhcmFtIHRyYWNrZXIgaG9sZHMgdGhlIG11bHRpcGFydCBTbXMgdHJhY2tlciByZWFkeSB0byBiZSBzZW50CiAgICAgICovCisgICAgQE92ZXJyaWRlCiAgICAgcHJvdGVjdGVkIHZvaWQgc2VuZE11bHRpcGFydFNtcyAoU21zVHJhY2tlciB0cmFja2VyKSB7CiAgICAgICAgIEFycmF5TGlzdDxTdHJpbmc+IHBhcnRzOwogICAgICAgICBBcnJheUxpc3Q8UGVuZGluZ0ludGVudD4gc2VudEludGVudHM7CiAgICAgICAgIEFycmF5TGlzdDxQZW5kaW5nSW50ZW50PiBkZWxpdmVyeUludGVudHM7CiAKLSAgICAgICAgSGFzaE1hcCBtYXAgPSB0cmFja2VyLm1EYXRhOworICAgICAgICBIYXNoTWFwPFN0cmluZywgT2JqZWN0PiBtYXAgPSB0cmFja2VyLm1EYXRhOwogCiAgICAgICAgIFN0cmluZyBkZXN0aW5hdGlvbkFkZHJlc3MgPSAoU3RyaW5nKSBtYXAuZ2V0KCJkZXN0aW5hdGlvbiIpOwogICAgICAgICBTdHJpbmcgc2NBZGRyZXNzID0gKFN0cmluZykgbWFwLmdldCgic2NhZGRyZXNzIik7CkBAIC0zNDMsNiArMzUwLDcgQEAKICAgICB9CiAKICAgICAvKioge0Bpbmhlcml0RG9jfSAqLworICAgIEBPdmVycmlkZQogICAgIHByb3RlY3RlZCB2b2lkIGFja25vd2xlZGdlTGFzdEluY29taW5nU21zKGJvb2xlYW4gc3VjY2VzcywgaW50IHJlc3VsdCwgTWVzc2FnZSByZXNwb25zZSl7CiAgICAgICAgIC8vIEZJWE1FIHVuaXQgdGVzdCBsZWF2ZXMgY20gPT0gbnVsbC4gdGhpcyBzaG91bGQgY2hhbmdlCiAgICAgICAgIGlmIChtQ20gIT0gbnVsbCkgewpAQCAtMzUxLDYgKzM1OSw3IEBACiAgICAgfQogCiAgICAgLyoqIHtAaW5oZXJpdERvY30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l0ZVRvSW50KHBkdVtjdXIrK10pOwogCiAgICAgICAgICAgICAvLyBGb3IgdGhlIHRpbWV6b25lLCB0aGUgbW9zdCBzaWduaWZpY2FudCBiaXQgb2YgdGhlCi0gICAgICAgICAgICAvLyBsZWFzdCBzaWduZmljYW50IG5pYmJsZSBpcyB0aGUgc2lnbiBieXRlCisgICAgICAgICAgICAvLyBsZWFzdCBzaWduaWZpY2FudCBuaWJibGUgaXMgdGhlIHNpZ24gYnl0ZQogICAgICAgICAgICAgLy8gKG1lYW5pbmcgdGhlIG1heCByYW5nZSBvZiB0aGlzIGZpZWxkIGlzIDc5IHF1YXJ0ZXItaG91cnMsCiAgICAgICAgICAgICAvLyB3aGljaCBpcyBtb3JlIHRoYW4gZW5vdWdoKQogCkBAIC02MzIsNyArNjI3LDcgQEAKICAgICAgICAgICAgICAgICAvKgogICAgICAgICAgICAgICAgICAqIEhlcmUgd2UganVzdCBjcmVhdGUgdGhlIHVzZXIgZGF0YSBsZW5ndGggdG8gYmUgdGhlIHJlbWFpbmRlciBvZgogICAgICAgICAgICAgICAgICAqIHRoZSBwZHUgbWludXMgdGhlIHVzZXIgZGF0YSBoZWFkZXIsIHNpbmNlIHVzZXJEYXRhTGVuZ3RoIG1lYW5zCi0gICAgICAgICAgICAgICAgICogdGhlIG51bWJlciBvZiB1bmNvbXByZXNzZWQgc2VwZXRzLgorICAgICAgICAgICAgICAgICAqIHRoZSBudW1iZXIgb2YgdW5jb21wcmVzc2VkIHNlcHRldHMuCiAgICAgICAgICAgICAgICAgICovCiAgICAgICAgICAgICAgICAgYnVmZmVyTGVuID0gcGR1Lmxlbmd0aCAtIG9mZnNldDsKICAgICAgICAgICAgIH0gZWxzZSB7CkBAIC02NzEsMTAgKzY2NiwxMCBAQAogICAgICAgICB9CiAKICAgICAgICAgLyoqCi0gICAgICAgICAqIFJldHVybnMgdGhlIG51bWJlciBvZiBwYWRkaW5nIGJpdHMgYXQgdGhlIGJlZ2luaW5nIG9mIHRoZSB1c2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yNSwxMSArODIwLDEzIEBACiAgICAgfQogCiAgICAgLyoqIHtAaW5oZXJpdERvY30gKi8KKyAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgaW50IGdldFByb3RvY29sSWRlbnRpZmllcigpIHsKICAgICAgICAgcmV0dXJuIHByb3RvY29sSWRlbnRpZmllcjsKICAgICB9CiAKICAgICAvKioge0Bpbmhlcml0RG9jfSAqLworICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBib29sZWFuIGlzUmVwbGFjZSgpIHsKICAgICAgICAgcmV0dXJuIChwcm90b2NvbElkZW50aWZpZXIgJiAweGMwKSA9PSAweDQwCiAgICAgICAgICAgICAgICAgJiYgKHByb3RvY29sSWRlbnRpZmllciAmIDB4M2YpID4gMApAQCAtODM3LDEyICs4MzQsMTQgQEAKICAgICB9CiAKICAgICAvKioge0Bpbmhlcml0RG9jfSAqLworICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBib29sZWFuIGlzQ3Boc013aU1lc3NhZ2UoKSB7CiAgICAgICAgIHJldHVybiAoKEdzbVNtc0FkZHJlc3MpIG9yaWdpbmF0aW5nQWRkcmVzcykuaXNDcGhzVm9pY2VNZXNzYWdlQ2xlYXIoKQogICAgICAgICAgICAgICAgIHx8ICgoR3NtU21zQWRkcmVzcykgb3JpZ2luYXRpbmdBZGRyZXNzKS5pc0NwaHNWb2ljZU1lc3NhZ2VTZXQoKTsKICAgICB9CiAKICAgICAvKioge0Bpbmhlcml0RG9jfSAqLworICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBib29sZWFuIGlzTVdJQ2xlYXJNZXNzYWdlKCkgewogICAgICAgICBpZiAoaXNNd2kgJiYgKG13aVNlbnNlID09IGZhbHNlKSkgewogICAgICAgICAgICAgcmV0dXJuIHRydWU7CkBAIC04NTMsNiArODUyLDcgQEAKICAgICB9CiAKICAgICAvKioge0Bpbmhlcml0RG9jfSAqLworICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBib29sZWFuIGlzTVd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gICAgICAgdGV4dFdhdGNoZXIub25UZXh0Q2hhbmdlZChudW1iZXIsIG51bWJlci5sZW5ndGgoKSAtIDEsIDEsIDApOworICAgICAgICB0ZXh0V2F0Y2hlci5hZnRlclRleHRDaGFuZ2VkKG51bWJlcik7CisgICAgICAgIGFzc2VydEVxdWFscyhyZXN1bHQxLCBudW1iZXIudG9TdHJpbmcoKSk7CisgICAgICAgIGFzc2VydEVxdWFscyhyZXN1bHQxLmxlbmd0aCgpLCBTZWxlY3Rpb24uZ2V0U2VsZWN0aW9uRW5kKG51bWJlcikpOworICAgICAgICAvLyBSZW1vdmUgbGFzdCA1IGNoYXJzCisgICAgICAgIGZpbmFsIFN0cmluZyByZXN1bHQyID0gIig2NTApIDEyMyI7CisgICAgICAgIHRleHRXYXRjaGVyLmJlZm9yZVRleHRDaGFuZ2VkKG51bWJlciwgbnVtYmVyLmxlbmd0aCgpIC0gNCwgNCwgMCk7CisgICAgICAgIG51bWJlci5kZWxldGUobnVtYmVyLmxlbmd0aCgpIC0gNSwgbnVtYmVyLmxlbmd0aCgpKTsKKyAgICAgICAgU2VsZWN0aW9uLnNldFNlbGVjdGlvbihudW1iZXIsIG51bWJlci5sZW5ndGgoKSk7CisgICAgICAgIHRleHRXYXRjaGVyLm9uVGV4dENoYW5nZWQobnVtYmVyLCBudW1iZXIubGVuZ3RoKCksIDQsIDApOworICAgICAgICB0ZXh0V2F0Y2hlci5hZnRlclRleHRDaGFuZ2VkKG51bWJlcik7CisgICAgICAgIGFzc2VydEVxdWFscyhyZXN1bHQyLCBudW1iZXIudG9TdHJpbmcoKSk7CisgICAgICAgIGFzc2VydEVxdWFscyhyZXN1bHQyLmxlbmd0aCgpLCBTZWxlY3Rpb24uZ2V0U2VsZWN0aW9uRW5kKG51bWJlcikpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHRlc3RJbnNlcnRDaGFycygpIHsKKyAgICAgICAgZmluYWwgU3RyaW5nIGluaXQgPSAiKDY1MCkgMjMiOworICAg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hY2thZ2VOYW1lIDogcGFja2FnZU5hbWVzKSB7CiAgICAgICAgICAgICBMaXN0PENsYXNzPD8gZXh0ZW5kcyBUZXN0Q2FzZT4+IGFkZGVkQ2xhc3NlcyA9IHRlc3RDYXNlQ2xhc3Nlc0luUGFja2FnZShwYWNrYWdlTmFtZSk7CiAgICAgICAgICAgICBpZiAoYWRkZWRDbGFzc2VzLmlzRW1wdHkoKSkgewotICAgICAgICAgICAgICAgIExvZy53KCJUZXN0R3JvdXBpbmciLCAiSW52YWxpZCBQYWNrYWdlOiAnIiArIHBhY2thZ2VOYW1lCisgICAgICAgICAgICAgICAgTG9nLncoTE9HX1RBRywgIkludmFsaWQgUGFja2FnZTogJyIgKyBwYWNrYWdlTmFtZQogICAgICAgICAgICAgICAgICAgICAgICAgKyAiJyBjb3VsZCBub3QgYmUgZm91bmQgb3IgaGFzIG5vIHRlc3RzIik7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICB0ZXN0Q2FzZUNsYXNzZXMuYWRkQWxsKGFkZGVkQ2xhc3Nlcyk7CkBAIC0yMzQsNiArMjM2LDEwIEBACiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CisgICAgICAgICAgICBMb2cuaShMT0dfVEFHLCBTdHJpbmcuZm9ybWF0KAorICAgICAgICAgICAgICAgICAgICAiVGVzdENhc2UgY2xhc3MgJXMgaXMgbWlzc2luZyBhIHB1YmxpYyBjb25zdHJ1Y3RvciB3aXRoIG5vIHBhcmFtZXRlcnMgIiArCisgICAgICAgICAgICAgICAgICAgICJvciBhIHNpbmdsZSBTdHJpbmcgcGFyYW1ldGVyIC0gc2tpcHBpbmciLAorICAgICAgICAgICAgICAgICAgICBhQ2xhc3MuZ2V0TmFtZSgpKSk7CiAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KICAgICB9CmRpZmYgLS1naXQgYS90ZXN0LXJ1bm5lci90ZXN0cy9zcmMvYW5kc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AgICAgICAgICAgICAgIG1SZXN1bWVJbmRleCA9IGkgKyAxOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CkBAIC0yOTgsNyArMjkwLDcgQEAKICAgICAgICAgfQogICAgIH0KIAotICAgIHByaXZhdGUgdm9pZCBydW5UZXN0QW5kV2FpdFVudGlsRG9uZShUZXN0U2hlbGxBY3Rpdml0eSBhY3Rpdml0eSwgU3RyaW5nIHRlc3QsIGludCB0aW1lb3V0LCBib29sZWFuIGlnbm9yZVJlc3VsdCkgeworICAgIHByaXZhdGUgdm9pZCBydW5UZXN0QW5kV2FpdFVudGlsRG9uZShUZXN0U2hlbGxBY3Rpdml0eSBhY3Rpdml0eSwgU3RyaW5nIHRlc3QsIGludCB0aW1lb3V0LCBib29sZWFuIGlnbm9yZVJlc3VsdCwgaW50IHRlc3ROdW1iZXIpIHsKICAgICAgICAgYWN0aXZpdHkuc2V0Q2FsbGJhY2sobmV3IFRlc3RTaGVsbENhbGxiYWNrKCkgewogICAgICAgICAgICAgcHVibGljIHZvaWQgZmluaXNoZWQoKSB7CiAgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChMYXlvdXRUZXN0c0F1dG9UZXN0LnRoaXMpIHsKQEAgLTMzNCw2ICszMjYsOCBAQAogICAgICAgICBpbnRlbnQucHV0RXh0cmEoVGVzdFNoZWxsQWN0aXZpdHkuVEVTVF9VUkwsIEZzVXRpbHMuZ2V0VGVzdFVybCh0ZXN0KSk7CiAgICAgICAgIGludGVudC5wdXRFeHRyYShUZXN0U2hlbGxBY3Rpdml0eS5SRVNVTFRfRklMRSwgcmVzdWx0RmlsZSk7CiAgICAgICAgIGludGVudC5wdXRFeHRyYShUZXN0U2hlbGxBY3Rpdml0eS5USU1FT1VUX0lOX01JTExJUywgdGltZW91dCk7CisgICAgICAgIGludGVudC5wdXRFeHRyYShUZXN0U2hlbGxBY3Rpdml0eS5UT1RBTF9URVNUX0NPVU5UL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gZHVtcCB0ZXh0LiIpOwogICAgICAgICBzd2l0Y2ggKG1EdW1wRGF0YVR5cGUpIHsKICAgICAgICAgICAgIGNhc2UgRFVNUF9BU19URVhUOgorICAgICAgICAgICAgICAgIGNhbGxiYWNrLmFyZzEgPSBtRHVtcFRvcEZyYW1lQXNUZXh0ID8gMSA6IDA7CisgICAgICAgICAgICAgICAgY2FsbGJhY2suYXJnMiA9IG1EdW1wQ2hpbGRGcmFtZXNBc1RleHQgPyAxIDogMDsKICAgICAgICAgICAgICAgICBtV2ViVmlldy5kb2N1bWVudEFzVGV4dChjYWxsYmFjayk7CiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICBjYXNlIEVYVF9SRVBSOgpAQCAtMTE2LDYgKzEyMCw3IEBACiAgICAgQE92ZXJyaWRlCiAgICAgcHJvdGVjdGVkIHZvaWQgb25DcmVhdGUoQnVuZGxlIGljaWNsZSkgewogICAgICAgICBzdXBlci5vbkNyZWF0ZShpY2ljbGUpOworICAgICAgICByZXF1ZXN0V2luZG93RmVhdHVyZShXaW5kb3cuRkVBVFVSRV9QUk9HUkVTUyk7CiAKICAgICAgICAgTGluZWFyTGF5b3V0IGNvbnRlbnRWaWV3ID0gbmV3IExpbmVhckxheW91dCh0aGlzKTsKICAgICAgICAgY29udGVudFZpZXcuc2V0T3JpZW50YXRpb24oTGluZWFyTGF5b3V0LlZFUlRJQ0FMKTsKQEAgLTE1OCw2ICsxNjMsOSBAQAogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAKKyAgICAgICAgbVRvdGFsVGVzdENvdW50ID0gaW50ZW50LmdldEludEV4dHJhKFRPVEFMX1RFU1RfQ09VTlQsIG1Ub3RhbFRlc3RDb3VudCk7CisgICAgICAgIG1DdXJyZW50VGVzdE51bWJlciA9IGludGVudC5nZXRJbnRFeHRyYShDVVJSRU5UX1RFU1RfTlVNQkVSLCBtQ3VycmVudFRlc3ROdW1iZXIpOworCiAgICAgICAgIG1UZXN0VXJ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UWV9TSU5HTEVfVE9QKTsKICAgICAgICAgaW50ZW50LnB1dEV4dHJhKFRlc3RTaGVsbEFjdGl2aXR5LlRFU1RfVVJMLCBGc1V0aWxzLmdldFRlc3RVcmwodXJsKSk7CisgICAgICAgIGludGVudC5wdXRFeHRyYShUZXN0U2hlbGxBY3Rpdml0eS5DVVJSRU5UX1RFU1RfTlVNQkVSLCArK21DdXJyZW50VGVzdE51bWJlcik7CiAgICAgICAgIGludGVudC5wdXRFeHRyYShUSU1FT1VUX0lOX01JTExJUywgMTAwMDApOwogICAgICAgICBleGVjdXRlSW50ZW50KGludGVudCk7CiAgICAgfQpAQCAtMzMwLDEyICszNDMsMjIgQEAKICAgICAvLyBMYXlvdXRUZXN0Q29udHJvbGxlciBGdW5jdGlvbnMKICAgICBwdWJsaWMgdm9pZCBkdW1wQXNUZXh0KCkgewogICAgICAgICBtRHVtcERhdGFUeXBlID0gRHVtcERhdGFUeXBlLkRVTVBfQVNfVEVYVDsKKyAgICAgICAgbUR1bXBUb3BGcmFtZUFzVGV4dCA9IHRydWU7CiAgICAgICAgIGlmIChtV2ViVmlldyAhPSBudWxsKSB7CiAgICAgICAgICAgICBTdHJpbmcgdXJsID0gbVdlYlZpZXcuZ2V0VXJsKCk7CiAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJkdW1wQXNUZXh0IGNhbGxlZDogIit1cmwpOwogICAgICAgICB9CiAgICAgfQogCisgICAgcHVibGljIHZvaWQgZHVtcENoaWxkRnJhbWVzQXNUZXh0KCkgeworICAgICAgICBtRHVtcERhdGFUeXBlID0gRHVtcERhdGFUeXBlLkRVTVBfQVNfVEVYVDsKKyAgICAgICAgbUR1bXBDaGlsZEZyYW1lc0FzVGV4dCA9IHRydWU7CisgICAgICAgIGlmIChtV2ViVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICBTdHJpbmcgdXJsID0gbVdlYlZpZXcuZ2V0VXJsKCk7CisgICAgICAgICAgICBMb2cudihMT0dUQUcsICJkdW1wQ2hpbGRGcmFtZXNBc1RleHQgY2FsbGVkOiAiK3VybCk7CisgICAgICAgIH0KKyAgICB9CisKICAgICBwdWJsaWMgdm9pZCB3YWl0VW50aWxEb25lKCkgewogICAgICAgICBtV2FpdFVudGlsRG9uZSA9IHRydWU7CiAgICAgICAgIFN0cmluZyB1cmwgPSBtV2ViVmlldy5nZXRVcmwoKTsKQEAgLTM0Nyw3ICszNzAsOSBAQAogICAgICAgICBMb2cudihMT0dUQUcsICJub3RpZnlEb25lIGNhbGxlZDogIiArIHVybCk7CiAgICAgICAgIGlmIChtV2FpdFVudGlsRG9uZSkgewogICAgICAgICAgICAgbVdhaXRVbnRpbERvbmUgPSBmYWxzZTsKLSAgICAgICAgICAgIG1DaHJvbWVDbGllbnQub25Qcm9ncmVzc0NoYW5nZWQobVdlYlZpZXcsIDEwMSk7CisgICAgICAgICAgICBpZiAoIW1SZXF1ZXN0ZWRXZWJLaXREYXRhICYmICFtVGltZWRPdXQgJiYgIWZpbmlzaGVkKCkpIHsKKyAgICAgICAgICAgICAgICByZXF1ZXN0V2ViS2l0RGF0YSgpOworICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQogCkBAIC00NzIsNiArNDk3LDEwIEBACiAgICAgICAgIH0KICAgICB9CiAKKyAgICBwdWJsaWMgdm9pZCBzZXRYU1NBdWRpdG9yRW5hYmxlZCAoYm9vbGVhbiBmbGFnKSB7CisgICAgICAgIG1XZWJWaWV3LmdldFNldHRpbmdzKCkuc2V0WFNTQXVkaXRvckVuYWJsZWQoZmxhZyk7CisgICAgfQorCiAgICAgcHJpdmF0ZSBmaW5hbCBXZWJWaWV3Q2xpZW50IG1WaWV3Q2xpZW50ID0gbmV3IFdlYlZpZXdDbGllbnQoKXsKICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgIHB1YmxpYyB2b2lkIG9uUGFnZUZpbmlzaGVkKFdlYlZpZXcgdmlldywgU3RyaW5nIHVybCkgewpAQCAtNDg5LDExICs1MTgsMzAgQEAKICAgICAgICAgICAgICAgICAgICAgZHJhd1BhZ2VUb0ZpbGUobVNhdmVJbWFnZVBhdGggKyAiLyIgKyBuYW1lICsgIi5wbmciLCBtV2ViVmlldyk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQorCiAgICAgICAgICAgICAvLyBDYWxsaW5nIGZpbmlzaGVkKCkgd2lsbCBjaGVjayBpZiB3ZSd2ZSBtZXQgYWxsIHRoZSBjb25kaXRpb25zIGZvciBjb21wbGV0aW5nCi0gICAgICAgICAgICAvLyB0aGlzIHRlc3QgYW5kIG1vdmUgdG8gdGhlIG5leHQgb25lIGlmIHdlIGFyZSByZWFkeS4KKyAgICAgICAgICAgIC8vIHRoaXMgdGVzdCBhbmQgbW92ZSB0byB0aGUgbmV4dCBvbmUgaWYgd2UgYXJlIHJlYWR5LiBPdGhlcndpc2Ugd2UgYXNrIFdlYkNvcmUgdG8KKyAgICAgICAgICAgIC8vIGR1bXAgdGhlIHBhZ2UuCiAgICAgICAgICAgICBpZiAoZmluaXNoZWQoKSkgewogICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKCFtV2FpdFVudGlsRG9uZSAmJiAhbVJlcXVlc3RlZFdlYktpdERhdGEgJiYgIW1UaW1lZE91dCkgeworICAgICAgICAgICAgICAgIHJlcXVlc3RXZWJLaXREYXRhKCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGlmIChtV2FpdFVudGlsRG9uZSkgeworICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJwYWdlIGZpbmlzaGVkIGxvYWRpbmcgYnV0IHdhaXRpbmcgZm9yIG5vdGlmeURvbmUgdG8gYmUgY2FsbGVkOiAiICsgdXJsKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAobVJlcXVlc3RlZFdlYktpdERhdGEpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEF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VzcyB1cGRhdGUgY2FtZSBmcm9tCi0gICAgICAgICAgICAvLyBXZWJDb3JlIG9yIG5vdGlmeURvbmUuCi0gICAgICAgICAgICBpZiAobmV3UHJvZ3Jlc3MgPj0gMTAwKSB7Ci0gICAgICAgICAgICAgICAgLy8gZmluaXNoZWQoKSB3aWxsIGNoZWNrIGlmIHdlIGFyZSByZWFkeSB0byBtb3ZlIHRvIHRoZSBuZXh0IHRlc3QgYW5kIGRvIHNvIGlmIHdlIGFyZS4KLSAgICAgICAgICAgICAgICBpZiAoZmluaXNoZWQoKSkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKCFtVGltZWRPdXQgJiYgIW1XYWl0VW50aWxEb25lICYmICFtUmVxdWVzdGVkV2ViS2l0RGF0YSkgewotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgdXJsID0gbVdlYlZpZXcuZ2V0VXJsKCk7Ci0gICAgICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgIkZpbmlzaGVkOiAiKyB1cmwpOwotICAgICAgICAgICAgICAgICAgICByZXF1ZXN0V2ViS2l0RGF0YSgpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyB1cmwgPSBtV2ViVmlldy5nZXRVcmwoKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1UaW1lZE91dCkgewotICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAiVGltZWQgb3V0IGJlZm9yZSBmaW5pc2hpbmc6ICIgKyB1cmwpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1XYWl0VW50aWxEb25lKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJXYWl0aW5nIGZvciBub3RpZnlEb25lOiAiICsgdXJsKTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtUmVxdWVzdGVkV2ViS2l0RGF0YSkgewotICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAiUmVxdWVzdGVkIHdlYmtpdCBkYXRhIHJlYWR5OiAiICsgdXJsKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIEBPdmVycmlkZQogICAgICAgICBwdWJsaWMgdm9pZCBvblJlY2VpdmVkVGl0bGUoV2ViVmlldyB2aWV3LCBTdHJpbmcgdGl0bGUpIHsKLSAgICAgICAgICAgIGlmICh0aXRsZS5sZW5ndGgoKSA+IDMwKQotICAgICAgICAgICAgICAgIHRpdGxlID0gIi4uLiIrdGl0bGUuc3Vic3RyaW5nKHRpdGxlLmxlbmd0aCgpLTMwKTsKLSAgICAgICAgICAgIHNldFRpdGxlKHRpdGxlKTsKKyAgICAgICAgICAgIHNldFRpdGxlKCJUZXN0ICIgKyBtQ3VycmVudFRlc3ROdW1iZXIgKyAiIG9mICIgKyBtVG90YWxUZXN0Q291bnQgKyAiOiAiKyB0aXRsZSk7CiAgICAgICAgICAgICBpZiAobUR1bXBUaXRsZUNoYW5nZXMpIHsKICAgICAgICAgICAgICAgICBtVGl0bGVDaGFuZ2VzLmFwcGVuZCgiVElUTEUgQ0hBTkdFRDogIik7CiAgICAgICAgICAgICAgICAgbVRpdGxlQ2hhbmdlcy5hcHBlbmQodGl0bGUpOwpAQCAtNjc1LDE1ICs2ODcsMjggQEAKICAgICAgICAgfQogCiAgICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgdm9pZCBvbkNvbnNvbGVNZXNzYWdlKFN0cmluZyBtZXNzYWdlLCBpbnQgbGluZU51bWJlciwKLSAgICAgICAgICAgICAgICBTdHJpbmcgc291cmNlSUQpIHsKKyAgICAgICAgcHVibGljIGJvb2xlYW4gb25Db25zb2xlTWVzc2FnZShDb25zb2xlTWVzc2FnZSBjb25zb2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WQgYXQgdGhpcyBwb2ludCBhbmQgYQorICAgICAgICAgICAgLy8gIm5vdGlmeURvbmUiIHdpbGwgbmV2ZXIgY29tZSBvdXQgc28gaXQncyBqdXN0IHdhc3RpbmcgdGltZSB0aWxsIHRpbWVvdXQga2lja3MgaW4KKyAgICAgICAgICAgIGlmIChtc2cuY29udGFpbnMoIlVuY2F1Z2h0IFJlZmVyZW5jZUVycm9yOiIpIHx8IG1zZy5jb250YWlucygiVW5jYXVnaHQgVHlwZUVycm9yOiIpCisgICAgICAgICAgICAgICAgICAgICYmIG1XYWl0VW50aWxEb25lKSB7CisgICAgICAgICAgICAgICAgTG9nLncoTE9HVEFHLCAiVGVybWluYXRpbmcgdGVzdCBjYXNlIG9uIHVuY2F1Z2h0IFJlZmVyZW5jZUVycm9yIG9yIFR5cGVFcnJvci4iKTsKKyAgICAgICAgICAgICAgICBtSGFuZGxlci5wb3N0RGVsYXllZChuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG5vdGlmeURvbmUoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0sIDUwMCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgfQogCiAgICAgICAgIEBPdmVycmlkZQpAQCAtNzI5LDYgKzc1NCw4IEBACiAgICAgcHJpdmF0ZSB2b2lkIHJlc2V0VGVzdFN0YXR1cygpIHsKICAgICAgICAgbVdhaXRVbnRpbERvbmUgPSBmYWxzZTsKICAgICAgICAgbUR1bXBEYXRhVHlwZSA9IG1EZWZhdWx0RHVtcERhdGFUeXBlOworICAgICAgICBtRHVtcFRvcEZyYW1lQXNUZXh0ID0gZmFsc2U7CisgICAgICAgIG1EdW1wQ2hpbGRGcmFtZXNBc1RleHQgPSBmYWxzZTsKICAgICAgICAgbVRpbWVkT3V0ID0gZmFsc2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gICAgICAgIENvbG9yVmlldyBjb2xvciA9IG5ldyBDb2xvclZpZXcodGhpcyk7CisgICAgICAgIGNvbnRhaW5lci5hZGRWaWV3KGNvbG9yLCBuZXcgRGlydHlCaXRtYXBWaWV3LkxheW91dFBhcmFtcygKKyAgICAgICAgICAgICAgICBkaXBUb1B4KHRoaXMsIDEwMCksIGRpcFRvUHgodGhpcywgMTAwKSwgR3Jhdml0eS5DRU5URVIpKTsKKworICAgICAgICBBbHBoYUFuaW1hdGlvbiBhID0gbmV3IEFscGhhQW5pbWF0aW9uKDEuMGYsIDAuMGYpOworICAgICAgICBhLnNldER1cmF0aW9uKDIwMDApOworICAgICAgICBhLnNldFJlcGVhdENvdW50KEFuaW1hdGlvbi5JTkZJTklURSk7CisgICAgICAgIGEuc2V0UmVwZWF0TW9kZShBbmltYXRpb24uUkVWRVJTRSk7CisgICAgICAgIGNvbG9yLnN0YXJ0QW5pbWF0aW9uKGEpOworCisgICAgICAgIHNldENvbnRlbnRWaWV3KGNvbnRhaW5lcik7CisgICAgfQorICAgIAorICAgIEBTdXBwcmVzc1dhcm5pbmdzKHsiVW51c2VkRGVjbGFyYXRpb24ifSkKKyAgICBzdGF0aWMgaW50IGRpcFRvUHgoQ29udGV4dCBjLCBpbnQgZGlwKSB7CisgICAgICAgIHJldHVybiAoaW50KSAoYy5nZXRSZXNvdXJjZXMoKS5nZXREaXNwbGF5TWV0cmljcygpLmRlbnNpdHkgKiBkaXAgKyAwLjVmKTsKKyAgICB9CisKKyAgICBzdGF0aWMgY2xhc3MgQ29sb3JWaWV3IGV4dGVuZHMgVmlldyB7CisgICAgICAgIENvbG9yVmlldyhDb250ZXh0IGMpIHsKKyAgICAgICAgICAgIHN1cGVyKGMpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uRHJhdyhDYW52YXMgY2FudmFzKSB7CisgICAgICAgICAgICBzdXBlci5vbkRyYXcoY2FudmFzKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UkdCKDAsIDI1NSwgMCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBzdGF0aWMgY2xhc3MgRGlydHlCaXRtYXBWaWV3IGV4dGVuZHMgRnJhbWVMYXlvdXQgeworICAgICAgICBwcml2YXRlIGZpbmFsIFBhaW50IG1QYWludDsKKworICAgICAgICBEaXJ0eUJpdG1hcFZpZXcoQ29udGV4dCBjKSB7CisgICAgICAgICAgICBzdXBlcihjKTsKKyAgICAgICAgICAgIG1QYWludCA9IG5ldyBQYWludCgpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGRpc3BhdGNoRHJhdyhDYW52YXMgY2FudmFzKSB7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JHQigyNTUsIDI1NSwgMjU1KTsKKworICAgICAgICAgICAgbVBhaW50LnNldENvbG9yKDB4ZmZmZjAwMDApOworICAgICAgICAgICAgY2FudmFzLmRyYXdSZWN0KDIwMC4wZiwgMC4wZiwgMjIwLjBmLCAyMC4wZiwgbVBhaW50KTsKKworICAgICAgICAgICAgY2FudmFzLnNhdmUoKTsKKyAgICAgICAgICAgIGNhbnZhcy5jbGlwUmVjdCgyMC4wZiwgMC4wZiwgNDAuMGYsIDIwLjBmKTsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJjbGlwUmVjdCA9ICIgKyBjYW52YXMuZ2V0Q2xpcEJvdW5kcygpKTsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJyZWplY3RlZCA9ICIgKyBjYW52YXMucXVpY2tSZWplY3QoMTAwLjBmLCAxMDAuMGYsIDExMC4wZiwgMTEwLjBmLAorICAgICAgICAgICAgICAgICAgICBDYW52YXMuRWRnZVR5cGUuQlcpKTsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJyZWplY3RlZCA9ICIgKyBjYW52YXMucXVpY2tSZWplY3QoMjUuMGYsIDUuMGYsIDMwLjBmLCAxMC4wZiwKKyAgICAgICAgICAgICAgICAgICAgQ2FudmFzLkVkZ2VUeXBlLkJXKSk7CisgICAgICAgICAgICBjYW52YXMucmVzdG9yZSgpOworICAgICAgICAgICAgCisgICAgICAgICAgICBjYW52YXMuc2F2ZSgpOworICAgICAgICAgICAgY2FudmFzLnNjYWxlKDIuMGYsIDIuMGYpOworICAgICAgICAgICAgY2FudmFzLmNsaXBSZWN0KDIwLjBmLCAwLjBmLCA0MC4wZiwgMjAuMGYpOworICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgImNsaXBSZWN0ID0gIiArIGNhbnZhcy5nZXRDbGlwQm91bmRzKCkpOworICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgInJlamVjdGVkID0gIiArIGNhbnZhcy5xdWlja1JlamVjdCg1MC4wZiwgNTAuMGYsIDYwLjBmLCA2MC4wZiwKKyAgICAgICAgICAgICAgICAgICAgQ2FudmFzLkVkZ2VUeXBlLkJXKSk7CisgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAicmVqZWN0ZWQgPSAiICsgY2FudmFzLnF1aWNrUmVqZWN0KDI1LjBmLCA1LjBmLCAzMC4wZiwgMTAuMGYsCisgICAgICAgICAgICAgICAgICAgIENhbnZhcy5FZGdlVHlwZS5CVykpOworICAgICAgICAgICAgY2FudmFzLnJlc3RvcmUoKTsKKworICAgICAgICAgICAgY2FudmFzLnNhdmUoKTsKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMjAuMGYsIDIwLjBmKTsKKyAgICAgICAgICAgIGNhbnZhcy5jbGlwUmVjdCgyMC4wZiwgMC4wZiwgNDAuMGYsIDIwLjBmKTsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJjbGlwUmVjdCA9ICIgKyBjYW52YXMuZ2V0Q2xpcEJvdW5kcygpKTsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJyZWplY3RlZCA9ICIgKyBjYW52YXMucXVpY2tSZWplY3QoODAuMGYsIDgwLjBmLCA5MC4wZiwgOTAuMGYsCisgICAgICAgICAgICAgICAgICAgIENhbnZhcy5FZGdlVHlwZS5CVykpOworICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgInJlamVjdGVkID0gIiArIGNhbnZhcy5xdWlja1JlamVjdCgyNS4wZiwgNS4wZiwgMzAuMGYsIDEwLjBmLAorICAgICAgICAgICAgICAgICAgICBDYW52YXMuRWRnZVR5cGUuQlcpKTsKKyAgICAgICAgICAgIGNhbnZhcy5yZXN0b3JlKCk7CisKKyAgICAgICAgICAgIGNhbnZhcy5zYXZlKCk7CisgICAgICAgICAgICBjYW52YXMuc2NhbGUoMi4wZiwgMi4wZik7ICAgICAgICAgICAgCisgICAgICAgICAgICBjYW52YXMuY2xpcFJlY3QoMjAuMGYsIDAuMGYsIDQwLjBmLCAyMC4wZik7CisKKyAgICAgICAgICAgIG1QYWludC5zZXRDb2xvcigweGZmMDBmZjAwKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdCgwLjBmLCAwLjBmLCAyMC4wZiwgMjAuMGYsIG1QYWludCk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIG1QYWludC5zZXRDb2xvcigweGZmMDAwMGZmKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdCgyMC4wZiwgMC4wZiwgNDAuMGYsIDIwLjBmLCBtUGFpbnQpOworICAgICAgICAgICAgCisgICAgICAgICAgICBjYW52YXMucmVzdG9yZSgpOworCisgICAgICAgICAgICBmaW5hbCBpbnQgcmVzdG9yZVRvID0gY2FudmFzLnNhdmUoKTsKKyAgICAgICAgICAgIGNhbnZhcy5zYXZlTGF5ZXJBbHBoYSgwLjBmLCAxMDAuMGYsIGdldFdpZHRoKCksIDE1MC4wZiwgMTI3LAorICAgICAgICAgICAgICAgICAgICBDYW52YXMuSEFTX0FMUEhBX0xBWUVSX1NBVkVfRkxBRyB8IENhbnZhcy5DTElQX1RPX0xBWUVSX1NBVkVfRkxBRyk7CisgICAgICAgICAgICBtUGFpbnQuc2V0Q29sb3IoMHhmZjAwMDBmZik7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QoMC4wZiwgMTAwLjBmLCA0MC4wZiwgMTUwLjBmLCBtUGFpbnQpOworICAgICAgICAgICAgbVBhaW50LnNldENvbG9yKDB4ZmYwMGZmZmYpOworICAgICAgICAgICAgY2FudmFzLmRyYXdSZWN0KDQwLjBmLCAxMDAuMGYsIDE0MC4wZiwgMTUwLjBmLCBtUGFpbnQpOworICAgICAgICAgICAgbVBhaW50LnNldENvbG9yKDB4ZmZmZjAwZmYpOworICAgICAgICAgICAgY2FudmFzLmRyYXdSZWN0KDE0MC4wZiwgMTAwLjBmLCAyNDAuMGYsIDE1MC4wZiwgbVBhaW50KTsKKyAgICAgICAgICAgIGNhbnZhcy5yZXN0b3JlVG9Db3VudChyZXN0b3JlVG8pOworCisgICAgICAgICAgICBzdXBlci5kaXNwYXRjaERyYXcoY2FudmFzKTsKKyAgICAgICAgfQorICAgIH0KK30KZGlmZiAtLWdpdCBhL3Rvb2xzL2FhcHQvQ29tbWFuZC5jcHAgYi90b29scy9hYXB0L0NvbW1hbmQuY3BwCmluZGV4IDgzMDU3YjguLmM0MGFmODAgMTAwNjQ0Ci0tLSBhL3Rvb2xzL2FhcHQvQ29tbWFuZC5jcHAKKysrIGIvdG9vbHMvYWFwdC9Db21tYW5kLmNwcApAQCAtMTk3LDggKzE5NywxMCBAQAogICAgICAgICBpZiAoJnJlcyA9PSBOVUxMKSB7CiAgICAgICAgICAgICBwcmludGYoIlxuTm8gcmVzb3VyY2UgdGFibGUgZm91bmQuXG4iKTsKICAgICAgICAgfSBlbHNlIHsKKyNpZm5kZWYgSEFWRV9BTkRST0lEX09TCiAgICAgICAgICAgICBwcmludGYoIlxuUmVzb3VyY2UgdGFibGU6XG4iKTsKICAgICAgICAgICAgIHJlcy5wcmludChmYWxzZSk7CisjZW5kaWYKICAgICAgICAgfQogCiAgICAgICAgIEFzc2V0KiB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5kZXggY2FmZDYzNS4uNTg1NWI1NiAxMDA2NDQKLS0tIGEvdG9vbHMvYWFwdC9SZXNvdXJjZS5jcHAKKysrIGIvdG9vbHMvYWFwdC9SZXNvdXJjZS5jcHAKQEAgLTU0MiwxMSArNTQyLDExIEBACiAgICAgICAgICAgICAgICAgICAgICAgICBEZWZhdWx0S2V5ZWRWZWN0b3I8QWFwdEdyb3VwRW50cnksIHNwPEFhcHRGaWxlPiA+IGJhc2VGaWxlcyA9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhc2VHcm91cC0+Z2V0RmlsZXMoKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoc2l6ZV90IGk9MDsgaSA8IGJhc2VGaWxlcy5zaXplKCk7IGkrKykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiYmFzZUZpbGUgJWxkIGhhcyBmbGF2b3IgJXNcbiIsIGksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCJiYXNlRmlsZSAlZCBoYXMgZmxhdm9yICVzXG4iLCBpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFzZUZpbGVzLmtleUF0KGkpLnRvU3RyaW5nKCkuc3RyaW5nKCkpOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChzaXplX3QgaT0wOyBpIDwgb3ZlcmxheUZpbGVzLnNpemUoKTsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCJvdmVybGF5RmlsZSAlbGQgaGFzIGZsYXZvciAlc1xuIiwgaSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGYoIm92ZXJsYXlGaWxlICVkIGhhcyBmbGF2b3IgJXNcbiIsIGksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdmVybGF5RmlsZXMua2V5QXQoaSkudG9TdHJpbmcoKS5zdHJpbmcoKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTU2MCw3ICs1NjAsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXlBdChvdmVybGF5R3JvdXBJbmRleCkpOwogICAgICAgICAgICAgICAgICAgICAgICAgaWYoYmFzZUZpbGVJbmRleCA8IFVOS05PV05fRVJST1IpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYnVuZGxlLT5nZXRWZXJib3NlKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCJmb3VuZCBhIG1hdGNoICglbGQpIGZvciBvdmVybGF5IGZpbGUgJXMsIGZvciBmbGF2b3IgJXNcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiZm91bmQgYSBtYXRjaCAoJWQpIGZvciBvdmVybGF5IGZpbGUgJXMsIGZvciBmbGF2b3IgJXNcbiIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFzZUZpbGVJbmRleCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdmVybGF5R3JvdXAtPmdldExlYWYoKS5zdHJpbmcoKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdmVybGF5RmlsZXMua2V5QXQob3ZlcmxheUdyb3VwSW5kZXgpLnRvU3RyaW5nKCkuc3RyaW5nKCkpOwpkaWZmIC0tZ2l0IGEvdG9vbHMvYWFwdC9SZXNvdXJjZVRhYmxlLmNwcCBiL3Rvb2xzL2FhcHQvUmVzb3VyY2VUYWJsZS5jcHAKaW5kZXggNzU1YjkzYi4uZjQwYTg3NyAxMDA2NDQKLS0tIGEvdG9vbHMvYWFwdC9SZXNvdXJjZVRhYmxlLmNwcAorKysgYi90b29scy9hYXB0L1Jlc291cmNlVGFibGUuY3BwCkBAIC0yMzY2LDcgKzIzNj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